Hi.
I am running a logistic regression with a binary dependent variable and 5 class independent variables.
The used code is:
proc logistic data=train;
class var1 var2 var3 var4 var5 / param=GLM;
model pred12 (event='2')= var1 var2 var3 var4 var5 / RSQ;
run;
And the partial output is:
Effect | DF | Wald | Pr > ChiSq |
Chi-Square | |||
Var1 | 1 | 150,7266 | <.0001 |
Var2 | 3 | 119,5550 | <.0001 |
Var3 | 8 | 157,9586 | <.0001 |
Var4 | 6 | 1553,0700 | <.0001 |
Var5 | 4 | 15975,6288 | <.0001 |
Analysis of Maximum Likelihood Estimates | ||||||
Parameter | DF | Estimate | Standard | Wald | Pr > ChiSq | |
Error | Chi-Square | |||||
Intercept | 1 | 5,0054 | 0,2974 | 283,3322 | <,0001 | |
.-------- | .---- | .------ | .-------- | .-------- | .-------- | .-------- |
.-------- | .---- | .------ | .-------- | .-------- | .-------- | .-------- |
Var4 | 1 | 1 | -1,9443 | 0,2969 | 42,8854 | <,0001 |
Var4 | 2 | 1 | -1,6971 | 0,296 | 32,8692 | <,0001 |
Var4 | 3 | 1 | -0,9009 | 0,2951 | 9,3197 | 0,0023 |
Var4 | 4 | 1 | -1,0116 | 0,2957 | 11,7065 | 0,0006 |
Var4 | 5 | 1 | -0,4524 | 0,2963 | 2,3319 | 0,1267 |
Var4 | 6 | 1 | 0,0255 | 0,3039 | 0,0071 | 0,933 |
Var4 | 999 | 0 | 0 | . | . | . |
Var5 | 1 | 1 | -1,2442 | 0,0445 | 782,4054 | <,0001 |
Var5 | 2 | 1 | -1,5483 | 0,0364 | 1811,5691 | <,0001 |
Var5 | 3 | 1 | -2,108 | 0,0304 | 4793,1049 | <,0001 |
Var5 | 4 | 1 | -3,1394 | 0,0259 | 14693,0821 | <,0001 |
Var5 | 999 | 0 | 0 | . | . | . |
My question is concerning the wald chi-square. How can I interpret the fact that for var5 the value of the wald chi-square is so much higher than the values of the remaining variables? And what is the consequence to the regression quality.
Thanks in advance for the help.
Think of how a Wald chi-square is calculated = (estimate/stderr)**2. In a way, it is an effect size squared. Look at the estimates--large for variable 5 compared to the reference category, with realtively small standard errors. It looks like they have a large effect. You could add the type3 option to your model statement to get overall tests of marginal differences in the levels of each of the variables. On the other hand, do not give undue weight to the chi-squared values for each level of a variable. As far as regression "quality", check the INFLUENCE and LACKFIT options for the model statement.
Steve Denham
Think of how a Wald chi-square is calculated = (estimate/stderr)**2. In a way, it is an effect size squared. Look at the estimates--large for variable 5 compared to the reference category, with realtively small standard errors. It looks like they have a large effect. You could add the type3 option to your model statement to get overall tests of marginal differences in the levels of each of the variables. On the other hand, do not give undue weight to the chi-squared values for each level of a variable. As far as regression "quality", check the INFLUENCE and LACKFIT options for the model statement.
Steve Denham
Thank you for your very helpful answer.
Since your answer I studied more this issues, and tried some of the options you suggested.
One of my main issues is to explain to the users the impact of a variable (and in this study is crucial due the large effect of variable 5). I already saw this impact expressed as a rate in a doc (for example if I am predicting vardep {0,1} with two independent variables, then var1 is said to represent 20% and var2 represent 80% of the probability to achieve vardep=1) but it didn't show how were the rates calculated. Do you have any idea on this?
About the options suggested, I couldn't find the type3 option in the model statement in the sas support documentation
http://support.sas.com/documentation/cdl/en/statug/65328/HTML/default/viewer.htm#statug_logistic_syn... , can you help me on that.
With the lackfit option I had no problem but with the influence option, I couldn't run it because my database is very large, is there any way to save this information to a sas dataset and not to the SAS Output?
Thanks again.
C.
I apologize. The type3 option is available in GENMOD, which is where I do most of my fixed effect logistic modeling. I am sorry that I pointed you at the wrong option. Instead, if you are on SAS/STAT12.1, you should look at the EFFECT statement.
effect variable2=multimember (var2):
However, I can't seem to pin down the documentation--in the LOGISTIC Procedure documentation it does say "is a multimember classification effect whose levels are determined by one or more variables that appear in a CLASS statement," so I believe it should give an overall test. You may need more than one EFFECT statement, or perhaps you can add the others into a single statement.
I think the only way to get influence option to a dataset would be to use ODS. You would probably have to close the output listing destination, and output everything of interest, or maybe use ODS select to display only the tables of interest. This assumes that the cause of not running is overflow of the output destination. If it is a memory problem, I really don't know what to offer--perhaps others can help.
Steve Denham
Don't apologize you where a big help.
Concerning the influence option, you are right with the statement ' ods output influence=<table name>; ' the SAS produces a table. The problem is that it keeps writing in the SAS output the table (in this case 200.000 observations), and if I use the option noprint in the Proc logistic statement the ods statement is ignored.
Thanks.
C.
NOPRINT turns off ODS output as well as the listing.
I suggest, if you want to suppress all output:
ods listing close;
<insert PROC LOGISTIC code here, including the ODS output statement>
ods listing;
If you only want to suppress the influence ouput, you could try:
ods exclude influence;
ods output influence=<table name goes here>;
I hope these work for you.
Steve Denham
Thanks Steve.
The code below totally solves my problem.
ods exclude influence;
proc logistic data=train;
class var1 var2 var3 var4 var5 / param=GLM;
model pred12 (event='2')= var1 var2 var3 var4 var5 / RSQ influence lackfit;
ods output influence=estatinfluence;
run;
To suppress all output I think the statements are:
ods html close;
....
ods html;
Thanks for all your help.
C.
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 16. Read more here about why you should contribute and what is in it for you!
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.
Select SAS Training centers are offering in-person courses. View upcoming courses for: