Hi everybody,

I'm a french PhD student in statistic models, I'm using R for 2 years.

But now, I have to translate a SAS code in R code to try to soluce a problem
of convergence, and I don't understand well the SAS code, and how to obtain
the same model with R.
I have already read your pdf "lmer for SAS PROC MIXED Users" but it didn't
help me to soluce my problem.
So I ask your help :

We have a few data :
Vache = cow
Période = replication
Trait. = traitement
PL = Milk production

In this experiment, only 3 cows for the first replication, and 2 cows for
the second replication (so I think we have a problem of unbalanced data ?)

   Vache Période Trait.    PL
1   7427       1 Témoin     18.25
2   7461       1 Témoin     17.80
3   7528       1 Témoin     16.15
4   7427       1    36h         32.00
5   7461       1    36h         24.45
6   7528       1    36h         22.40
7   7427       2 Témoin     16.90
8   7461       2 Témoin     16.50
10  7427       2    36h        30.60
11  7461       2    36h        32.20


For the variable PL, the SAS code work and give this result :

proc mixed data=...;
class periode vache trait;
model PL = periode trait;
repeated periode / type=cs sub=vache;
lsmeans trait / pdiff;
run;

LSMeans :
Trait 1 17.3694 SE=1.4655  DF=2 t-value=11.85
Trait 2 28.5794 SE=1.4655  DF=2 t-value=19.50

Type 3 test of fixed effect
periode      numDF=1  DenDF=1 F-value=1.14     p-value = 0.5
trait        numDF=1  DenDF=1 F-value=28.69    p-value = 0.03


So I try different models in lmer() to find the same results, but neither
model gives me what I want.

model1=lmer(PL~Trait. +Période + 1|Vache , data=lait)

model2=lmer(PL~ Trait. + Période + Période|Vache , data=lait)

model3=lmer(PL~ Trait. + Période +  (1+Période|Vache) + (0+Période|Vache) ,
data=lait)

model4=lmer(PL~ Trait. +  (1+Période|Vache) + (0+Période|Vache) , data=lait)


model5=lmer(PL~ Trait. +  Période + (1|Vache) + (0+Période|Vache) ,
data=lait)


I don't understand how work "repeated" in SAS, I have read the guideline of
SAS about this but I don't find an example similar of mine.

I've seen that you know how traduce SAS mixed model in R model, so have you
got an idea to soluce my problem?

Thanks for your help,

Best,

Cécile SAUDER

--

	[[alternative HTML version deleted]]


