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

Showing results for

Find a Community

- Home
- /
- Analytics
- /
- Stat Procs
- /
- Glimmix model: confirmation and error debugging

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

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

07-14-2017 07:03 PM

I am trying to run a mixed model on a very small number of subjects with pre-post data. the data was collected over time simply due to the nature of the intervention, the collected timpoints pre and post and between patients are totally random and not equally spaced. I want to simples conclude that the post was better than the pre (which means the post values are greater, overall, than the pre). After some research, I came up with this model:

proc glimmix data=long;

class Trial id;

model y = Trial | time / solution;

random intercept / subject=id;

random intercept time/ subject=Trial*id type=sp(pow);

run;

quit;

Can anyone confirm that this indeed the best way to model this research question?

If so, I am getting the error message:

ERROR 79-322: Expecting a (.

ERROR 76-322: Syntax error, statement will be ignored.

at the end of the second random statement. Cant see to figure out why. Any help would be appreciated.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

07-14-2017 07:25 PM

A list is expected. Here is the doc (without the formulas).

SP(POW)(c-list)

models a power covariance structure

where . This is a reparameterization of the exponential structure, TYPE=SP(EXP). Specifically, . See TYPE=SP(EXP) for the computation of the distance from the variables specified in c-list. When the estimated value of becomes negative, the computed covariance is multiplied by to account for the negativity.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

07-14-2017 07:54 PM

Actually, I am a little new to the glimmix procedure, so forgive me.

When I run the model with the above code, trial is insignificant

When I remove the interaction and just run the model on trial, trial becomes significant.

Based on my reseach question - is it ok to remove the interaction ?

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

07-14-2017 07:26 PM

The syntax is TYPE=SP(POW)(time)

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

07-14-2017 07:52 PM - edited 07-14-2017 07:58 PM

Thank you, I think I should be interpreting the time by trial interaction here, but the research question actually has nothing to do with difference by time- would it be more appropriate to report just the estimates for trial?

When I run the model with the above code, trial is insignificant

When I remove the interaction and just run the model on trial, trial becomes significant.

Based on my reseach question - is it ok to remove the interaction ?

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

07-14-2017 07:56 PM

Sorry. I'll have to defer to others on the best way to set up your model. I just responded because I knew the nature of your syntax error question.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

07-15-2017 04:46 PM

What is the TRIAL factor, and what role does it play in your study?

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

07-16-2017 06:39 PM

Data is longitudinal; trial = pre or post variable.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

07-17-2017 12:20 AM

Hmm. If TRIAL is the factor for pre/post (in other words, if TRIAL has two levels, one for pre and one for post), then what is TIME?

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

07-17-2017 12:47 PM

Yes, a big confusing! At each trial (pre and post) the subject performed a task repeatedly over an interval of time, measurements were recorded at random intervals of time (5 secs, 10 secs, 18 sec, etc.)

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

07-17-2017 01:12 PM

Why did you use random time intervals? How many time intervals do you have for each trial for each subject? Do you have the same number of time observations for each trial for each subject? Does the response Y have a linear relationship with TIME?

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

07-17-2017 01:21 PM

The time intervals for each trial/subject can vary - some have 5, some have 3, and the timepoints where measurements were taken were random (e.g. subject 1 had measurements at 5, 16, 21, and 27 secs while subject 2 had measurements at 3, 10, and 19 secs).

Y has a close to linear relationship with time.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

07-17-2017 02:40 PM

Then I think something like this code might be appropriate, where CTIME = TIME

```
proc glimmix data=long;
class trial id ctime;
model y = trial | time / solution ddfm=kr2;
random intercept / subject=id;
random intercept time / subject=trial*id type=vc;
random ctime / subject=trial*id type=sp(pow)(time) residual;
output out=long_out pred=pred pred(noblup)=predpa;
run;
/* Observed and predicted (BLUP) for each trial for each id */
proc sgpanel data=long_out;
panelby id;
scatter x=time y=y / group=trial;
series x=time y=pred / group=trial;
run;
/* Observed and predicted (BLUE) for each trial */
proc sgpanel data=long_out;
panelby trial;
series x=time y=y / group=id lineattrs=(pattern=2 color=red);
series x=time y=predpa / lineattrs=(pattern=1 color=black);
run;
```

Consider the statement

`random intercept time / subject=trial*id type=vc;`

You are defining a 2 x 2 covariance matrix here. With TYPE=VC, it estimates (1) the variance among intercepts, and (2) the variance among slopes. With TYPE=UN, it estimates (1) the variance among intercepts, (2) the variance among slopes and (3) the covariance among intercepts and slopes. Because it is just a 2 x 2 matrix, TYPE=SP(POW)(c-list) makes no sense here. Be sure that you have an adequate understanding of random coefficient models. https://www.sas.com/store/books/categories/usage-and-reference/sas-for-mixed-models-second-edition/p... by Littell et al. has a good chapter on the topic.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

a month ago

So is time a SAS keyword here?

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

a month ago

Here it is the factor you identified as TIME in your original post. I don't know the "blue or not blue" rule for the code inset.