Hello,
I am new to SAS am interesting in trying to run logistic regression. I want to adjust for Sex, Age, and Education while running the logistic regression with the factors listed on the table ( I am going to paste the table below to show the excel table I am trying to do the regression on). I would like to know if politics for example is significant with adjusting for sex, age and education. I will include how these variables are coded because I think that changes what statements we might be able to use. Thank you for any guidance in this.
-Our Sex variable is either (M) or (F)
- Our Education is binary 1 or 0 with this code:
IF EDUCATION IN (4,5) THEN COLLEGE = 1;
ELSE IF EDUCATION IN (1,2,3) THEN COLLEGE = 0;
ELSE COLLEGE= . ;
- Our Age is coded in categories with this code:
proc format;
value agef 18-29= '18-29' 30-64='30-64' 65-high= '>65';
run;
Show us the code you have tried so far.
I am trying to use the code provided as an exmaple to follow from the links above where the examples are using titanice code.
what my code looks like is this
PROC LOGISTIC DATA = vaccine_hesitancy descending;
where part=1;
class SEX AGE EDUCATION;
model VACCINEHESITANT(event= '1') = vaccinefactors1 vaccinefactors2 vaccinefactors3 vaccinefactors4 vaccinefactors5 vaccinefactors6 vaccinefactors7 vaccinefactors8 vaccinefactors9 vaccinefactors10 vaccinefactors11/
selection = stepwise expb stb lackfit ;
output out = temp p=new;
store vaccine_hesitancy_logistic;
run;
To begin, my error is " work.vaccine_hesitancy data" does not exist
I am trying to use the code provided as an exmaple to follow from the links above where the examples are using titanice code.
what my code looks like is this
PROC LOGISTIC DATA = vaccine_hesitancy descending;
where part=1;
class SEX AGE EDUCATION;
model VACCINEHESITANT(event= '1') = vaccinefactors1 vaccinefactors2 vaccinefactors3 vaccinefactors4 vaccinefactors5 vaccinefactors6 vaccinefactors7 vaccinefactors8 vaccinefactors9 vaccinefactors10 vaccinefactors11/
selection = stepwise expb stb lackfit ;
output out = temp p=new;
store vaccine_hesitancy_logistic;
run;
To begin, my error is " work.vaccine_hesitancy data" does not exist
It is the dataset I have been using for my whole project. It seems like from the video it is the correct data I should be placing in that line.
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.
SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.
Find more tutorials on the SAS Users YouTube channel.