* BloodPressure Example; * SAS code for Lab 1 Problems; options linesize=70 nodate pageno=1; * Prob 1 Create datasets bp1 and bp2; data bp1; infile "c:/datasets/blood-pressure1.txt" firstobs=2; input standing supine; label standing="Blood Pressure in Standing Position" supine="Blood Pressure in Supine Position"; data bp2; infile "c:/datasets/blood-pressure2.txt" firstobs=2; input press pos $; label press="Blood Pressure" pos="Position of Subject"; * Prob 2; proc print data=bp1; proc print data=bp2; * Prob 3 Obtain univariate statistics from bp1 dataset using proc means and univariate; proc means data=bp1 n mean std p1 p5 p25 p50 p75 p95 p99 qrange; var standing supine; proc univariate data=bp1; var standing supine; * Prob 4 Repeat analyses of Prob 3 using bp2; proc sort data=bp1; by pos; proc means data=bp2 n mean std p1 p5 p25 p50 p75 p95 p99 qrange; by pos; var standing supine; proc univariate data=bp1; by pos; var standing supine; * Prob 5 Create histograms; proc univariate data=bp1 noprint; histogram standing; histogram standing / endpoints=(100 to 700 by 200); histogram standing / endpoints=(100 to 600 by 50); histogram supine; histogram supine / endpoints=(0 to 180 by 20); histogram supine / endpoints=(0 to 180 by 10); * Prob 6 Create normal plots; proc univariate data=bp1 noprint; probplot standing /normal; probplot supine / normal; * Prob 7 Create side-by-side boxplots; proc boxplot data=bp2; plot press * pos; * Prob 8 Find 95% confidence intervals for population means for standing and supine; proc means data=bp1 clm; var standing supine; * Prob 9 Create bp1cleaned.txt with observations containing outliers deleted from bp1, then perform paired sample t-test on remaining data; data bp1cleaned; infile "c:/datasets/bp1cleaned.txt" firstobs=2; input standing supine; proc ttest; paired standing * supine; * Prob 10 Create bp2cleaned.txt from data in blood-pressure1.txt but formatted as bp1cleaned.txt. Then perform paired sample t-test on remaining data; data bp2cleaned; infile "c:/datasets/bp2cleaned.txt" firstobs=2; input press pos $; proc ttest; class pos; var press; run; quit;