I'm working with a large longitudinal dataset of firm-year observations. For some time now I have been using lme4
to implement crossed (non-nested) effects for year and firm-ID groups.
My goal is now to correct for the serial correlation in the firm-group dimension. Based on chl's and fabians' answers to this question (as well as Ben Bolker's comment on the latter), I've assumed this is impossible with lmer()
, but is feasible with nlme::lme()
.
I have been able to implement crossed effects in nlme
based on the discussion in Pinheiro & Bates (2000, sec. 4.2.2, pp. 163-6). In principle then, I believe I can use the correlation = AR1()
speficiation in lme()
to control for autocorrelation.
My strong preference, however, would be to implement such a correlation specification in lmer()
because:
lme4
is much, much (much) fasternlme
requires crossed effects to be nested in some higher group -- without such a higher level grouping I'm forced to create an arbitrary dummy forgroupedData
to which all observations belong (e.g., here). This creates issues interpreting the relative levels of variation between the two crossed groups and the residual variance because some of the variation appears to be captured by the higher-level dummy group.
I got excited when I found the feature request #224 on GitHub, but alas it doesn't seem like there's much movement on the flexLambda front (please let me know if I'm wrong!).
lme4 v1.1-10
I've just noticed that the latest (Oct. 2015) version of lme4
contains a vcconv
command that can
Convert between representation of (co-)variance structures (EXPERIMENTAL.)
Based on the source code, it seems that maybe the sdcor2cov
option could allow one to specify a correlation structure such as AR(1).
So my questions are:
- Is this interpretation of the
vcconv
function correct? - If so, does the user supply the correlation (e.g., AR(1)) parameters or are they determined internally in
lmer()
? - How does one implement this function properly?