Turn on suggestions

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

Showing results for

- Home
- /
- Analytics
- /
- Stat Procs
- /
- Re: In proc logistic, how to display the results of the score test for...

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** and **locked**.
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 10-31-2016 04:13 AM
(1920 views)

When using proc logistic for a multivariable binary logistic regression, the results of the Wald Chi-Square and corresponding P-value are displayed for each variable entered in the model ("Analysis of Maximum Likelihood Estimates" section).

Is it possible to display the Score Chi-Square and corresponding P-value for EACH variable instead ? If so, how ?

Thank you for your help.

1 ACCEPTED SOLUTION

Accepted Solutions

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

I think it is right that proc logistic does not produce the score test for each variable. It is possible to calculate the scoretest for each variable with PHREG, and since logistic regression and Cox-regression is closely connected, we can transform the data and get the wanted scoretest out of PHREG. Just create one single riskset with the number of successes=number of events and censor the rest. Then order the scoretest in the modelstatement.

here and example:

```
data mydata;
n=10;
do a=1 to 5;
do b=1 to 5;
do c=1 to 5;
y=rand('binomial',1/(1+exp(5-a-b)),n);
output;
end;
end;
end;
run;
data mydata2;
set mydata;
t=1;w=y;output;
t=2;w=n-y;output; (its not important which values you use on t. just one value for the riskset, and the other should be bigger.;
run;
proc phreg data=mydata2;
class a b c/param=glm;
model t*t(2)=a b c/type3(all) ties=discrete;
freq w;
run;
```

6 REPLIES 6

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

I never heard EACH variable in logistic regression. What it stand for ?

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

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

Maybe you can't , I think Likelihood Ratio and Score is only for Global H0 .

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

Thank you for your response. This may be true. However, I doubt it because when you operate a forward (or stepwise) variable selection using proc logistic, the result of the score test for each candidate variable is provided.

However, in this case, the results of each score test seems to correspond to a comparison of the current model vs. the current model + one variable.

To make it clearer, let's take an example:

When i run the following SAS code :

" proc logistic desc; model end4_unexplained = age antiplatelet nihss0h

/ selection=forward slstay=0.10 details; run; "

At step 1, the variable "nihss0h" is entered in the model.

A the end of step 1, a list of variables eligible for entry is provided, with a Score Chi-Square and corresponding P-value for each candidate variable (please see the image associated to this message). I believe that the P-value for the variable "age" corresponds to a comparison, using the Score Test, of the model with the variables "age" and "nihss0h", versus the model containing only "nihss0h".

Is this correct ?

If so, back to the main question of this topic (displaying the results of a Score test for each variable using proc logistic): do you think that such a test can not apply to this situation, or that it is simply not provided by proc logistic ?

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

I think it is right that proc logistic does not produce the score test for each variable. It is possible to calculate the scoretest for each variable with PHREG, and since logistic regression and Cox-regression is closely connected, we can transform the data and get the wanted scoretest out of PHREG. Just create one single riskset with the number of successes=number of events and censor the rest. Then order the scoretest in the modelstatement.

here and example:

```
data mydata;
n=10;
do a=1 to 5;
do b=1 to 5;
do c=1 to 5;
y=rand('binomial',1/(1+exp(5-a-b)),n);
output;
end;
end;
end;
run;
data mydata2;
set mydata;
t=1;w=y;output;
t=2;w=n-y;output; (its not important which values you use on t. just one value for the riskset, and the other should be bigger.;
run;
proc phreg data=mydata2;
class a b c/param=glm;
model t*t(2)=a b c/type3(all) ties=discrete;
freq w;
run;
```

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

Thank you so much for this elegant solution !

Are you ready for the spotlight? We're accepting content ideas for **SAS Innovate 2025** to be held May 6-9 in Orlando, FL. The call is **open **until September 25. Read more here about **why** you should contribute and **what is in it** for you!

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.