[R] Fit unequal variance model in R

Feng, Jingyu
Wed, 01 Apr 2009 15:19:05 -0000

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

  Control         A           1      0.81301
  Control         B           1      1.06061
  Control         C           1      1.26350
  Control         D           1      0.93284
  Low             A           2      0.79359
  Low             B           2      0.89111
  Low             C           2      1.03485
  Low             D           2      1.29166
  Mid             A           3      1.26900
  Mid             B           3       .
  Mid             C           3      1.58666
  Mid             D           3      1.35759
  High            A           4      2.02680
  High            B           4      1.52372
  High            C           4      2.19167
  High            D           4      1.29949


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.

If anyone could help, it will be greatly appreciated.

Thanks,
Jingyu



	[[alternative HTML version deleted]]