Fit unequal variance model in R
Feng, Jingyu wrote:
I'am trying to develop some code if R, which would correspond to what I
did in SAS.
The data look like:
Treatment Replicate group1 GSI
..
The SAS code is:
proc mixed data=data_name order=data method=ml; *scoring=10;
classes group1;
model GSI=group1/residual influence solution;
repeated /group=group1;
run;
Basically, I need different variance for each treatment group. I want to
do the similar thing in R.
Here is what I get so far:
lm1<-lme(response~treatment,data=o,random=~1|as.factor(dummy),weights=varIdent(form=~1|treatment),method="ML")
There should no random term in the model. However If I don't specify one,
lme won't work, so I made a dummy variable, which equals to 1 for every
observation.
The much underused (quote Frank Harrell) gls in package nlme should do that. Quote PB (p250): It can be viewed as an lme function without the random argument. Dieter
View this message in context: http://www.nabble.com/Fit-unequal-variance-model-in-R-tp22829549p22830566.html Sent from the R help mailing list archive at Nabble.com.