Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Options

- RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Posted 04-17-2017 01:21 AM
(712 views)

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.

4 REPLIES 4

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Hi Rick,

Apologies for posting this in the IML board. I thought it appropriate because I was having problems with the way I was inducing the matrices in PROC NLMIXED.

I had posted this in the statistical procedures board earlier and I wanted to see if the problem was with the programming statements. Do you think you could comb through the code I posted and see if there's a problem with the programming? On the stat procedures board, they said the problem was that the model was too complex for the data but I do not think that is the problem.

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

I have nothing to contribute. I am not an expert on complex mixed models.

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Okay, thank you for your time anyway.

Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

**If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. **

Multiple Linear Regression in SAS

Learn how to run multiple linear regression models with and without interactions, presented by SAS user Alex Chaplin.

Find more tutorials on the SAS Users YouTube channel.