[R] plm summary error

Achim Zeileis Achim.Zeileis at wu-wien.ac.at
Mon Aug 3 18:02:57 CEST 2009


as usual with such specific questions, it is a good idea to have the 
package authors at least Cc (done now). In April I had already forwarded 
your message privately to the plm authors with the following comment:

I've quickly checked what is going on. If you do something like
    foo <- "individual"
    x <- plm(..., effect = foo)
    plm:::desribe(x, "effect")
it doesn't work. describe() entirely relies on the call on x$call which
cannot know anymore what "foo" was (unless you would evaluate it again).
I would recommend to make the model object self-contained. Within plm()
you could do
    result$args = list(model = model, effect = effect, ...)
etc. and then operate on that with describe(). That should be fully
backward compatible with your current approach.

Best regards,

On Mon, 3 Aug 2009, Ulrich Morawetz wrote:

> Dear "plm"-Package insiders,
> [I posted the following observation is April already but unfortunately I am not aware of any answers.
> With the hope that someone found an answer in the mean time, I ask again:]
> I realized the following difficulty with the summary.plm function (demonstrated with the example from the ?plm documentation).
> library(plm)
> data("Produc", package="Ecdat")
> estimation_method<-"within"
> estimation_effect<-"individual"
>     zz <- plm(log(gsp)~log(pcap)+log(pc)+log(emp)+unemp, data=Produc, index=c("state","year")
> , method=estimation_method
> , effect=estimation_effect
>    )
>     summary(zz)
> #Error: object of type 'symbol' is not subsettable
> #But if I run
>    zz <- plm(log(gsp)~log(pcap)+log(pc)+log(emp)+unemp, data=Produc, index=c("state","year")
> , method="within"
> , effect="individual"
> )
> summary(zz)
> #the summary function works fine.
> Is it wrong (or bad practice) to define the function's parameters as I did in the upper example? If yes, how should it be done correctly such that the summary function works?
> I am running R version 2.9.1  wie plm version 1.1-4 on a Windows XP workstation.   I checked, and the same issue occurs under Linux (Ubuntu).
> Thank you for your advice, Ulrich Morawetz
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

More information about the R-help mailing list