search for: lmemod

Displaying 3 results from an estimated 3 matches for "lmemod".

Did you mean: lmermod
2008 May 09
1
Using lme() inside a function
..., and I wish to do the same thing for each group, I have constructed a function which takes the dataset as input variable and gives a prediction result (here mean absolute error) as output. This is an example using the Orthodont dataset: library(MASS) library(nlme) PredRes<-function(D1) { lmemod=lme(distance~age*Sex, random=~1|Subject, data=subset(D1,age!=14),method="ML") themod=stepAIC(lmemod,dir="both") prs=predict(themod,newdata=subset(D1,age==14)) obs<-subset(D1,age==14)$distance print(mean(obs-prs)) } Using this function with D1=Orthodont gives: > Pred...
2008 May 09
2
How can one make stepAIC and lme
...roups, and I wish to do the same thing for each group, I have constructed a function which takes the dataset as input variable and gives a prediction result (here mean absolute error) as output. This is an example using the Orthodont dataset: library(MASS) library(nlme) PredRes<-function(D1) { lmemod=lme(distance~age*Sex, random=~1|Subject, data=subset(D1,age!=14),method="ML") themod=stepAIC(lmemod,dir="both") prs=predict(themod,newdata=subset(D1,age==14)) obs<-subset(D1,age==14)$distance print(mean(obs-prs)) } Using this function with D1=Orthodont gives: > PredRes(O...
2008 Nov 06
2
R Mixed Anova
Hi list, I was searching how to properly write a command line for a mixed ANOVA. Well honestly, there are so many material on the older post of the list that just confused me. I have five factors. Season (fixed) Beach (fixed) Line (fixed) Block (random) Strata (random) nested in Block And for each of the tree strata per block I got 3 replicates. I saw lots of things about