My assignment consist of creating dummies variables for sex and age and using them in a multiple regression procedure: Here is what I did. I need help finding out why DUMMIES FOR AGE VARIABLES PRINT ONLY ZEROS. My goal is to do a regression analysis using dummy variables for sex and age my attempt is at the end of the program. The procedure does not work, I believe it is because of a problem with the dummy variables. Thanks for your help. DATA REGRESS; DO AGE = '6 Mo.','9 Mo.','12 Mo.'; DO SEX = 'M','F'; DO I = 1 to 7; SPEED = INT(RANNOR(451212)*5 + 20 + 4*(AGE EQ '9 Mo.') + 5*(AGE EQ '12 Mo.') - 8*(SEX EQ 'M')); Rest_Time = INT(RANUNI(451212)*15 + 200 + 4*(AGE EQ '6 Mo.') + 5*(AGE EQ '9 Mo.') - 8*(SEX EQ 'F')); Recovery = INT(RANNOR(451212)*5 + 125 + 4*(AGE EQ '9 Mo.') + 5*(AGE EQ '12 Mo.') - 8*(SEX EQ 'M')); OUTPUT; END; END; END; DROP I; RUN; ***** part of the program I need help with starts here*** DATA DUMMIES; SET REGRESS; IF AGE= '6 MO.' THEN AGE1=1; ELSE AGE1=0; IF AGE ='9 MO.' THEN AGE2=1; ELSE AGE2=0; IF SEX ='F' THEN FEMALE=1; ELSE FEMALE=0; PROC PRINT DATA=DUMMIES; VAR AGE1 AGE2 FEMALE; RUN; PROC REG DATA = FINAL; TITLE' REGRESSION WITH SPEED AS DEPENDENT VARIABLE'; MODEL SPEED = AGE1 AGE2 FEMALE REST_TIME RECOVERY/P R; RUN; QUIT;
... View more