BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
critiasun
Calcite | Level 5

Good evening! Everyone! I am working on  Generalized Linear Model,Variable X2 has 4 value(1,2,3,4), now I can see a trend from Variable X2 , but I can not find the default parameter  to get the P-trend, How to do it?

1 ACCEPTED SOLUTION

Accepted Solutions
StatDave
SAS Super FREQ

Yes. The large Wald chi-square for X2, 355.62, is significant (p<0.0001) indicating a non-zero trend on the log odd of the event level which is the first level of GSM as shown in the Response Profile table. 

View solution in original post

10 REPLIES 10
StatDave
SAS Super FREQ

If you want to test for trend over the levels of X2, that implies that its levels are ordered. If the values 1,2,3,4 reflect the spacing between its levels, then specify X2 in the MODEL statement but not in the CLASS statement. The single p-value that you get for X2 will be a test of its linear effect on the response function.

critiasun
Calcite | Level 5

I had gotten rid of X2 from class statement, the results showed as follow:

trend test.png

what you mean is this results(ChiSquare=120.96, P<0.0001) is the  linear effect(P-trend) ?

StatDave
SAS Super FREQ

No, those are results from CONTRAST or ESTIMATE statements. I am referring to the test of X2 in the Parameter Estimates table.

critiasun
Calcite | Level 5
Could you show me how to write the statement, can you give me an example?
StatDave
SAS Super FREQ
proc logistic;
model y(event="1") = x2;
run;

The test of X2 is a test of its linear effect on the logit (log odds). You could have additional variables in the model and that is still true.

critiasun
Calcite | Level 5
If I use the 'proc genmod' procedure, can it be like this:

proc genmod;
model y("event=1")=X2;
run;
StatDave
SAS Super FREQ

If you are fitting a logistic model, the best tool is PROC LOGISTIC. PROC GENMOD can also be used, but since GENMOD fits a broader class of models than just logistic models, you need to specify the DIST=BINOMIAL option to tell GENMOD to fit a logistic model:

model y(event="1") = x2 / dist=binomial;

Note that this assumes that the response variable, Y, takes on values 0 or 1 and that Y=1 is considered the event of interest.

critiasun
Calcite | Level 5

I fitted GENMOD model as follow:
proc genmod desc data=tot;
model GDM= X2/ dist = binomial;
run;

the results as follow:

genmod-test.png

Is this the linear results like trend?

StatDave
SAS Super FREQ

Yes. The large Wald chi-square for X2, 355.62, is significant (p<0.0001) indicating a non-zero trend on the log odd of the event level which is the first level of GSM as shown in the Response Profile table. 

critiasun
Calcite | Level 5
Question has been solved with your help! Thank you very much !

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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.

Discussion stats
  • 10 replies
  • 1876 views
  • 0 likes
  • 2 in conversation