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
- /
- Analytics
- /
- Stat Procs
- /
- glimmix

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

12-22-2011 07:48 PM

** I'm new to SAS and I’m having difficulties asking for a random slope. If anybody has any insight, it would begreatly appreciated. (the first proc works, the second one does not)**

** **

** **

**data**subtype;

input y center study age race gender height weightcat;

datalines;

0 1 1 44 3 1 161 4

1 1 1 61 3 1 137 1

1 1 1 63 2 0 194 4

0 1 1 71 3 1 153 4

0 2 1 66 3 1 198 3

1 2 1 36 2 1 166 4

1 2 1 32 2 0 121 3

1 2 1 45 2 1 128 2

1 3 1 32 2 1 104 1

1 3 1 54 1 0 135 3

0 3 1 47 2 1 106 1

1 3 1 34 3 0 104 2

0 4 2 40 2 0 114 3

0 4 2 60 3 0 183 2

0 4 2 79 2 1 177 2

0 4 2 62 2 0 197 1

1 5 2 58 1 0 189 2

1 5 2 48 1 1 157 4

0 5 2 43 2 1 162 3

0 5 2 68 3 0 135 2

0 6 2 69 2 1 115 3

1 6 2 42 3 0 165 3

0 6 2 30 1 0 150 3

0 6 2 50 1 1 157 2

0 7 3 42 3 0 176 1

0 7 3 31 3 0 183 3

0 7 3 75 1 1 147 2

0 7 3 53 1 0 160 3

1 8 3 45 1 0 100 2

1 8 3 74 2 0 127 4

1 8 3 63 3 1 143 4

1 8 3 64 1 1 131 2

1 9 3 56 1 0 107 2

1 9 3 78 2 1 195 2

0 9 3 35 3 0 182 2

1 9 3 47 1 0 123 3

;

**proc glimmix**;

classcenter;

modely = height / dist=bin link=logitsolution;

randomintercept / type =un subject= center;

random_residual_;

**run**;

**proc glimmix**;

classcenter;

modely = height / dist=bin link=logitsolution;

randomintercept height / type =un subject= center;

random_residual_;

**run**;

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

12-23-2011 10:11 AM

Use:

model y = height / dist=bin link=logit s;

random int height / sub=center type=un;

random _residual_;

This will give you a random coefficient model (with random effects for intercept and slope).

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

12-26-2011 10:58 PM

I'm using the similar statements on SAS on Unix platform. I've 500,000 different customer ids on which I'm trying to run this program & each is has 5 different observations. But I get the error message that memory is not sufficient. Any suggestions on how to run this successfully will be deeply appreciated.

**proc glimmix data=xxx**;

model y = x1 x2 x3 / dist=bin link=logit solution;

random intercept / subject=id;

**run**;

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

12-27-2011 12:01 PM

You will probably not get GLIMMIX to run with that many observations. I suggest you take a random sample of the customers (keeping all the observations for the selected customers), and do the analysis on this sample.

Note: you did not define ID as a factor using a class statement. That is OK, as long as the data are sorted by ID before running GLIMMIX. If not sorted, you could get incorrect results (when you have a small enough sample to get any results).

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

01-04-2012 02:33 PM

You could try the HPMIXED procedure...

http://support.sas.com/documentation/cdl/en/statug/63033/HTML/default/viewer.htm#hpmixed_toc.htm

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

01-04-2012 02:49 PM

HPMIXED is only for normal data.

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

04-12-2012 11:19 AM

Thanks for the input. Yes I looked into HPMixed and that just handles issues from proc mixed and not from proc glimmix. I wish I could run this procedure for entire population.

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

04-12-2012 01:32 PM

One way around this would be to use the macro %hpglimmix written by a sas user (not a sas employee). Just do a google search for %hpglimmix. However, last time I looked, this macro is not yet available for the public. You can always write and ask.

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

04-13-2012 07:52 AM

I don't know if this is possible, because I don't know if there is any way to collapse the data, so that the dependent variable is a proportion rather than a 0/1 for each individual. If you could collapse and calculate the proportion, then the problem may become tractable, either in GLIMMIX with perhaps a beta or a binomial distribution, or in MIXED after transformation (say, arcsine square root transform). The random slopes, however, would describe the population that you collapse to.

If you are able to use the %hpglimmix macro, please let the group know how it turns out, and any tweaks you might have had to use to get it to work.

Steve Denham

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

04-15-2012 07:43 PM

I tried finding %hpglimmix but all the posts on Google point to the same blog. It sounds like a great solution but seems that I'll have to wait.

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

04-15-2012 08:38 PM

Yes, the macro will not be available for several more months, or later. I suggest you look at a random subset of your data set with the procedure.

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

08-31-2012 04:29 PM

I just saw this question and thought the following might help.

If you would like to fit the model without an R side matrix (without the random _residual_ statement in your code) which will lead to a random coefficient model with a G side matrix, I think the non-convergence problem might be resolved using NLOPTIONS. With the given data example above, the following code leads to convergence with four iterations. However, the problem of nonconvergence with very large datasets still remains to be a problem. You have to of course check if that is what you want.

proc **glimmix** data=subtype;

class center;

model y = height / dist=bin link=logit solution;

random intercept height / type =un subject= center;

nloptions tech=NRRIDG;

run;

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

04-16-2012 11:35 AM

Let me ask you guys another question as you all are very familiar with this procedure (I don't find many experts on glimmix!).

Glimmix allows for joint modeling of binary and poisson distributed variables (as cited by an example in the documentation). Does it also allow modelling two binary DVs jointly?

Also what if I want to model two DVs jointly in genmod, can I do that?

Thanks a lot.

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

04-20-2012 07:36 AM

I know GLIMMIX can do the joint modeling of variables--follow along the example in the documentation for the binary/poisson, and replace poisson throughout. Probably have to fix up the dataset so that the variable 'dist' is on each record.

I don't think you can do it in GENMOD, but GLIMMIX should give the same results, assuming that you have no random effects. If you are doing repeated measures in GENMOD (GEE stuff), you can get approximately similar answers in GLIMMIX with an appropriate RANDOM statement with the residual option.

Steve Denham