Turn on suggestions

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

Showing results for

- Home
- /
- Programming
- /
- Programming
- /
- PROC GLIMMIX model both dichotomous and continuous independent variabl...

Options

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

☑ This topic is **solved**.
Need further help from the community? Please
sign in and ask a **new** question.

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

Posted 06-05-2023 03:38 PM
(303 views)

I am trying to model the data using a two-level model. Student nested in school. My dependent variable "pass" is dichotomously coded (1, 0). My independent variable includes both dichotomously coded variable first and status (1, 0) and continuous variable "practice score" as below

```
PROC GLIMMIX
DATA=pred METHOD=LAPLACE NOCLPRINT;
CLASS SCHOOLNUM;
MODEL PASS (EVENT="1")=first practice_score status/CL DIST=BINARY LINK=LOGIT SOLUTION;
RANDOM INTERCEPT/ SUBJECT=SCHOOLNUM S CL TYPE=VC;
COVTEST /WALD;
run;
```

Based on the fixed effects estimates as in the picture below, the probability of pass for first=1, status=1, is exp(-5.7755+0.7758+0.00872461.1849)/(1+exp(-5.7755+0.7758+0.008724+1.1849))=0.02175, which is too low from expected.

Where was wrong with my SAS code above? Any help would be much appreciated. Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions

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

Your formula is wrong. For each observation that you want a prediction, you want to use the values of the independent variables, which you are not doing. See Wikipedia or any textbook for the formula to predict: https://en.wikipedia.org/wiki/Multinomial_logistic_regression

The easiest way to predict the probability of passing is to use GLIMMIX, use the OUTPUT statement to have SAS compute the predicted probabilities. https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.4/statug/statug_glimmix_syntax19.htm

--

Paige Miller

Paige Miller

3 REPLIES 3

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

Your formula is wrong. For each observation that you want a prediction, you want to use the values of the independent variables, which you are not doing. See Wikipedia or any textbook for the formula to predict: https://en.wikipedia.org/wiki/Multinomial_logistic_regression

The easiest way to predict the probability of passing is to use GLIMMIX, use the OUTPUT statement to have SAS compute the predicted probabilities. https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.4/statug/statug_glimmix_syntax19.htm

--

Paige Miller

Paige Miller

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

@PaigeMiller Thank you so much for your help!

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

Secure your spot at the must-attend AI and analytics event of 2024: SAS Innovate 2024! Get ready for a jam-packed agenda featuring workshops, super demos, breakout sessions, roundtables, inspiring keynotes and incredible networking events.

Register by March 1 to snag the Early Bird rate of just $695! Don't miss out on this exclusive offer.

** **

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.