DATA LIST FILE="e:\510\2007\data\brca.dat" RECORDS=1 /IDNUM 1-4 STOPMENS 5 AGESTOP1 6-7 NUMPREG1 8-9 AGEBIRTH 10-11 MAMFREQ4 12 DOB 13-20 (A) EDUC 21-22 TOTINCOM 23 SMOKER 24 WEIGHT1 25-27. EXECUTE. /*Before proceeding, be sure to set dob up as a date variable, rather than string*/ /*Extract the Month, Day, and Year of birth from DOB*/ COMPUTE yearbir = Xdate.year(dob) . EXECUTE . COMPUTE daybir = Xdate.mday(dob). EXECUTE. COMPUTE monbir = Xdate.mon(dob) . EXECUTE . missing values yearbir (1999). IF (yearbir>=2000) yearbir = yearbir-100 . EXECUTE . /*Glue Month, Day, and Year of Birth back together to form DATEBIRTH*/ /*Be sure to set up the format of this variable to display as a date*/ COMPUTE datebirth = DATE.DMY(daybir,monbir,yearbir) . EXECUTE . /*Now, calculate the date of the survey, DOS*/ /*Be sure to set up the format of this vairable to display as a date*/ COMPUTE dos = DATE.DMY(01,01,1997) . EXECUTE . /*Finally, compute the person's age in years*/ COMPUTE AGE = DATEDIFF(dos,datebirth,"years") . EXECUTE . /*Set up missing values for other variables*/ missing values stopmens (9) /agestop1 (88,99) /agebirth (99) /numpreg1 (99) /mamfreq4 (9) /educ (99) /totincom(8,9) /smoker (9) /weight1 (999). RECODE stopmens (1=1) (2=0) into MENOPAUSE. EXECUTE. RECODE educ (1 thru 4 = 1) (5,6 = 2) (7,8=3) into EDCAT. EXECUTE. RECODE educ (1 thru 5 = 0) (6 thru 8 = 1) into HIGHED. EXECUTE. RECODE age (low thru 49 = 1) (50 thru 59 = 2) (60 thru 69 = 3) (70 thru high =4) into AGECAT. EXECUTE. RECODE age (low thru 49 = 0) (50 thru high = 1) into OVER50. EXECUTE. RECODE age (50 thru high = 1) (low thru 49 = 2) into HIGHAGE. EXECUTE. *---------------------------------------------------------------------------------------------------------ANALYSIS. DESCRIPTIVES VARIABLES=IDNUM STOPMENS AGESTOP1 NUMPREG1 AGEBIRTH MAMFREQ4 DOB EDUC TOTINCOM SMOKER WEIGHT1 yearbir daybir monbir datebirth dos AGE MENOPAUSE EDCAT HIGHED AGECAT OVER50 HIGHAGE /STATISTICS=MEAN STDDEV MIN MAX . *--------------------------------------------Logistic regression with a single continuous predictor. LOGISTIC REGRESSION MENOPAUSE /METHOD = ENTER AGE /PRINT = CI(95) /CRITERIA = PIN(.05) POUT(.10) ITERATE(20) CUT(.5) . *-----------------------------------------------------------------------------------Oneway frequencies. FREQUENCIES VARIABLES=STOPMENS MENOPAUSE EDUC EDCAT HIGHED AGE AGECAT OVER50 HIGHAGE /ORDER= ANALYSIS . /*Crosstabs of HIGHAGE by STOPMENS*/ CROSSTABS /TABLES=HIGHAGE BY STOPMENS /FORMAT= AVALUE TABLES /STATISTIC=CHISQ RISK /CELLS= COUNT ROW /COUNT ROUND CELL . /*Logistic Regression with Dummy Variable Predictor*/ LOGISTIC REGRESSION MENOPAUSE /METHOD = ENTER OVER50 /PRINT = CI(95) /CRITERIA = PIN(.05) POUT(.10) ITERATE(20) CUT(.5) . /*Relationship of AGECAT to MENOPAUSE*/ CROSSTABS /TABLES=AGECAT BY MENOPAUSE /FORMAT= AVALUE TABLES /STATISTIC=CHISQ /CELLS= COUNT ROW /COUNT ROUND CELL . /*Recode Age into AGECAT3 with 3 categories*/ RECODE age (low thru 49 = 1) (50 thru 59=2) (60 thru high = 3) into AGECAT3. EXECUTE. LOGISTIC REGRESSION MENOPAUSE /METHOD = ENTER AGECAT3 /CONTRAST (AGECAT3)=Indicator(1) /PRINT = CI(95) /CRITERIA = PIN(.05) POUT(.10) ITERATE(20) CUT(.5) . /*Relationship of several predictors to Menopause*/ LOGISTIC REGRESSION MENOPAUSE /METHOD = ENTER AGE EDCAT SMOKER TOTINCOM NUMPREG1 /CONTRAST (EDCAT)=Indicator(1) /PRINT = CI(95) /CRITERIA = PIN(.05) POUT(.10) ITERATE(20) CUT(.5) .