The rows below each subject are repeated measures (in years), with the
specific pattern of repeated measurements unique to each subject. The data
contains fixed effects and random effects, and there is clearly correlation
in the random effects within each subject. The DepVar column represents the
dependent variable which is a constant for each subject. All the data is
empirical, but I wish to create a predictive model. Specifically, I wish to
predict the value for DepVar for new subjects.
So I understand enough about statistics to know that I must employ a mixed
model. I further understand that I must specify a covariance matrix
structure. Given the relatively high degree of correlation in consecutive
years, an AR(1) structure seems like a good starting point. I have been
trying to build the model in SPSS, but without success, so I've recently
turned to R. My first attempt was as follows--
ModelFit <- lme(fixed = DepVar ~FixedVar1+FixedVar2, random =
~RandomVar1+RandomVar2 | Subject, na.action = na.omit, data = dataset, corr
= corAR1())
I assume this can't be the right specification since it neglects the
repeated measure aspect of the data, so I instead decided to employ the
corCAR1 structure, i.e.--
ModelFit <- lme(fixed = DepVar ~FixedVar1+FixedVar2, random =
~RandomVar1+RandomVar2 | Subject, na.action = na.omit, data = dataset, corr
= corCAR1(0.5, form = ~ Years | Subject))
Now perhaps neither correlation structure is the right one (probably a
different discussion for another day), but the problem I'm experiencing
seems to occur regardless of the structure I specify. In both cases, I get
the following error--
Error in solve.default(estimates[dimE[1] - (p:1), dimE[2] - (p:1), drop =
FALSE]) :
system is computationally singular: reciprocal condition number =
5.42597e-022
Anybody know what is going wrong here? This error appears to be related to
the fact that the DepVar is constant for each subject, because when I select
a different dependent variable that is different for each repeated measure
w/in the subject, I do not get this error.