Week 3 Topic - Descriptive Procedures Program 3 in course notes Cody & Smith (Chapter 2)

Slides:



Advertisements
Similar presentations
Summary Statistics/Simple Graphs in SAS/EXCEL/JMP.
Advertisements

I OWA S TATE U NIVERSITY Department of Animal Science Using Basic Graphical and Statistical Procedures (Chapter in the 8 Little SAS Book) Animal Science.
DESCRIBING DISTRIBUTION NUMERICALLY
Statistical Techniques I EXST7005 Start here Measures of Dispersion.
Statistical Methods Lynne Stokes Department of Statistical Science Lecture 7: Introduction to SAS Programming Language.
Z-test and t-test Xuhua Xia
Analysis of Variance Compares means to determine if the population distributions are not similar Uses means and confidence intervals much like a t-test.
Creating Graphs on Saturn GOPTIONS DEVICE = png HTITLE=2 HTEXT=1.5 GSFMODE = replace; PROC REG DATA=agebp; MODEL sbp = age; PLOT sbp*age; RUN; This will.
WINKS SDA Statistical Data Analysis (Windows Kwikstat) Getting Started Guide.
Today: Run SAS programs on Saturn (UNIX tutorial) Runs SAS programs on the PC.
Descriptive Statistics In SAS Exploring Your Data.
Measures of Dispersion
Distribution Summaries Measures of central tendency Mean Median Mode Measures of spread Standard Deviation Interquartile Range (IQR)
Data Cleaning 101 Ron Cody, Ed.D Robert Wood Johnson Medical School Piscataway, NJ.
(c) 2007 IUPUI SPEA K300 (4392) Outline: Numerical Methods Measures of Central Tendency Representative value Mean Median, mode, midrange Measures of Dispersion.
Lecture 5 Sorting, Printing, and Summarizing Your Data.
Chapter 9 Producing Descriptive Statistics PROC MEANS; Summarize descriptive statistics for continuous numeric variables. PROC FREQ; Summarize frequency.
Introduction to SAS Essentials Mastering SAS for Data Analytics Alan Elliott and Wayne Woodward SAS ESSENTIALS -- Elliott & Woodward1.
Statistics for Decision Making Bivariate Descriptive Statistics QM Fall 2003 Instructor: John Seydel, Ph.D.
1 Experimental Statistics - week 6 Chapter 15: Randomized Complete Block Design (15.3) Factorial Models (15.5)
Introduction to SAS BIO 226 – Spring Outline Windows and common rules Getting the data –The PRINT and CONTENT Procedures Manipulating the data.
Measures of Variation. For discrete variables, the Index of Qualitative Variation.
1 Experimental Statistics - week 4 Chapter 8: 1-factor ANOVA models Using SAS.
USING SAS PROCEDURES SAS System Options OPTIONS Statement
HLTH 653 Lecture 2 Raul Cruz-Cano Spring Statistical analysis procedures Proc univariate Proc t test Proc corr Proc reg.
Adventures in ODS: Producing Customized Reports Using Output from Multiple SAS® Procedures Stuart Long Westat, Durham,
STA Lecture 131 STA 291 Lecture 13, Chap. 6 Describing Quantitative Data – Measures of Central Location – Measures of Variability (spread)
1 Experimental Statistics - week 2 Review: 2-sample t-tests paired t-tests Thursday: Meet in 15 Clements!! Bring Cody and Smith book.
Lesson 5 - Topics Formatting Output Working with Dates Reading: LSB:3:8-9; 4:1,5-7; 5:1-4.
M07-Numerical Summaries 1 1  Department of ISM, University of Alabama, Lesson Objectives  Learn when each measure of a “typical value” is appropriate.
Corrected page numbers for optional readings in SAS ® Languages and Procedures Aug 30pp and Sept 6pp Sept 13pp Sept 27pp
Parallel Processing in SAS CPUCOUNT A comparison of Proc Means for the Project.
T T03-01 Calculate Descriptive Statistics Purpose Allows the analyst to analyze quantitative data by summarizing it in sorted format, scattergram.
Today - Messages Additional shared lab hours in A-269 –M, W, F 2:30-4:25 –T, Th 4:00-5:15 First priority is for PH5452. No TA or instructor Handouts –
Analyses using SPSS version 19
Lesson 6 - Topics Reading SAS datasets Subsetting SAS datasets Merging SAS datasets.
Statistics Chapter 1: Exploring Data. 1.1 Displaying Distributions with Graphs Individuals Objects that are described by a set of data Variables Any characteristic.
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.
Simple Linear Regression. Data available : (X,Y) Goal : To predict the response Y. (i.e. to obtain the fitted response function f(X)) Least Squares Fitting.
Lesson 4 - Topics Creating new variables in the data step SAS Functions.
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.
The Distribution of Single Variables. Two Types of Variables Continuous variables – Equal intervals of measurement – Known zero-point that is meaningful.
Lecture 4 Ways to get data into SAS Some practice programming
Today: March 7 Data Transformations Rank Tests for Non-Normal data Solutions for Assignment 4.
Computing with SAS Software A SAS program consists of SAS statements. 1. The DATA step consists of SAS statements that define your data and create a SAS.
© Willett, Harvard University Graduate School of Education, 1/28/2016S010Y/C09 – Slide 1 S010Y: Answering Questions with Quantitative Data Class 9/III.2:
Customize SAS Output Using ODS Joan Dong. The Output Delivery System (ODS) gives you greater flexibility in generating, storing, and reproducing SAS procedure.
What Types Of Data Are Collected? What Kinds Of Question Can Be Asked Of Those Data?  Do people who say they study for more hours also think they’ll finish.
Lesson 2 Topic - Reading in data Programs 1 and 2 in course notes –Chapter 2 (Little SAS Book)
1 Experimental Statistics - week 12 Chapter 11: Linear Regression and Correlation Chapter 12: Multiple Regression.
SAS Programming Training Instructor:Greg Grandits TA: Textbooks:The Little SAS Book, 5th Edition Applied Statistics and the SAS Programming Language, 5.
Based on Learning SAS by Example: A Programmer’s Guide Chapters 1 & 2
SAS ® 101 Based on Learning SAS by Example: A Programmer’s Guide Chapters 16 & 17 By Tasha Chapman, Oregon Health Authority.
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
Applied Business Forecasting and Regression Analysis
제 5장 기술통계 및 추론 PROC MEANS 절차 PROC MEANS <options> ;
Lesson 3 Overview Descriptive Procedures Controlling SAS Output
Lecture 2 Topics - Descriptive Procedures
IENG 486: Statistical Quality & Process Control
Quick Data Summaries in SAS
Lecture 2 Topics - Descriptive Procedures
Univariate Statistics
Producing Descriptive Statistics
Introduction to SAS Essentials Mastering SAS for Data Analytics
Let’s review some of the statistics you’ve learned in your first class: Univariate analyses (single variable) are done both graphically and numerically.
Lecture 2 Topics - Descriptive Procedures
Presentation transcript:

Week 3 Topic - Descriptive Procedures Program 3 in course notes Cody & Smith (Chapter 2)

Steps in Creating and Running a SAS Program 1.Create or edit SAS program > pico fn.sas (cntr x to exit) 2.Run the SAS program > sas fn.sas 3.List the files in directory - look for.log and.lst files > ls 4.View the.log file - look for errors and notes > less fn.log (type q to exit) 5.If errors go back to step 1 and repeat When no errors view.lst to view output > less fn.lst

Data Layout of tomhs.data Page of Course Notes VariableTypeLenPosInformDescription PTIDChar101$10.Patient ID RANDDATENum614mmddyy6.Rand. date SBPBLNum3733.SBP at baseline DATA tomhs; INFILE '/home/ph5420/data/tomhs.data'; ptid randdate sbpbl 3. ;

SAS Descriptive Procedures PROC PRINT PROC MEANS PROC UNIVARIATE PROC FREQ PROC PLOT PROC CHART

Syntax for Procedures PROC PROCNAME DATA=datasetname ; substatements/ ;

* PROGRAM 3; DATA weight; INFORMAT patid $10. ; INFILE '/home/ph5420/data/htwt.data' ; INPUT patid $ clinic $ sex $ height weight ; bmi = (weight* )/(height*height); RUN; C03615AANE C B00025PAYN B B00979YOUN B …

PROC PRINT DATA = weight (OBS=5) NOOBS; TITLE 'Proc Print: Five observations from the TOMHS Study'; RUN; PROC MEANS DATA = weight; VAR height weight bmi; TITLE 'Proc Means Example 1'; RUN; PROC MEANS DATA = weight MEAN MEDIAN STD MAXDEC=2; TITLE 'Proc Means Example 2 (specifying options)'; RUN; Page 25 of Cody/Smith lists statistics available Note: Median available in Version 8 of SAS

Proc Print: Five observations from the TOMHS Study patid clinic sex height weight bmi C03615AANE C B00979YOUN B B00644MATS B D01348HART D A01088COLL A Proc Means Example 1 The MEANS Procedure Variable N Mean Std Dev Minimum Maximum height weight bmi

Proc Means Example 2 (specifying options) The MEANS Procedure Variable Mean Median Std Dev height weight bmi

PROC MEANS DATA = weight N MEAN STD MAXDEC=2; CLASS clinic; TITLE 'Proc Means Example 3 (Using a CLASS statement)'; RUN; PROC MEANS DATA = weight N MEAN STD MAXDEC=2; CLASS clinic; WAYS 0 1 ; TITLE 'Proc Means Example 4 (Using WAYS statement)'; RUN;

Proc Means Example 3 (Using a CLASS statement) The MEANS Procedure N clinic Obs Variable N Mean Std Dev A 18 height weight bmi B 29 height weight bmi C 36 height weight bmi D 17 height weight bmi

Proc Means Example 4 (Using WAYS statement) The MEANS Procedure N Obs Variable N Mean Std Dev height weight bmi N clinic Obs Variable N Mean Std Dev A 18 height weight bmi B 29 height weight bmi C 36 height weight bmi D 17 height weight bmi

PROC UNIVARIATE DATA = weight PLOT ; ID patid; VAR bmi; TITLE 'Proc Univariate Example 1'; RUN; * Note: PROC UNIVARIATE will give you much output ;

Proc Univariate Example 1 The UNIVARIATE Procedure Variable: bmi Moments N 100 Sum Weights 100 Mean Sum Observations Std Deviation Variance Skewness Kurtosis Uncorrected SS Corrected SS Coeff Variation Std Error Mean Basic Statistical Measures Location Variability Mean Std Deviation Median Variance Mode Range Interquartile Range Tests for Location: Mu0=0 Test -Statistic p Value Student's t t Pr > |t| <.0001 Sign M 50 Pr >= |M| <.0001 Signed Rank S 2525 Pr >= |S| <.0001

Quantile Estimate 100% Max % % % % Q % Median % Q % % % % Min Extreme Observations Lowest Highest Value patid Obs Value patid Obs A00083ROBE B00979YOUN C04206ETLI B03077ANDE B00714OBRI A01166MCAN A00312HAYN C05323OLSO B00262JONE B02059MCHA 25

Stem Leaf # Boxplot | | | | | | | | | | + | *-----* | | | | | | | | th Percentile 25th Percentile Mean

The UNIVARIATE Procedure Variable: bmi Normal Probability Plot * *+ * | *++ | *** | ***+ | ***** | **+++ | **++ | * ** | ++*** | +**** | **** | ***+ | * *** *

* High resolution graphs can also be produced. The following makes a pdf file containing a histogram ; GOPTIONS DEVICE=pdfc GSFNAME=bmiplot FTEXT=swissb ROTATE GSFMODE=replace HTITLE=3 HTEXT=1.5; FILENAME bmiplot 'bmiplot.pdf'; PROC UNIVARIATE DATA = weight; VAR bmi; HISTOGRAM bmi / NORMAL MIDPOINTS=20 to 40 by 2; INSET N = 'N' (5.0) MEAN = 'Mean' (5.1) STD = 'Sdev' (5.1) MIN = 'Min' (5.1) MAX = 'Max' (5.1)/ POS=lm HEADER='Summary Statistics'; LABEL bmi = 'Body Mass Index (kg/m2)'; TITLE 'Histogram of BMI'; RUN;

Using Comment Statements in SAS Two Purposes 1.Documenting your program 2.Temporary deleting part of a program

Examples of Comment Code * Run proc univariate for variable BMI; PROC UNIVARIATE DATA = weight PLOT ; * ID patid ; VAR bmi; PROC UNIVARIATE DATA = weight /*PLOT*/; VAR bmi;