[R-sig-ME] lme AR1 structure, plus cross-posting etiquette (was Re: lme:correlations tructure AR1 and random factor)

Ben Bolker bbolker at gmail.com
Wed Mar 30 20:53:36 CEST 2011


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

  [cc'ing back to r-sig-mixed-models]

On 11-03-30 02:38 PM, Yvonne Fabian wrote:
> Well Ok I did not say that I allready asked that question. I
> specified my question anyway, since I think it is odd to use
> trapfield as random factor- and only field does not work. Sorry if I
> did not point that out- but in your last post you also suggested that
> there might be a special package to save that problem...
> 
> Thanks a lot any way Yvonne

  Thanks for responding -- it was indeed my suggestion that you post to
r-sig-mixed-models (and I didn't explicitly tell you to say that it was
a follow-up question).

  To expand slightly on my previous answer: you *might* be able to hack
the variance-covariance matrix classes in nlme (?pdClasses) to set the
'trap:field' variance component in the model to zero or nearly zero, but
this probably wouldn't be trivial.

  The basic problem is that there is an absolutely enormous range of
possible ways that people might want to structure the group and
correlation variance structures (even restricting to sensible ones!);
the challenge for software designers is coming up with a way to allow
the largest number of structures to be specified in a way that still
allows for some degree of computational efficiency, keeps the internal
code from being a nightmare, and allows users to specify simple
structures in a simple way.  This is hard ...

  So I think you are unlikely to get a simple "out-of-the-box" answer to
your problem. I would take a look at R-INLA (not on CRAN, but google for
it) and AS-REML (commercial from genstat, but you may be able to get a
short-term evaluation license) if you really need to do this. You could
also build your own solution in AD Model Builder or WinBUGS.

  Or maybe someone will point out an easy solution I haven't thought of ...

> 
> -------- Original-Nachricht --------
>> Datum: Wed, 30 Mar 2011 14:08:54 -0400 Von: Ben Bolker
>> <bbolker at gmail.com> An: Christoph Scherber
>> <Christoph.Scherber at agr.uni-goettingen.de> CC:
>> r-sig-mixed-models at r-project.org, yvo.fabian at gmx.de Betreff: lme
>> AR1 structure, plus  cross-posting etiquette (was Re: [R-sig-ME]
>> lme:correlations tructure AR1 and random factor)
> 
>> On 11-03-30 11:52 AM, Christoph Scherber wrote:
>>> Dear Yvonne,
>>> 
>>> You need to take care that you have exactly the same nesting
>>> terms in the "correlation" and "random" component.
>>> 
>>> You *could* possibly try:;
>>> 
>>> random=~session|field correlation =corCAR1(form = ~ session)
>>> 
>>> All the best Christoph
>>> 
>>> 
>>> 
>>> 
>>> Yvonne Fabian wrote:
>>> 
>>>> Dear mixed models specialists,
>>>> 
>>>> I tried these model to run in the package nlme, but allways got
>>>> the same error message...
>>>> 
>>>> I have a timeseries correlation in 5 sessions within 12 fields
>>>> with 12 traps per field.
>>>> 
>>>> res2a <- lme(response~x+y+z+treatment,correlation =
>>>> corCAR1(form = ~ session|trapfield), random=~1|field,
>>>> na.action=na.omit, data=plates, method="ML")
>>>> 
>>>> Error: Incompatible formulas for groups in "random" and 
>>>> "correlation" I do not want to use trapfield as a random factor
>>>> and using only session|field in the correlation term leaves me
>>>> with a errormessage that there have to be unique values. Do you
>>>> have any suggestions what to do?
>>>> 
>>>> thanks a lot! Yvonne
>>> 
>>> 
>> 
>> Didn't I answer this yesterday?
>> 
>> <http://thread.gmane.org/gmane.comp.lang.r.general/224577/focus=224586>
>>
>>
>> 
Grumpy meta-comment: this has happened a few times.  Someone
>> posts to an R list (or StackOverflow), I (or others) answer it, and
>> then they ask the question a day or two later on a different list.
>> I can appreciate (temporally separated) cross-posting if no-one
>> answers on the first list, but why ask again if the question has
>> already been answered?
>> 
>> Is it:
>> 
>> (1) the original poster [OP] isn't subscribed to the list, and the 
>> answer has only been posted to the list and not e-mailed back to
>> the OP [it's considered good etiquette to subscribe to the list at
>> least long enough to see answers that are posted and not e-mailed
>> rather than saying "I'm not subscribed, please e-mail me directly"
>> -- if others can bother to take the time to answer the question,
>> you should be able to take the time to subscribe to the list at
>> least temporarily]
>> 
>> (2) the OP didn't understand the answer. In that case the right
>> thing to do is to respond to the post on the original list,
>> explaining as best you can what you didn't understand, so that (a)
>> other list respondents can help out if the original answerer is too
>> busy (b) other list followers (present and future) can see the
>> whole conversation, and maybe get a better understanding of the
>> answers themselves.
>> 
>> (3) the OP understood the answer, but didn't like it and so hoped
>> for a different answer.  It is possible that exposing the question
>> to a new set of people will get a different/better answer, but it
>> is at least polite and saves time to post a new message saying "I
>> asked this question a few days ago on list xxx and got answer yyy
>> from person zzz. That answer doesn't work for me [for the following
>> reasons ...], and I was hoping that someone on this new list would
>> be able to point me to a different solution to my question" (rather
>> than just asking the same question again in the same form, as
>> though it is a brand-new question). That way, (a) the original
>> answerer is credited, and (b) everyone's time won't be wasted
>> giving the same answer as before.
>> 
>> I don't mean to give offense, but as someone who has been on the R 
>> lists for a long time and takes a lot of effort to answer
>> questions, I feel entitled to pontificate a little bit about list
>> etiquette. (Or else it's just the lunchtime caffeine speaking ...)
>> 
>> Ben Bolker
> 

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk2TfC8ACgkQc5UpGjwzenOmQQCfZadOGbHXYV9v7GqQEOvz6VDk
8hgAni5h2H5v5pgCmgf10X9htnq73SYS
=3JhY
-----END PGP SIGNATURE-----




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