Hi,
I wanted to use the TEST statements to test the proportional odds assumption for each of the covariates in my model. I found a similar code and example here: https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.4/statug/statug_logistic_examples22.htm
I tired the code on my data but getting multiple errors. Can anyone please explain what am doing wrong.
proc logistic data=cleanedpracticum;
class functional person_type Gender hr season
dayofweek drug bac_cat agegrp drg_alc / param=ref order=data ;
model issgrp=functional person_type Gender hr season dayofweek
drug bac_cat agegrp drg_alc / unequalslopes MAXITER=10000;
functional: test functional_0 =functional_1;
person_type: test person_type_0 =person_type_1;
bac_cat: test bac_cat_0 =bac_cat_1;
Gender: test Gender_0 =Gender_1;
hr: test hr_0 =hr_1;
season: test season_0 =season_1;
dayofweek: test dayofweek_0 =dayofweek_1;
agegrp: test agegrp_0 =agegrp_1;
drug: test drug_0 =drug_1;
drg_alc: test drg_alc_0 =drg_alc_1;
agegrp: test agegrp_0 =agegrp_1;
run;
You can get all of those tests without entering multiple TEST statements. Just include both the EQUALSLOPES and the UNEQUALSLOPES options as illustrated in this note about the partial proportional odds model. See the "Fitting the fully nonproportional odds model" section. The tests of the U_ effects are the same as what the multiple TEST statements give you. For the documentation example you refer to, these statements give all of the tests.
proc logistic data=docvisit;
model dvisits= sex age agesq income levyplus freepoor
freerepa illness actdays hscore chcond1 chcond2
/ equalslopes unequalslopes;
run;
If your variable is named Functional and the values of the class variable are 1, 2 and 3 then the Test statement wants to see Fuctional1 Functional2 and Functional3 not Functional_1 Functional_2 Functional_3.
From the documentation:
For CLASS variables, the parameter names are obtained by concatenating the corresponding CLASS variable name with the CLASS category;
The _ would only apply if the VALUE of the class (or formatted valued) includes the _.
You can get all of those tests without entering multiple TEST statements. Just include both the EQUALSLOPES and the UNEQUALSLOPES options as illustrated in this note about the partial proportional odds model. See the "Fitting the fully nonproportional odds model" section. The tests of the U_ effects are the same as what the multiple TEST statements give you. For the documentation example you refer to, these statements give all of the tests.
proc logistic data=docvisit;
model dvisits= sex age agesq income levyplus freepoor
freerepa illness actdays hscore chcond1 chcond2
/ equalslopes unequalslopes;
run;
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!
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.