[R-sig-ME] Specifying correlation structure
Gavin Simpson
gavin.simpson at ucl.ac.uk
Tue May 15 18:15:07 CEST 2012
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
%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%
More information about the R-sig-mixed-models
mailing list