Hi all, I'm using PROC NLMIXED to generate a multivariate mixed-effects model. The data is rather complex and is in a "stacked" format like this: the SUBID variable identifies the subject and the Response variable consists of the QRTS (quantitative task) and VRTS (verbal task) variables literally stacked on top of each other. The TimeV and TimeQ variables denote the Time for each task. I am not only interested in the fixed/random effects for the quantitative and verbal tasks separately, but I am most interested in the joint covariances between the random effects for the tasks. I am posting this in this board because I think that my problem is in the programming statements in my syntax, and not in the statistics. Here is the code I used to try to fit the model: *multivariate structured latent curve model combining the quant and verbal scores using PROC NLMIXED*;
proc nlmixed data = combined method = gauss noad gconv = 0;
parms aV = 7 bV = 7 rV = -.7 s2V var_aV cov_aVbV var_bV
cov_aVrV cov_bVrV var_rV
aQ = 8 bQ = 8 rQ = -.7 s2Q var_aQ cov_aQbQ var_bQ
cov_aQrQ cov_bQrQ var_rQ
cov_aVaQ cov_aVbQ cov_aVrQ cov_bVaQ cov_bVbQ
cov_bVrQ cov_rVaQ cov_rVbQ cov_rVrQ = .1;
*aQ = a parameter for quant*; *bQ = b parameter for quant*; *rQ = r parameter for quant*;
*aV = v parameter for verbal*; *bV = b parameter for verbal*; *rV = r parameter for verbal*;;
pi = arcos(-1);
n0Q = aQ + z0Q; n1Q = bQ + z1Q; n2Q = z2Q; *fixed plus random for quantitative*;
basis0Q = 1-exp(-rQ*(Time-1)); basis1Q = exp(-rQ*(Time-1)); basis2Q = (aQ-bQ)*(Time-1)*exp(-rQ*(Time-1));
basis3Q = 0; basis4Q = 0; basis5Q = 0;
*basis functions for quantitative*;
n0V = aV + z0V; n1V = bV + z1V; n2V = z2V; *fixed plus random for verbal*;
basis0V = 1-exp(-rV*(Time-1)); basis1V = exp(-rV*(Time-1)); basis2V = (aV-bV)*(Time-1)*exp(-rV*(Time-1));
basis3V = 0; basis4V = 0; basis5V = 0;
*basis functions for verbal*;
if Type = "Q" then do;
predvQ = n0Q*basis0Q + n1Q*basis1Q + n2Q*basis2Q;
llQ = (-1/2)*(log(2*pi) + (((QRTS - predvQ)**2)/s2Q) + log(s2Q)); end;
else if Type = "V" then do; predvV = n0V*basis0V + n1V*basis1V + n2V*basis2V;
llV = (-1/2)*(log(2*pi) + (((VRTS - predvV)**2)/s2V) + log(s2V)); end;
ll = llQ + llV;
model Response ~ general(ll);
random z0Q z1Q z2Q z0V z1V z2V ~ normal([0,0,0,0,0,0],
[var_aQ, cov_aQbQ, var_bQ, cov_aQrQ, cov_bQrQ, var_rQ,
cov_aVaQ, cov_aVbQ, cov_aVrQ, cov_bVaQ, cov_bVbQ, cov_bVrQ,
cov_rVaQ, cov_rVbQ, cov_rVrQ,
var_aV, cov_aVbV, var_bV, cov_aVrV, cov_bVrV, var_rV]) subject = SUBID;
run; Any and all help is appreciated. Thanks.
... View more