Introduction to Graphing in SAS

Slides:



Advertisements
Similar presentations
JNC 8 Guidelines….
Advertisements

TROPHY TRial Of Preventing HYpertension. High-normal BP increases CV risk Vasan RS et al. N Engl J Med. 2001;345: Incidence of CV events in women.
Hypertension Diagnosis and Treatment  Based on JNC 7 – published in 2003  Goal: BP
Week 3 Topic - Descriptive Procedures Program 3 in course notes Cody & Smith (Chapter 2)
Results of Monotherapy in ALLHAT: On-treatment Analyses ALLHAT Outcomes for participants who received no step-up drugs.
Graphical Reporting of Clinical Trial Data with SAS ODS Graphics
Blood Pressure Control By Randomized Drug Group In ALLHAT William C. Cushman, Charles E. Ford, Paula T. Einhorn, Jackson T. Wright, Jr., Richard A. Preston,
Success and Predictors of Blood Pressure Control in Diverse North American Settings: The Antihypertensive and Lipid- lowering Treatment to Prevent Heart.
TOMHS 8.3% 6.8% 18.3% 2.8% 6.6% 6.8%. Treatment of Mild Hypertension Study (TOMHS) Eligibility Visits 902 men/women Age years DBP mm Hg Free.
April 11 Logistic Regression –Modeling interactions –Analysis of case-control studies –Data presentation.
Lesson 5 - Topics Formatting Output Working with Dates Reading: LSB:3:8-9; 4:1,5-7; 5:1-4.
1 Antihypertensive Trial Outcome Differences: Diuretic vs. Calcium Channel Blocker Compared to participants assigned to the diuretic, those assigned to.
Copyright © 2008 SAS Institute Inc. All rights reserved. SAS and all other SAS Institute Inc. product or service names are registered trademarks or trademarks.
The TRial Of Preventing HYpertension (TROPHY) TROPHY.
1 Chronic Treatment of Resistant Hypertension with an Implantable Medical Device: Interim 3 Year Results of Two Studies of the Rheos ® Hypertension System.
William C. Cushman, MD, FACP, FAHA Veterans Affairs Medical Center, Memphis, TN For The ACCORD Study Group.
March 28, 30 Return exam Analyses of covariance 2-way ANOVA Analyses of binary outcomes.
Lesson 6 - Topics Reading SAS datasets Subsetting SAS datasets Merging SAS datasets.
Developing a Mixed Effects Model Using SAS PROC MIXED
Lecture 3 Topic - Descriptive Procedures Programs 3-4 LSB 4:1-4.4; 4:9:4:11; 8:1-8:5; 5:1-5.2.
1 Statistical Software Programming. STAT 6360 –Statistical Software Programming SAS Graphics SAS has two main facilities for producing graphics: 1.ODS.
Lesson 8 - Topics Creating SAS datasets from procedures Using ODS and data steps to make reports Using PROC RANK Programs in course notes LSB 4:11;5:3.
Lesson 12 More SGPLOT examples Exporting data Macro variables Table Generation - PROC TABULATE Miscellaneous Topics.
Today: March 7 Data Transformations Rank Tests for Non-Normal data Solutions for Assignment 4.
Wise Ones Coli Clements, Megan Kamil, Kerri Spilker.
Great way to show your data!. * In your journal, draw a 4 square grid.
Introduction to SAS ODS Graphics September 16, 2015 Rocio Lopez.
Saleem Jessani 1, Rasool Bux 1 and Tazeen H. Jafar 1,2. 1 Aga Khan University, Karachi, Pakistan 2 Duke-NUS Graduate Medical School, Singapore Socio-demographic.
Date of download: 6/22/2016 Copyright © 2016 American Medical Association. All rights reserved. From: Exercise and Weight Loss Reduce Blood Pressure in.
Lesson 10 - Topics SAS Procedures for Standard Statistical Tests and Analyses Programs 19 and 20 LSB 8:16-17.
Lecture 3 Topic - Descriptive Procedures
Today: Feb 28 Reading Data from existing SAS dataset One-way ANOVA
Baseline characteristics and effectiveness results
Lesson 4 Descriptive Procedures
Nursing Care of Patients with Hypertension
Health and Human Services National Heart, Lung, and Blood Institute
Vanguard Phase Results for the Blood Pressure Component
Flowchart of participants
Lesson 3 Overview Descriptive Procedures Controlling SAS Output
Chapter 8: ODS Graphics ODS graphics were not available prior to SAS 9.2 They have been implemented across a wide range of procedures Functionality isn’t.
Lesson 12 Topics Macro example Exporting data Character Functions
Lesson 13 More SGPLOT examples MAP Plotting Questions.
Lecture 2 Topics - Descriptive Procedures
Sunjoo Boo, RN, PhD, Erika Sivarajan Froelicher, RN, PhD, FAAN 
Lesson 9 - Topics Restructuring datasets LSB: 6:14
Lesson 10 - Topics SAS Procedures for Standard Statistical Tests and Analyses Programs 19 and 20 LSB 9:4-7;12-13 Welcome to lesson 10. In this lesson.
Lesson 8 - Topics Creating SAS datasets from procedures
WHI Observational Study: Cardiovascular death in women with hypertension but no history of CVD on monotherapy CVD death Diuretic, HR (95% CI) ACE inhibitor,
Lesson 11 - Topics Statistical procedures: PROC LOGIST, REG
Mean BP from initial visit to four years
INTRODUCTION TO SGPLOT Zahir Raihan OVERVIEW  ODS Graphics  SGPLOT overview  Plot Content  High value plot statements  High value plot options 
Determinants of new onset diabetes among hypertensive patients randomised in the ASCOT-BPLA Trial Dr Ajay K Gupta International Centre for Circulatory.
Demonstrating the Linear Model
Effects of Intensive Blood Pressure Control on Cardiovascular Events in Type 2 Diabetes Mellitus: The Action to Control Cardiovascular Risk in Diabetes.
Lecture 2 Topics - Descriptive Procedures
Getting Started with the SGPLOT Procedure: A Hands-On Workshop About the Presenter 1/14/2019 Josh Horstman is an independent statistical programming consultant.
Sunjoo Boo, RN, PhD, Erika Sivarajan Froelicher, RN, PhD, FAAN 
Chapter 28 Nutrition, Lifestyle, and Hypertension
Program This course will be dived into 3 parts: Part 1 Descriptive statistics and introduction to continuous outcome variables Part 2 Continuous outcome.
Clinical Graphs using SAS®
Framingham, Exam 5 subset
Appending and Concatenating Files
Managing Blood Pressure
Demographic and Clinical Characteristics (means ± SD or %) of Subjects in Different Office SBP and DBP Categories Mancia G et al Hypertension. 2005;45:1072.
The combined effects of low sodium and the DASH diet according to baseline blood pressure. The combined effects of low sodium and the DASH diet according.
Plots in SAS Boxplot, Lollipop graph, Scatterplot, Survival plot
Lecture 2 Topics - Descriptive Procedures
Presentation transcript:

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

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 2

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

Graphing With SAS PROC SGPLOT PROC SGPANEL 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

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;

* 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;

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

* 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;

* 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;

* 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;

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;

* 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;

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;

* 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;

* 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; sbp = sbp12; dbp = dbp12; visit = 12; run;

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

* 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;

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;

output out=plot mean=msbp mdbp stderr=sesbp sedbp n=nsbp ndbp; run; 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 1 3 668 140.096 90.5329 0.48466 0.12950 2 6 639 121.413 77.2175 0.55596 0.31754 12 627 121.818 77.8038 0.57465 0.31762 4 234 141.128 90.5491 0.79770 0.23224 5 225 130.160 81.4044 1.01741 0.49901 221 130.575 82.4253 1.04673 0.52290

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;

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

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;