Hi all,
Have attached screenshots and have copied code / outputs below - struggling to include basic analysis on smoking variable. Any idea how to fix this?
Many thanks in advance,
Craig
Data dictionary is as follows;
smok | 1093 | Created | 141 | number | Smoking never/former/current | 0 | Never | 1 | Former | 2 | Current | 99 | Missing |
Had formatted as follows:
PROC FORMAT;
VALUE SMOK
0 = 'Never smoker'
1 = 'Former smoker'
2 = 'Current smoker'
99 = 'missing'
;
And was using the following for a logistic regression
proc logistic data= ARCAGE;
FORMAT SMOK SMOK. DRINK DRINK. SEX SEX.;
CLASS SMOK ( REF = '0: Never smoker')
DRINK (REF = '0: Never')
SEX ( REF = '2: Female' )
BMIC ( REF = '2' );
model CASE = AGE10 SEX SMOK SMOKP PROLEV DRINK ALCOIC BMIC /rocci RL SELECTION = F;
run;




1007 PROC FORMAT;
1008 VALUE SMOK
1009 0 = 'Never smoker'
1010 1 = 'Former smoker'
1011 2 = 'Current smoker'
1012 99 = 'missing'
1013 ;
NOTE: Format SMOK is already on the library WORK.FORMATS.
NOTE: Format SMOK has been output.
NOTE: PROCEDURE FORMAT used (Total process time):
real time 11.71 seconds
cpu time 1.07 seconds
1014 proc logistic data= ARCAGE;
1015 FORMAT SMOK SMOK. DRINK DRINK. SEX SEX.;
1016 CLASS SMOK ( REF = '0: Never smoker')
1017 DRINK (REF = '0: Never')
1018 SEX ( REF = '2: Female' )
1019 BMIC ( REF = '2' );
1020
1021 model CASE = AGE10 SEX SMOK SMOKP PROLEV DRINK ALCOIC BMIC /rocci RL SELECTION = F;
1022 run;
ERROR: Invalid reference value for SMOK.
NOTE: The SAS System stopped processing this step because of errors.
NOTE: There were 3969 observations read from the data set WORK.ARCAGE.
NOTE: PROCEDURE LOGISTIC used (Total process time):
real time 0.01 seconds
cpu time 0.00 seconds