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?
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.
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.
I had gotten rid of X2 from class statement, the results showed as follow:
what you mean is this results(ChiSquare=120.96, P<0.0001) is the linear effect(P-trend) ?
No, those are results from CONTRAST or ESTIMATE statements. I am referring to the test of X2 in the Parameter Estimates table.
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.
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.
I fitted GENMOD model as follow:
proc genmod desc data=tot;
model GDM= X2/ dist = binomial;
run;
the results as follow:
Is this the linear results like trend?
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.
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.