options formchar="|----|+|---+=|-/\<>*"; options yearcutoff = 1900; data breastcancer; infile "C:\Users\kwelch\Desktop\epid759\brca.dat"; input IDNUM 1-4 stopmens 5 agestop1 6-7 numpreg1 8-9 agebirth 10-11 mamfreq4 12 @13 dob mmddyy8. education 21-22 totincome 23 smoker 24 weight 25-27; format dob mmddyy10.; if stopmens = 9 then stopmens = .; if agestop1 in(88,99) then agestop1 = .; /*if agestop1 = 88 or agestop1 = 99 then agestop1 = .;*/ if numpreg1 in (88,99) then numpreg1=.; if agebirth in (9,88,99) then agebirth=.; if mamfreq4 = 9 then mamfreq4=.; if dob = "09SEP1999"d then dob=.; if education = 99 then education=.; if totincome in (8,9) then totincome=.; if smoker=9 then smoker=.; if weight = 999 then weight=.; run; proc contents data=breastcancer; run; proc means data=breastcancer; run; proc freq data=breastcancer; tables stopmens -- weight; run; proc freq data=breastcancer; tables dob; run; proc univariate data=breastcancer; var agebirth; histogram; run; proc univariate data=breastcancer noprint; var dob; histogram; run; /********************************************* Exercise 2 starts here **********************************************/ *Proc Print: Questions 1,2,3,4; proc print data=breastcancer; run; proc print data=breastcancer(obs=10); run; proc print data=breastcancer(firstobs=50, obs=60); run; proc print data=breastcancer; var stopmens education agebirth; run; *Proc Contents: Question 5,6; proc contents data=breastcancer; run; proc contents data=breastcancer varnum; run; *Proc Means: Questions 7,8,9,10,11,12; proc means data=breastcancer; run; proc means data=breastcancer; var weight; run; proc means data=breastcancer; class smoker; var weight; run; proc means data=breastcancer; class smoker stopmens; run; proc means data=breastcancer n mean median min max range clm; run; proc means data=breastcancer n mean median min max range clm alpha=.10; run; *Proc Freq: Question 13; proc freq data=breastcancer; tables education; run; *Proc Univariate: Questions 14,15,16,17,18; proc univariate data=breastcancer; var agebirth; run; proc univariate data=breastcancer; var agebirth; class education; run; proc univariate data=breastcancer; var agebirth; histogram; qqplot / normal(mu=est sigma=est); run;