[R-sig-ME] asking about panel data

Ned Dochtermann ned.dochtermann at gmail.com
Wed Sep 29 00:18:23 CEST 2010


Silvi,

There's not going to be a typical r^2 calculated for mixed models just as
part of the output. Instead you have to use one of the extensions to
likelihood models. What I've done, and hopefully someone will correct me if
there is a better approach, has been to calculate r^2 based on Nagelkerke's
1991 formulation:

Nagelkerke, N. J. D. 1991. A note on a general definition of the coefficient
of determination. Biometrika 78:691-692.

Using nlme you would calculate r^2 as:
1-exp((-2/n)*(main.model$logLik-null.model$logLik))

Where the two models (obviously) correspond to your main model and a null.
"n" is the sample size.

You'll have to decide what the appropriate structure for your null model is;
that is, should you include the random terms or not-it is going to depend on
your question. It is also important to specify in your code for the initial
models that you want to use ML estimation rather than REML estimation. If
you choose to not include the random terms, use gls{nlme} to get the null
likelihood not "lm":
http://glmm.wikidot.com/random-effects-testing

There's a comment on Ben Bolker's site (the wiki link above) saying it isn't
necessarily a good idea to calculate r^2 but no expansion is given and so it
isn't clear whether that's mainly in reference to generalized models-which
aren't fit by likelihood.

You may also find it useful to search the archives of this listserv as I
would be surprised if this topic hasn't come up before.

Good luck!
Ned



--
Ned Dochtermann
Department of Biology
University of Nevada, Reno

ned.dochtermann at gmail.com
http://wolfweb.unr.edu/homepage/mpeacock/Dochter/
--

Hello Sir,,my name is Silvi from Indonesia. I want to ask you about R
squared of random effect model of panel data with maximum likelihood
estimation.  I have used the package nlme to find MLE for random
effects model of panel data. But, I don't find the R squared. How can
I get the value of R square of my models? This is my data.
Yti is percentage of poverty
X1 is gross regional domestic product per capita without the oil and gas
X2 is gross regional domestic product sector agricultural per labour
X3 is gross regional domestic product sector industri per labour
X4 is gross regional domestic product sector service per labour
t is year, i is cross section.




More information about the R-sig-mixed-models mailing list