turn on suggestions

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

Showing results for

Find a Community

- Home
- /
- SAS Programming
- /
- SAS Procedures
- /
- Proc glimmix & where statement

Topic Options

- 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

06-12-2014 04:34 AM

I have a data set with 7 potential covariates. At the moment I am testing each one individually against the outcome variable. I am using AIC/BIC to see which covariate fits the model best and building from there. The problem that I am having is that most variables have some missing responses. I have created a new variable called notmissing which codes a row as notmissing=0 if all covariates have a value for that row or notmissing=1 for the rows where one or more covariates has a missing value. What I want to do is run the proc glimmix and include a statement that only includes rows where notmissing=0 so that I can use the AIC/BIC.

This is the code I have written:

proc glimmix data=cmr.u5mrfull method=mspl ;

where=(notmissing=0);

class country regionID;

model u5mr = regionID year ltuberprev/ dist=normal link=id dfm=sat;

random intercept year / subject=country type=chol;

run;

I have run it for each variable but the number of observation used is different in each analysis so this makes me think the code hasn't worked properly or there is something wrong with the notmissing variable but I am not sure which one is causing the problem

Accepted Solutions

Solution

06-12-2014
10:48 AM

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

06-12-2014 10:48 AM

I have run it for each variable but the number of observation used is different in each analysis so this makes me think the code hasn't worked properly or there is something wrong with the notmissing variable but I am not sure which one is causing the problem

You probably need to show us how your are creating the notmissing variable.

Also, I am not familiar with the syntax for the WHERE statement

where=(notmissing=0);

I always use something like

where notmissing=0;

or

proc glimmix data=cmr.u5mrfull(where=(notmissing=0)) method=mspl ;

All Replies

Solution

06-12-2014
10:48 AM

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

06-12-2014 10:48 AM

I have run it for each variable but the number of observation used is different in each analysis so this makes me think the code hasn't worked properly or there is something wrong with the notmissing variable but I am not sure which one is causing the problem

You probably need to show us how your are creating the notmissing variable.

Also, I am not familiar with the syntax for the WHERE statement

where=(notmissing=0);

I always use something like

where notmissing=0;

or

proc glimmix data=cmr.u5mrfull(where=(notmissing=0)) method=mspl ;

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

06-12-2014 03:07 PM

Whenever I have used a where statement with SAS procedures, it has always been with syntax like

where notmissing=0;

Try that with Glimmix and let know if it works.

Brandy

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

06-12-2014 05:57 PM

Thanks guys! There was a problem with the syntax of the where statement. As suggested I fixed it up to be:

where notmissing=0;