Graphing in SAS for TOMHS Clinical Trial Data Analysis

introduction to graphing in sas n.w
1 / 27
Embed
Share

Explore the application of PROC SGPLOT in SAS for graphing and analyzing data from the TOMHS Clinical Trial on mild hypertension. Learn how to create histograms, box plots, bar charts, scatter plots, and more to visualize and interpret study results effectively. Discover the power of SAS for graphical data representation and interpretation.

  • SAS Graphing
  • Clinical Trial Data
  • Data Analysis
  • PROC SGPLOT
  • TOMHS

Uploaded on | 0 Views


Download Presentation

Please find below an Image/Link to download the presentation.

The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author. If you encounter any issues during the download, it is possible that the publisher has removed the file from their server.

You are allowed to download the files provided on this website for personal or commercial use, subject to the condition that they are used lawfully. All files are the property of their respective owners.

The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author.

E N D

Presentation Transcript


  1. Introduction to Graphing in SAS Greg Grandits, Division of Biostatistics March 6, 2017 www.biostat.umn.edu/~greg-g/ph6344.html

  2. Treatment of Mild Hypertension Study (TOMHS) Clinical Trial of persons with mild hypertension 1986-1992. Four clinical centers in U.S. 902 participants Six treatment groups (5 classes of BP meds) Diuretic Beta Blocker Calcium Channel Blocker Alpha Blocker ACE inhibitor Placebo All participants intervened to reduce weight and intake of sodium

  3. TOMHS SAS Dataset (1 Row per participant) Demographics Age Gender Ethnicity Blood Pressure, Pulse and Weight Treatment group (1-6) Blood total and HDL cholesterol Serum potassium and glucose Data at baseline, 6-months, and 12-months

  4. Graphing With SAS PROC SGPLOT Histograms Box plots Barcharts Scatter plots (regression line) Series plots PROC SGPANEL Paneled plots Example: Boxplots of Change in BP by Group, Paneled by visit

  5. proc format; value sex 1 = 'Men' 2='Women'; value group 1='BB' 2='CCB' 3='Diuretic 4='AB' 5='ACE' 6='Placebo'; value visit 0='Baseline' 6='Month 6' 12='Month 12'; value active 1='Active' 2='Placebo'; value race 1 = 'White' 2='Black' 3='Asian' 4='Other'; run;

  6. * Reading in the data and defining variables; libname t '.'; data temp; set t.tomhs; bmi = (wtbl*703.0768)/(height*height); sbpdif12 = sbp12 - sbpbl; if group in(1,2,3,4,5) then active = 1; else active = 2; run;

  7. * Set up; ods graphics / reset noborder; ods listing ; * Writes each graph to a png file;

  8. * Histogram using sgplot; proc sgplot; histogram bmi; density bmi/type=normal; density bmi/type=kernel; yaxis label='Percent' grid ; xaxis label='BMI (kg/m2)'; title 'Histogram of BMI at Baseline in TOMHS'; run;

  9. * Boxplots by Gender ; proc sgplot; vbox bmi/category=sex; yaxis label='BMI (kg/m2)' grid; xaxis display=(nolabel); title 'Boxplot of BMI at Baseline by Gender in TOMHS'; format sex sex.; run;

  10. * Vertical bar chart; proc sgplot; vbar clinic/stat=freq datalabel; xaxis label='Clinical Center'; yaxis label='No. of Participants'; title 'Number of Perticipants Enrolled by Clinical Center in TOMHS'; run;

  11. proc sgplot; vbar clinic/stat=percent datalabel; xaxis label='Clinical Center'; yaxis label='% of Participants' ; title 'Percent of Participants Enrolled by Clinical Center in TOMHS'; run;

  12. * Response chart; proc sgplot noautolegend; vbar group/response=sbpdif12 stat=mean limitstat=stderr ; yaxis label = 'Mean SBP Change (mm Hg)'; xaxis label = 'Treatment Group'; title 'Mean Systolic BP Change at 12-Months by Group in TOMHS'; format group group.; run;

  13. proc sgplot; vbar race/stat=freq datalabel group=sex groupdisplay=cluster name='sex'; xaxis label='Race/Ethnicity'; yaxis label='No. of Participants'; title 'Number of Participants Enrolled by Ethnicity and Gender in TOMHS'; keylegend 'sex' / title='' ; format race race.; format sex sex.; run;

  14. * Standard scatter plot with regression line; proc sgplot; reg y=sbpbl x=dbpbl; yaxis label = 'SBP (kg/m2)'; xaxis label = 'Age (y)'; title 'Scatter Plot of SBP Versus DBP at Baseline in TOMHS'; run;

  15. * Create long format file; data long; set temp; keep active visit sbp dbp; sbp = sbpbl; dbp = dbpbl; visit = 0; if sbp ne . then output; sbp = sbp6; dbp = dbp6; visit = 6; if sbp ne . then output; sbp = sbp12; dbp = dbp12; visit = 12; if sbp ne . then output; run;

  16. Obs 1 2 3 4 5 6 7 8 9 10 ptid A00001 A00001 A00010 A00010 A00010 A00021 A00021 A00021 A00023 A00023 active 1 1 2 2 2 1 1 1 1 1 sbp 139.5 122.0 144.0 117.0 129.0 141.0 116.0 118.0 134.0 139.0 dbp 87.0 74.0 90.5 74.0 71.0 90.5 65.0 69.0 92.5 92.0 visit 0 6 0 6 12 0 6 12 0 6

  17. * Create boxplots by group and visit using proc sgpanel; proc sgpanel data=long noautolegend; panelby visit/columns=3 novarname ; rowaxis label='BP (mmHg)' grid; colaxis integer display=(nolabel); vbox sbp/category=active; format active active.; format visit visit.; title 'Boxplots of SBP by Visit and Group in TOMHS'; run;

  18. proc sgpanel data=long noautolegend; panelby visit/columns=3 novarname ; rowaxis label='BP (mmHg)' grid; colaxis display=(nolabel); vbox sbp/category=active group=active nofill nomean ; format active active.; format visit visit.; title 'Boxplots of SBP by Visit and Group in TOMHS'; styleattrs datacolors=(blue red); run;

  19. proc means nway; class active visit; var sbp dbp ; output out=plot mean=msbp mdbp stderr=sesbp sedbp n=nsbp ndbp; run; Obs active visit _TYPE_ _FREQ msbp mdbp sesbp sedbp nsbp ndbp _ 668 639 627 234 225 221 1 2 3 4 5 6 1 1 1 2 2 2 0 6 12 0 6 12 3 3 3 3 3 3 140.096 90.5329 0.48466 0.12950 668 121.413 77.2175 0.55596 0.31754 639 121.818 77.8038 0.57465 0.31762 627 141.128 90.5491 0.79770 0.23224 234 130.160 81.4044 1.01741 0.49901 225 130.575 82.4253 1.04673 0.52290 221 668 639 627 234 225 221

  20. proc sgplot data=plot ; series x=visit y=msbp/markers group=active ; xaxis label='Follow-up Visit' type=discrete ; yaxis label='SBP (mmHg)' grid ; title 'Average SBP Over Follow-up for Active and Placebo Groups in TOMHS'; format active active.; label active= 'Group'; run;

  21. data plot; set plot (drop=_freq_ _type_); uppsbp = msbp + sesbp; lowsbp = msbp - sesbp; uppdbp = mdbp + sedbp; lowdbp = mdbp - sedbp; run;

  22. proc sgplot data=plot ; styleattrs datasymbols=(circlefilled diamondfilled); series x=visit y=msbp/markers group=active name='group'; scatter x=visit y=msbp/group=active yerrorlower=lowsbp yerrorupper=uppsbp ; xaxis label='Follow-up Visit' type=discrete offsetmin=0.05 offsetmax=0.05 ; yaxis label='SBP (mmHg)' grid minor; keylegend 'group' / title='' ; title 'Average SBP Over Follow-up for Active and Placebo Groups in TOMHS'; format active active.; label active= 'Group'; run;

More Related Content