[R-sig-ME] Specifying correlation structure

Gang Chen gangchen at mail.nih.gov
Tue May 15 18:59:46 CEST 2012


Thanks for the comments!

Currently I'm only trying to work on the model specification part with
one subject. With multiple subjects, I can easily switch from gls to
lme. Also the issue of corARMA or corAR1 or others is not important
right now. Instead my focus is, how to correctly specify the
correlation structure across the three conditions? You've kindly
helped me out on imposing the same correlation structure for the three
conditions. The only dangling part is, how to specify a different
correlation structure for each condition while modeling the
correlation similarity across the three conditions?

Gang


On Tue, May 15, 2012 at 12:15 PM, Gavin Simpson <gavin.simpson at ucl.ac.uk> wrote:
> On Tue, 2012-05-15 at 11:47 -0400, Highland Statistics Ltd wrote:
>> Many thanks for the suggestion. It seems that gls does not like that either:
>>
>> >/  (fm<- gls(res ~ 1+reg1+reg2+reg3, correlation=corARMA(c(0.02, 0.03), form=~time|condition, p=1,q=1), data=Dat))
>> /
>> Error in model.frame.default(formula = ~time + condition + res + reg1 +  :
>>    variable lengths differ (found for 'condition')
>
> <snip />
>
>>
>> That is because 'condition' is not in your Dat object. I guess it should be cond.
>> Why corARMA and not corAR1?
>>
>> I'm actually not sure whether your modelling approach is correct. The
>> unit is the subject....but the time | cond is imposing the correlation
>> inside the observations from the same condition. Is that what you
>> want? It would ignore any correlation between 2 observations from
>> different
>> conditions....but still from the same subject. But perhaps I did not
>> fully understand your original post.
>
> Those are good points Alain. My comment would be that the OP mentioned
> that there was just a single subject; whether that was just the example
> or a real property of the data, who knows? ;-)
>
> Like you, without further info, whether the nested ARMA(1,1) is
> sufficient will depend on the OP providing more info.
>
> G
>
>>
>> Alain
>>
>>
>> /
>>
>
> --
> %~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%
>  Dr. Gavin Simpson             [t] +44 (0)20 7679 0522
>  ECRC, UCL Geography,          [f] +44 (0)20 7679 0565
>  Pearson Building,             [e] gavin.simpsonATNOSPAMucl.ac.uk
>  Gower Street, London          [w] http://www.ucl.ac.uk/~ucfagls/
>  UK. WC1E 6BT.                 [w] http://www.freshwaters.org.uk
> %~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%
>
> _______________________________________________
> R-sig-mixed-models at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models



More information about the R-sig-mixed-models mailing list