Hello everyone,
I have survey data of approximately 5000 participants and I am currently looking to model the outcome of a dichotomized response variable to a predictor. Our question is if there is a trend of participants being more likely to be in the 1 level of the response variable as we move from 4 to 1 in the ordinal response predictor.
The dichotomized response has levels 1 and 0 while the predictor is an ordinal survey response with levels 1 - "Yes - completely", 2 - "Yes - mostly", 3 - "Yes - somewhat", and 4 - "No". I am currently wondering how to structure my proc logistic code and also weighing the use of proc logistic vs. proc surveylogistic. I do not have survey weights, so it seems that proc surveylogistic would not be useful in comparison to proc logisitic.
Here is my code so far:
proc logistic data = import plots=all;
class outcome q1 / param=ordinal;
model outcome = q1;
run;
I chose ordinal for the param= statement however I am not sure about that, though changing the param= option does not change the model fit statistics.
I will continue to read documentation about proc logistic to see what other options might suit, but if there are any suggestions please let me know. Thank you!
Assuming your data was from a random sample, it is easiest to avoid a modeling approach and use the Cochran-Armitage trend test available in PROC FREQ. You can also use a modeling approach with PROC LOGISTIC, but if the table is sparse this can make it difficult to successfully fit the model. When you use PROC LOGISTIC, you should not specify the response variable in the CLASS statement. If your predictor variable is ordinal, you should create a numeric variable with appropriate numeric values for its levels and use it only in the MODEL statement, not in the CLASS statement. The following shows both analyses assuming a numeric predictor Q1NUM. The trend test is the test of the Q1NUM parameter in the PROC LOGISTIC results. The tests from PROC FREQ and PROC LOGISTIC should not be expected to be the same as they are entirely different types of tests. For more information on the C-A trend test in PROC FREQ, see the "Details: Statistical Computations: Cochran-Armitage Test for Trend."
proc freq data=import;
table q1num*outcome/trend;
run;
proc logistic data=import;
model outcome(event='1')=q1num;
run;
Note that if your data was collected using a complex survey involving clustering or stratified sampling, you should not use PROC LOGISTIC or PROC FREQ - you should use PROC SURVEYLOGISTIC or PROC SURVEYFREQ.
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.