search for: fitgp1

Displaying 1 result from an estimated 1 matches for "fitgp1".

Did you mean: fitgpd
2023 Aug 29
1
logLIk(lme(...))?
..., and the sum of logLik for the latter two does not equal the former. TOY EXAMPLE: library(nlme) set.seed(1) lmePblm <- data.frame(y=c(rnorm(5, 1, 2), rnorm(5,3,5)), gp=factor(rep(1:2, each=5))) fit22 <- lme(y~gp, lmePblm, random=~1|gp, method='ML') fitGp1 <- lm(y~1, lmePblm[lmePblm$gp==1, ]) fitGp2 <- lm(y~1, lmePblm[lmePblm$gp==2, ]) (ll22 <- logLik(fit22)) (llGp1 <- logLik(fitGp1)) (llGp2 <- logLik(fitGp2)) # Why isn't (ll22 = llGp1+llGp2)? (ll22 - llGp1-llGp2) # And secondarily, how can I get the residual standard...