Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Access theta from random effect model in plm()

I am running a random effects model and would like to take the theta object (the quasi-demeaned variance) and store it to an object. Looking around, it is not clear what this is stored as in a plm() object or where it comes from when I run the summary() function.

Here’s an example of code:

library(plm)
data("Produc", package = "plm")
zz <- plm(log(gsp) ~ log(pcap) + log(pc) + log(emp) + unemp, 
    data = Produc, index = c("state", "year"),
    model = "random")

summary(zz)
...
Effects:
                   var  std.dev share
idiosyncratic 0.001454 0.038137 0.175
individual    0.006838 0.082691 0.825
theta: 0.8888
...

I thought I might access it by doing theta <- zz$theta but that returns NULL.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

Anyone more familiar with how this package works who could give advice would be much appreciated!

>Solution :

The ercomp element of the model object contains the estimation of various component errors. You perhaps mean to get theta from zz$ercomp$theta; however, you do not have a random effects model in your original post?

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading