BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
kc
Quartz | Level 8 kc
Quartz | Level 8

Hello,

 

Which statistical test should be used to estimate a p-value for trend for a dependent variable (multinomial) with more than 2 levels and an ordered independent variable (categorical) with more than 2 levels.

 

Most of the help out there seems to suggest that the Cochran-Mantel-Haenszel test should be used. But, looks like in the case of no adjustment for (categorical) confounders, the CMH test is not the correct one and multinomial logistic regression should be used. If so, how do I get a p-value for trend with 1 dependent and 1 independent variable as mentioned above. Any example code/reference is greatly appreciated.

 

Thanks.

1 ACCEPTED SOLUTION

Accepted Solutions
kc
Quartz | Level 8 kc
Quartz | Level 8

It appears that the score test from multinomial logistic regression can be used to test for trend between a multinomial variable and ordered categorical variable (when there is no adjustment for other categorical confounders). Also, if interested, take a look at the note from Frank Harrell here: chi square test vs logistic regression result - Cross Validated (stackexchange.com)

View solution in original post

12 REPLIES 12
StatDave
SAS Super FREQ

It sounds like you probably want to use the Jonckeere-Terspstra test in PROC FREQ. Use the JT option in the TABLES statement for your two-way table.

kc
Quartz | Level 8 kc
Quartz | Level 8

Isn't Jonckheere-Terpstra trend test used for continuous variables?

StatDave
SAS Super FREQ

See the Details section on the JT test in the PROC FREQ documentation. As stated there, "The Jonckheere-Terpstra test is appropriate for a two-way table in which an ordinal column variable represents the response. The row variable, which can be nominal or ordinal".

kc
Quartz | Level 8 kc
Quartz | Level 8

So, when the dependent variable is race (with 3 values: white; black; other) and the independent variable is BMI (3 categories: <30, 30-40, >=40), the following code should suffice? Meaning, the two-sided p-value from the Jonckheere-Terpstra Test in the SAS output should be used the p-value for trend?

 

proc freq data=ds;
tables RACE*BMIGRP/jt;
run;
Ksharp
Super User

Check its documentation example:

 

Ksharp_0-1723529127084.png

 

kc
Quartz | Level 8 kc
Quartz | Level 8

I believe the Cohcran-Armitage trend test is used for binary variables.

Ksharp
Super User
Or you could try ANOVA by PROC GLM / PROC NPAR1WAY + wilcoxon option.
If there are significant difference between all two groups , there are a trend ?
StatDave
SAS Super FREQ

As stated in the J-T test documentation, you will want to order the rows of your table (levels of RACE) to correspond with the way you  hypothesize the ordinal response (BMIGRP) to increase. For example, if you hypothesize that BMIGRP increases from white to black to other then you want the rows to be in that order. If it is a character variable, you might find it easiest to either recode it or create a new variable with  values 1, 2, 3 in the desired order. Of course, you should make sure that the response levels (BMIGRP) are arranged in increasing order across the columns (<30, 30-40, >40). Assuming that the data agree with that hypothesis, then the one-sided p-value tests the significance of that positive trend.

kc
Quartz | Level 8 kc
Quartz | Level 8

@StatDave : Thank you for taking time to respond to my question. I will try the suggestion and report back.

Ksharp
Super User

Since your data can be formed by contingency table,

you can do ANOVA with RPOC CATMOD.

data have;
 set sashelp.heart;
 r=mod(_n_,10)+1;
 keep bp_Status r;
run;

proc freq data=have;
table bp_Status*r/nocol norow nopercent;
run;

proc catmod data=have;
 response mean;
 model r= bp_Status;
quit;
kc
Quartz | Level 8 kc
Quartz | Level 8

It appears that the score test from multinomial logistic regression can be used to test for trend between a multinomial variable and ordered categorical variable (when there is no adjustment for other categorical confounders). Also, if interested, take a look at the note from Frank Harrell here: chi square test vs logistic regression result - Cross Validated (stackexchange.com)

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!

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
  • 12 replies
  • 1840 views
  • 5 likes
  • 3 in conversation