[R] R^2 from lme function

Cleber Borges klebyn at yahoo.com.br
Mon May 14 17:55:17 CEST 2007


Hi Martin,

many thanks for your tip!

but,                                        { :-(   }
what it 'full MLE' ?   how to calculate? it is a saturated model???

and

it is valid for 'no-intercept model?


Many thanks again...

Cleber


> Hi Cleber,
> I have been using this function I wrote for lmer output. It should be 
> easy to convert to lme. As with everything, buyer beware. Note that it 
> requires (full) maximum likelihood estimates.
>
>
> Rsq <- function(reml.mod) {
>  ## Based on
>   ## N. J. D. Nagelkerke. A note on a general definition
>   ## of the coefficient of determination. Biometrika, 78:691–692, 1991.
>   ml.mod <- update(reml.mod, method="ML")
>   l.B <- logLik(ml.mod)
>   l.0 <- logLik( lm(ml.mod at y ~ 1) )
>   Rsq <- 1 - exp( - ( 2/length(ml.mod at y) ) * (l.B - l.0) )
> Rsq[1]
> }
>
> Hank
>
>
>
>
>> Hello allR
>> How to access R^2 from lme object?
>> or how to calculate it?
>> ( one detail: my model do not have a intercept )
>> thanks in advanced
>> Cleber

		
_______________________________________________________ 

Experimente já e veja as novidades.



More information about the R-help mailing list