Search code examples
rplm

Why is plm not changing the method? (R)


I can provide code and more information if needed, but the question is the same. Running things like

plm(formula, data=panel_df, method='anything') %>% summary()

will only yield information as if I chose within as the method. This does not appear to be restricted to a particular panel data frame, though I have only checked with a couple.

Why might this be happening, and what, short of reinstalling R and RStudio, can I do to fix it? I think it was working up to a few days ago, though I am new to plm, so I'm not 100% sure.


Solution

  • There is no method argument to plm. Likely, you want the model argument (and in the case of a specific method for the random effect models, random.method). Please have a look at the documentation; the vignettes can serve as a particular good introduction.

    Building upton your code, these examples should work:

    plm(formula, data=panel_df, model='within') %>% summary()
    plm(formula, data=panel_df, model='random') %>% summary()
    plm(formula, data=panel_df, model='pooling') %>% summary()