When I run the following below using a class variable, I get the same odds ratios for my race/ethnic groups compared to the reference group as I get when I run the model using indicator variables. However, despite getting the same ORs and CLs, all of the ORs have a p-value <.01 when I use the model with indicator variables, whereas the p-values for the same ethnic groups in the model using the class variable are not all significant even though the CLs around the ORs make them seem like they should be. Is this a bug in the program? Should I avoid class variables for variables I need to test for significance?
Proc surveylogistic; strata x;
class ethnicity (ref='White');
model exvghlth(descending)=ethnicity;
weight wgtfac;
format ethnicity ethnicity.;
run;
vs.
proc surveylogistic; strata x;
model exvghlth(descending)=black asianpi Hispanic;
weight wgtfac;
run;
Results from class variable model:
Analysis of Maximum Likelihood Estimates
Standard Wald
Parameter DF Estimate Error Chi-Square Pr > ChiSq
Intercept 1 0.0140 0.0215 0.4271 0.5134
ethnicity Asian/PI 1 0.0360 0.0363 0.9819 0.3217
ethnicity Black 1 -0.2356 0.0385 37.5352 <.0001
ethnicity Hispanic 1 -0.00728 0.0423 0.0297 0.8633
Odds Ratio Estimates
Point 95% Wald
Effect Estimate Confidence Limits
ethnicity Asian/PI vs White 0.843 0.761 0.934
ethnicity Black vs White 0.642 0.576 0.716
ethnicity Hispanic vs White 0.807 0.717 0.909
Results from indicator variable model:
Analysis of Maximum Likelihood Estimates
Standard Wald
Parameter DF Estimate Error Chi-Square Pr > ChiSq
Intercept 1 0.2210 0.0320 47.8226 <.0001
asianpi 1 -0.1709 0.0523 10.6866 0.0011
black 1 -0.4425 0.0553 64.1436 <.0001
hispanic 1 -0.2142 0.0606 12.5022 0.0004
Odds Ratio Estimates
Point 95% Wald
Effect Estimate Confidence Limits
asianpi 0.843 0.761 0.934
black 0.642 0.576 0.716
hispanic 0.807 0.717 0.909
Add parameter=Ref to your class variables?
@ngordon_kpdor wrote:
When I run the following below using a class variable, I get the same odds ratios for my race/ethnic groups compared to the reference group as I get when I run the model using indicator variables. However, despite getting the same ORs and CLs, all of the ORs have a p-value <.01 when I use the model with indicator variables, whereas the p-values for the same ethnic groups in the model using the class variable are not all significant even though the CLs around the ORs make them seem like they should be. Is this a bug in the program? Should I avoid class variables for variables I need to test for significance?
Proc surveylogistic; strata x;
class ethnicity (ref='White');
model exvghlth(descending)=ethnicity;
weight wgtfac;
format ethnicity ethnicity.;
run;
vs.
proc surveylogistic; strata x;
model exvghlth(descending)=black asianpi Hispanic;
weight wgtfac;
run;
Results from class variable model:
Analysis of Maximum Likelihood Estimates
Standard Wald
Parameter DF Estimate Error Chi-Square Pr > ChiSq
Intercept 1 0.0140 0.0215 0.4271 0.5134
ethnicity Asian/PI 1 0.0360 0.0363 0.9819 0.3217
ethnicity Black 1 -0.2356 0.0385 37.5352 <.0001
ethnicity Hispanic 1 -0.00728 0.0423 0.0297 0.8633
Odds Ratio Estimates
Point 95% Wald
Effect Estimate Confidence Limits
ethnicity Asian/PI vs White 0.843 0.761 0.934
ethnicity Black vs White 0.642 0.576 0.716
ethnicity Hispanic vs White 0.807 0.717 0.909
Results from indicator variable model:
Analysis of Maximum Likelihood Estimates
Standard Wald
Parameter DF Estimate Error Chi-Square Pr > ChiSq
Intercept 1 0.2210 0.0320 47.8226 <.0001
asianpi 1 -0.1709 0.0523 10.6866 0.0011
black 1 -0.4425 0.0553 64.1436 <.0001
hispanic 1 -0.2142 0.0606 12.5022 0.0004
Odds Ratio Estimates
Point 95% Wald
Effect Estimate Confidence Limits
asianpi 0.843 0.761 0.934
black 0.642 0.576 0.716
hispanic 0.807 0.717 0.909
Add parameter=Ref to your class variables?
@ngordon_kpdor wrote:
When I run the following below using a class variable, I get the same odds ratios for my race/ethnic groups compared to the reference group as I get when I run the model using indicator variables. However, despite getting the same ORs and CLs, all of the ORs have a p-value <.01 when I use the model with indicator variables, whereas the p-values for the same ethnic groups in the model using the class variable are not all significant even though the CLs around the ORs make them seem like they should be. Is this a bug in the program? Should I avoid class variables for variables I need to test for significance?
Proc surveylogistic; strata x;
class ethnicity (ref='White');
model exvghlth(descending)=ethnicity;
weight wgtfac;
format ethnicity ethnicity.;
run;
vs.
proc surveylogistic; strata x;
model exvghlth(descending)=black asianpi Hispanic;
weight wgtfac;
run;
Results from class variable model:
Analysis of Maximum Likelihood Estimates
Standard Wald
Parameter DF Estimate Error Chi-Square Pr > ChiSq
Intercept 1 0.0140 0.0215 0.4271 0.5134
ethnicity Asian/PI 1 0.0360 0.0363 0.9819 0.3217
ethnicity Black 1 -0.2356 0.0385 37.5352 <.0001
ethnicity Hispanic 1 -0.00728 0.0423 0.0297 0.8633
Odds Ratio Estimates
Point 95% Wald
Effect Estimate Confidence Limits
ethnicity Asian/PI vs White 0.843 0.761 0.934
ethnicity Black vs White 0.642 0.576 0.716
ethnicity Hispanic vs White 0.807 0.717 0.909
Results from indicator variable model:
Analysis of Maximum Likelihood Estimates
Standard Wald
Parameter DF Estimate Error Chi-Square Pr > ChiSq
Intercept 1 0.2210 0.0320 47.8226 <.0001
asianpi 1 -0.1709 0.0523 10.6866 0.0011
black 1 -0.4425 0.0553 64.1436 <.0001
hispanic 1 -0.2142 0.0606 12.5022 0.0004
Odds Ratio Estimates
Point 95% Wald
Effect Estimate Confidence Limits
asianpi 0.843 0.761 0.934
black 0.642 0.576 0.716
hispanic 0.807 0.717 0.909
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.