What do you mean about not getting similar results? Do you mean that there is information that's missing, or that you're getting different estimates? If the latter, are you sure that the input data is the same?
–
David RobinsonAug 5 '12 at 20:22

I'm getting different estimates. I have indeed checked that the input data is identical also, i.e. df1 in SAS = df1 in R.
–
baha-kevAug 5 '12 at 20:26

might it just be a difference in contrasts of the fixed effects? i.e. contrasts(df1$GROUP) <- contr.SAS(2) ?
–
Ben BolkerAug 6 '12 at 1:07

Hi @BenBolker! Good to see you noticing this thread. I'll be curious if you agree with my assessment below or not. I think this is trickier than the OP hoped, but it would be nice if I was wrong.
–
AaronAug 6 '12 at 1:38

@baha-kev: If you add the statistical information and ask it more in terms of what model is appropriate, this would be a great question for stats.stackexchange.
–
AaronAug 6 '12 at 1:56

I'm pretty sure that random = ~ GROUP | person doesn't change anything from the original code because each person is only in one group. What that syntax would do is allow the covariance between levels of group to differ within an individual.
–
AaronAug 6 '12 at 1:36

I still think the random effect isn't right. random = list(person = pdDiag(form = ~ GROUP - 1)) is still allowing the covariance between levels of group to differ within an individual, but is forcing them not to be correlated.
–
AaronAug 6 '12 at 17:15

Also, since R actually parameterizes the model in terms of the correlation and the variances, it's hard to see how your matrix matches the R code you wrote. Not that it's necessarily wrong, but it would help if you used R's parameterization to explain.
–
AaronAug 6 '12 at 17:17

This darn near perfectly matches the proc mixed output so I will mark as answered. Thanks Triad!
–
baha-kevAug 8 '12 at 0:51

@baha-kev: That would be cool! But when I ran it I couldn't see how the variance terms agreed; can you share your results by editing the original post?
–
AaronAug 8 '12 at 1:04

Oooh, this is going to be a tricky one, and if it's even possible using standard nlme functions, is going to take some serious study of Pinheiro/Bates.

Before you spend the time doing that though, you should make absolutely sure that this is exact model you need. Perhaps there's something else that might fit the story of your data better. Or maybe there's something R can do more easily that is just as good, but not quite the same.

First, here's my take on what you're doing in SAS with this line:

repeated / type=cs subject=person group=GROUP;

This type=cs subject=person is inducing correlation between all the measurements on the same person, and that correlation is the same for all pairs of days. The group=GROUP is allowing the correlation for each group to be different.

In contrast, here's my take on what your R code is doing:

random = ~ +1 | person,
correlation=corCompSymm(form=~day|person)

This code is actually adding almost the same effect in two different ways; the random line is adding a random effect for each person, and the correlation line is inducing correlation between all the measurements on the same person. However, these two things are almost identical; if the correlation is positive, you get the exact same result by including either of them. I'm not sure what happens when you include both, but I do know that only one is necessary. Regardless, this code has the same correlation for all individuals, it's not allowing each group to have their own correlation.

To let each group have their own correlation, I think you have to build a more complicated correlation structure up out of two different pieces; I've never done this but I'm pretty sure I remember Pinheiro/Bates doing it.

You might consider instead adding a random effect for person and then letting the variance be different for the different groups with weights=varIdent(form=~1|group) (from memory, check my syntax, please). This won't quite be the same but tells a similar story. The story in SAS is that the measurements on some individuals are more correlated than the measurements on other individuals. Thinking about what that means, the measurements for individuals with higher correlation will be closer together than the measurements for individuals with lower correlation. In contrast, the story in R is that the variability of measurements within individuals varies; thinking about that, measurements with higher variability with have lower correlation. So they do tell similar stories, but come at it from opposite sides.

It is even possible (but I would be surprised) that these two models end up being different parameterizations of the same thing. My intuition is that the overall measurement variability will be different in some way. But even if they aren't the same thing, it would be worth writing out the parameterizations just to be sure you understand them and to make sure that they are appropriately describing the story of your data.

A final thought though, changing the the correlation structure usually doesn't affect the estimates of the fixed effects, so if that's what's different, there may be something else going too.
–
AaronAug 6 '12 at 1:54

Your answer sounds reasonable to me, but I really think we need to hear/see more from the OP about what the output of each program looks like (I have access to SAS, but not conveniently) and where the key differences are ...
–
Ben BolkerAug 6 '12 at 4:01

Thanks, @BenBolker. I haven't tried running the OP's code either; I have access to SAS but not conveniently from home.
–
AaronAug 6 '12 at 4:36

One thought -- I get errors when I delete the random= term while keeping the correlation= term. If, as you say, they are redundant then I should be able to remove one.
–
baha-kevAug 8 '12 at 0:58

@baha-kev: Be sure to switch to gls when you remove the random effects.
–
AaronAug 8 '12 at 1:03