Hi,

mod1 <- lme(values ~ sample, random =~|ind, data= y)

random is a new argument rather than part of the formula as in lmer

HTH

Alan

On Friday, 17 August 2012, li li wrote:

> Dear all,
>   I am trying to use R to fit mixed models.
>   Take the following example, where ind is a random effect and
> sample is fixed. I wanted to fit
>    Model 1: values = ind + sample
>    Model 2: values =ind * sample
>    Model 3:  values=ind(sample) + sample
>
> Tried to use the below for mod1, but it did not work. Can anyone give
> some help on this. Thanks so much.
> mod1 <- lme(values ~ sample +
>                      random=~ 1|ind, data=y)
>
>
>
>
>
>
>
>
>        values ind sample
> 1  0.03325   1      1
> 2  0.03305   1      1
> 3  0.03185   1      1
> 4  0.03515   1      1
> 5  0.03375   1      1
> 6  0.01180   1      2
> 7  0.01850   1      3
> 8  0.02915   1      4
> 9  0.06200   1      5
> 10 0.03230   2      1
> 11 0.03345   2      1
> 12 0.03385   2      1
> 13 0.03605   2      1
> 14 0.03225   2      1
> 15 0.01145   2      2
> 16 0.01805   2      3
> 17 0.02950   2      4
> 18 0.05995   2      5
> 19 0.03425   3      1
> 20 0.03575   3      1
> 21 0.03535   3      1
> 22 0.03380   3      1
> 23 0.03410   3      1
> 24 0.01050   3      2
> 25 0.01735   3      3
> 26 0.03140   3      4
> 27 0.06170   3      5
> 28 0.03430   4      1
> 29 0.03185   4      1
> 30 0.03165   4      1
> 31 0.03380   4      1
> 32 0.03235   4      1
> 33 0.01100   4      2
> 34 0.01825   4      3
> 35 0.03045   4      4
> 36 0.06060   4      5
>
>         [[alternative HTML version deleted]]
>
> _______________________________________________
> R-sig-mixed-models@r-project.org <javascript:;> mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
>


-- 
--------------------------------------------------
Email: aghaynes@gmail.com
Mobile: +41794385586
Skype: aghaynes

	[[alternative HTML version deleted]]

