/**********Import Data**************/ PROC IMPORT OUT= WORK.DEMO DATAFILE= "C:\temp\data.xls" DBMS=EXCEL2000 REPLACE; GETNAMES=YES; RUN; /***************************************/ proc contents; run; proc means; run; proc freq; tables ethnicity gender; run; proc freq; tables age; run; proc freq; tables gender*ethnicity / chisq expected ; run; /******Calculate New Variables***************/ data demo2; set demo; if diastolic >=85 then hidbp=1; if diastolic <85 then hidbp=2; if diastolic = . then hidbp = .; agesquared=age*age; logweight = log(weight); wtkg = weight/2.2026; htm = (height*12)/39; bmi = wtkg /(htm**2); if age = . then delete; if bmi >=30 then hibmi = 1; if bmi < 30 then hibmi = 2; if bmi = . then hibmi = .; run; proc freq; tables gender * hidbp / relrisk; run; **************************************************; proc chart; vbar bmi ; run; proc chart; vbar ethnicity; run; proc sort; by gender; run; proc chart; by gender; vbar bmi ; run; proc chart; by gender; vbar ethnicity; run; *************************************************; proc plot; plot systolic*age; run; quit; proc sort; by gender; run; proc plot; by gender; plot systolic*age; run; quit; *************************************************; proc univariate plot normal; var systolic; run; **************************************************; proc print; where systolic > 160; run; **************************************************; proc corr; var systolic diastolic age; run; **************************************************; proc ttest; class gender; var systolic diastolic bmi; run; ***************************************************; proc reg; model systolic = age ; run;quit; ****************************************************;