Lesson 10 - Topics SAS Procedures for Standard Statistical Tests and Analyses Programs 19 and 20 LSB 8:16-17.

Slides:



Advertisements
Similar presentations
Simple Logistic Regression
Advertisements

Analysis of Variance Compares means to determine if the population distributions are not similar Uses means and confidence intervals much like a t-test.
ANOVA: Analysis of Variation
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.
EPI 809 / Spring 2008 Final Review EPI 809 / Spring 2008 Ch11 Regression and correlation  Linear regression Model, interpretation. Model, interpretation.
Test statistic: Group Comparison Jobayer Hossain Larry Holmes, Jr Research Statistics, Lecture 5 October 30,2008.
6.1 - One Sample One Sample  Mean μ, Variance σ 2, Proportion π Two Samples Two Samples  Means, Variances, Proportions μ 1 vs. μ 2.
Lecture 8 Chi-Square STAT 3120 Statistical Methods I.
 Combines linear regression and ANOVA  Can be used to compare g treatments, after controlling for quantitative factor believed to be related to response.
Multiple Comparisons.
1 Experimental Statistics - week 4 Chapter 8: 1-factor ANOVA models Using SAS.
Week 111 Power of the t-test - Example In a metropolitan area, the concentration of cadmium (Cd) in leaf lettuce was measured in 7 representative gardens.
April 11 Logistic Regression –Modeling interactions –Analysis of case-control studies –Data presentation.
Introduction to SAS Essentials Mastering SAS for Data Analytics
1 Experimental Statistics - week 10 Chapter 11: Linear Regression and Correlation.
HLTH 653 Lecture 2 Raul Cruz-Cano Spring Statistical analysis procedures Proc univariate Proc t test Proc corr Proc reg.
23-1 Analysis of Covariance (Chapter 16) A procedure for comparing treatment means that incorporates information on a quantitative explanatory variable,
1 Experimental Statistics - week 10 Chapter 11: Linear Regression and Correlation Note: Homework Due Thursday.
January 31 and February 3,  Some formulae are presented in this lecture to provide the general mathematical background to the topic or to demonstrate.
Lesson 5 - Topics Formatting Output Working with Dates Reading: LSB:3:8-9; 4:1,5-7; 5:1-4.
Regression For the purposes of this class: –Does Y depend on X? –Does a change in X cause a change in Y? –Can Y be predicted from X? Y= mX + b Predicted.
Testing Multiple Means and the Analysis of Variance (§8.1, 8.2, 8.6) Situations where comparing more than two means is important. The approach to testing.
Statistical Analysis Regression & Correlation Psyc 250 Winter, 2008.
5-5 Inference on the Ratio of Variances of Two Normal Populations The F Distribution We wish to test the hypotheses: The development of a test procedure.
April 6 Logistic Regression –Estimating probability based on logistic model –Testing differences among multiple groups –Assumptions for model.
Basic Biostatistics Prof Paul Rheeder Division of Clinical Epidemiology.
Bandit Thinkhamrop, PhD. (Statistics) Department of Biostatistics and Demography Faculty of Public Health Khon Kaen University, THAILAND.
April 4 Logistic Regression –Lee Chapter 9 –Cody and Smith 9:F.
March 28, 30 Return exam Analyses of covariance 2-way ANOVA Analyses of binary outcomes.
Topic 23: Diagnostics and Remedies. Outline Diagnostics –residual checks ANOVA remedial measures.
Three Statistical Issues (1) Observational Study (2) Multiple Comparisons (3) Censoring Definitions.
Regression & Correlation. Review: Types of Variables & Steps in Analysis.
1 Experimental Statistics - week 14 Multiple Regression – miscellaneous topics.
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.
Lesson 4 - Topics Creating new variables in the data step SAS Functions.
March 30 More examples of case-control studies General I x J table Chi-square tests.
Topic 24: Two-Way ANOVA. Outline Two-way ANOVA –Data –Cell means model –Parameter estimates –Factor effects model.
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.
WINKS 7 Tutorial 3 Analyzing Summary Data (Using Student’s t-test) Permission granted for use for instruction and for personal use. ©
Experimental Statistics - week 3
Topic 20: Single Factor Analysis of Variance. Outline Analysis of Variance –One set of treatments (i.e., single factor) Cell means model Factor effects.
Today: March 7 Data Transformations Rank Tests for Non-Normal data Solutions for Assignment 4.
Comparing k > 2 Groups - Numeric Responses Extension of Methods used to Compare 2 Groups Parallel Groups and Crossover Designs Normal and non-normal data.
Other Types of t-tests Recapitulation Recapitulation 1. Still dealing with random samples. 2. However, they are partitioned into two subsamples. 3. Interest.
1 Experimental Statistics - week 13 Multiple Regression Miscellaneous Topics.
1 An example of a more complex design (a four level nested anova) 0 %, 20% and 40% of a tree’s roots were cut with the purpose to study the influence.
Experimental Statistics - week 9
Applied Epidemiologic Analysis - P8400 Fall 2002 Lab 3 Type I, II Error, Sample Size, and Power Henian Chen, M.D., Ph.D.
Topic 22: Inference. Outline Review One-way ANOVA Inference for means Differences in cell means Contrasts.
Bandit Thinkhamrop, PhD. (Statistics) Department of Biostatistics and Demography Faculty of Public Health Khon Kaen University, THAILAND.
1 Experimental Statistics - week 5 Chapter 9: Multiple Comparisons Chapter 15: Randomized Complete Block Design (15.3)
ANOVA: Analysis of Variation
ANOVA: Analysis of Variation
March 28 Analyses of binary outcomes 2 x 2 tables
ANOVA: Analysis of Variation
Hypothesis Testing Start with a question:
Today: Feb 28 Reading Data from existing SAS dataset One-way ANOVA
ANOVA: Analysis of Variation
This Week Review of estimation and hypothesis testing
Hypothesis testing using contrasts
Lecture 2 Topics - Descriptive Procedures
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.
After ANOVA If your F < F critical: Null not rejected, stop right now!! If your F > F critical: Null rejected, now figure out which of the multiple means.
If we can reduce our desire,
Experimental Statistics - Week 4 (Lab)
Simple Linear Regression
ANOVA Analysis of Variance.
Common Statistical Analyses Theory behind them
Introduction to SAS Essentials Mastering SAS for Data Analytics
Presentation transcript:

Lesson 10 - Topics SAS Procedures for Standard Statistical Tests and Analyses Programs 19 and 20 LSB 8:16-17

STATISTICAL PROCEDURES IN SAS

Important to understand the output

Treatment Groups in TOMHS 1.Beta Blocker 2.Calcium Channel Blocker 3.Diuretic 4.Alpha Blocker 5.ACE Inhibitor 6.Placebo are blood pressure drugs

Side Effect Questions Have you been troubled in the past 3 months with any of the following? a. Feverb. Sweatingww. Feeling depressed 1.No, not troubled 2.Yes, mildly 3.Yes, moderately 4.Yes, severely Responses 2-4 indicate a positive response.

* Program 19 DATA stat ; INFILE ‘C:\SAS_Files\tomhsfull.data' LRECL = 300 ; ptid group sbpbl sbp12 ursod12 se12_2 1. ; if se12_2 in(2,3,4) then tired12 = 1; else if se12_2 = 1 then tired12 = 2; sbpchg = sbp12 - sbpbl; if group = 6 then active = 2; else active = 1; if group IN(1,2,3,4,5) then drug = group;

PROC FREQ DATA=stat; TABLES active*tired/CHISQ RELRISK; TITLE 'Chi-square Test Comparing Active vs Placebo Group for Tiredness'; RUN; CHISQ – displays Chi-square test RELRISK – displays odds ratio and relative risk Indepent Variable * dependent variable

Table of active by tired12 active tired12 Frequency‚ Percent ‚ Row Pct ‚ Col Pct ‚ 1‚ 2‚ Total ƒƒƒƒƒƒƒƒƒˆƒƒƒƒƒƒƒƒˆƒƒƒƒƒƒƒƒˆ 1 ‚ 112 ‚ 522 ‚ 634 ‚ ‚ ‚ ‚ ‚ ‚ ‚ ‚ ‚ ƒƒƒƒƒƒƒƒƒˆƒƒƒƒƒƒƒƒˆƒƒƒƒƒƒƒƒˆ 2 ‚ 55 ‚ 170 ‚ 225 ‚ 6.40 ‚ ‚ ‚ ‚ ‚ ‚ ‚ ‚ ƒƒƒƒƒƒƒƒƒˆƒƒƒƒƒƒƒƒˆƒƒƒƒƒƒƒƒˆ Total Frequency Missing = 43 Statistic DF Value Prob ƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒ Chi-Square Likelihood Ratio Chi-Square Continuity Adj. Chi-Square Mantel-Haenszel Chi-Square Tests if two percentages are significantly different P-value

Table of active by tired12 active tired12 Frequency‚ Percent ‚ Row Pct ‚ Col Pct ‚ 1‚ 2‚ Total ƒƒƒƒƒƒƒƒƒˆƒƒƒƒƒƒƒƒˆƒƒƒƒƒƒƒƒˆ 1 ‚ 112 ‚ 522 ‚ 634 ‚ ‚ ‚ ‚ ‚ ‚ ‚ ‚ ‚ ƒƒƒƒƒƒƒƒƒˆƒƒƒƒƒƒƒƒˆƒƒƒƒƒƒƒƒˆ 2 ‚ 55 ‚ 170 ‚ 225 ‚ 6.40 ‚ ‚ ‚ ‚ ‚ ‚ ‚ ‚ ƒƒƒƒƒƒƒƒƒˆƒƒƒƒƒƒƒƒˆƒƒƒƒƒƒƒƒˆ Total Estimates of the Relative Risk (Row1/Row2) Type of Study Value 95% Confidence Limits ƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒ Case-Control (Odds Ratio) Cohort (Col1 Risk) RR = Risk of tiredness (Active v Placebo) RR = 17.67/24.44 = 0.72 OR = Odds of tiredness (Active v Placebo) OR = (112/522)/(55/170) = 0.66

PROC TTEST DATA=stat; VAR sbpchg; CLASS active; TITLE 'T Test Comparing Active vs Placebo Group for Change in Blood Pressure'; RUN; Testing if mean SBP change is equal between 2 groups.

Statistics Lower CL Upper CL Lower CL Variable active N Mean Mean Mean Std Dev Std Dev sbpchg sbpchg sbpchg Diff (1-2) Statistics Upper CL Variable active Std Dev Std Err Minimum Maximum sbpchg sbpchg sbpchg Diff (1-2) T-Tests Variable Method Variances DF t Value Pr > |t| sbpchg Pooled Equal <.0001 sbpchg Satterthwaite Unequal < = /1.0979

Plot Generated from PROC TTEST

PROC MEANS DATA=stat N MEAN STDERR T PRT ; CLASS group; VAR sbpchg; TITLE'Paired T-Test, Are there significant changes in SBP within each group?'; RUN; Also used for a crossover design where each patient gets each treatment in random order

Analysis Variable : sbpchg N group Obs N Mean Std Error t Value Pr > |t| ƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒ < < < < < <.0001 ƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒ T-value = Mean/Std Error

* Compare 5 active drug groups; * For SBP change; PROC ANOVA DATA=stat; CLASS drug; MODEL sbpchg = drug; MEANS drug/BON ; TITLE 'ANOVA Comparing 5 Active Treatment Groups for Change in SBP '; RUN;

The ANOVA Procedure Class Level Information Class Levels Values drug Number of observations 902 NOTE: Due to missing values, only 627 observations can be used in this analysis.

Dependent Variable: sbpchg ANOVA TABLE Sum of Source DF Squares Mean Square F Value Pr > F Model Error Corrected Total = 668.5/190.7 Source DF Anova SS Mean Square F Value Pr > F drug

Bonferroni (Dunn) t Tests for sbpchg Alpha 0.05 Critical Value of t 2.82 Minimum Significant Difference 4.92 Adjusts for 15 possible pairwise comparisons Required difference between any 2 groups to be significant.

Comparisons significant at the 0.05 level are indicated by ***. Difference Simultaneous drug Between 95% Confidence Comparison Means Limits *** ***

PROC GLM DATA=stat; * GLM (General Linear Model) CLASS drug; MODEL sbpchg = drug; ESTIMATE 'BB vs Diuretic' drug ; ESTIMATE 'CCB vs Diuretic' drug ; ESTIMATE 'Alpha B vs Diuretic‘ drug ; ESTIMATE 'ACE v Diuretic' drug ; MEANS drug; TITLE ‘GLM Comparing 5 Active Treatment Groups for Change in SBP '; RUN; Compares drug 1 with drug 3

The GLM Procedure Source DF Type III SS Mean Square F Value Pr > F drug Output from estimate statements Standard Parameter Estimate Error t Value Pr > |t| BB vs Diuretic CCB vs Diuretic Alpha B vs Diuretic ACE v Diuretic Each group has higher BP than the diuretic group. ESTIMATE ‘Avg 2-3 v 4' drug ;

PLOT GENERATED FROM PROC GLM

Distribution of Urinary Sodium Excretion

PROC NPAR1WAY DATA=stat WILCOXON ; CLASS drug; VAR ursod12; * Skewed distribution; TITLE 'Non-parametric Test Comparing Groups in Urinary Sodium'; RUN; *The values for ursod12 are ordered from lowest to highest and given a value of 1 to N. Analyses is then done on these ranked values.

Wilcoxon Scores (Rank Sums) for Variable ursod12 Classified by Variable drug Sum of Expected Std Dev Mean drug N Scores Under H0 Under H0 Score ƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒ Average scores were used for ties. Kruskal-Wallis Test Chi-Square DF 4 Pr > Chi-Square Of values drug N Median ƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒ ƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒ

* Program 20 * Chi-square tests from summary counts; DATA asthma; INFILE DATALINES; INPUT ses asthma count; DATALINES; ; Asthma SES |YES | NO | LOW | 40 | 100 | HIGH | 30 | 130 |

SAS LOG 1 DATA asthma; 2 INFILE DATALINES; 3 INPUT ses asthma count; 4 DATALINES; NOTE: The data set WORK.ASTHMA has 4 observations and 3 variables.

PROC FREQ DATA=asthma; TABLES ses*asthma/CHISQ RELRISK ; WEIGHT COUNT; TITLE 'Relationship between Asthma and SES'; RUN; ses asthma Frequency| Percent | Row Pct | Col Pct |1 |2 | Total | 40 | 100 | 140 | | | | | | | | | | 30 | 130 | 160 | | | | | | | | | Total Odds Ratio (Relative Odds) (40/100)/(30/130)= 1.73 Note: This is the odds ratio of having asthma (low v high SES)

Statistics for Table of ses by asthma Statistic DF Value Prob Chi-Square Estimates of the Relative Risk (Row1/Row2) Type of Study Value 95% Confidence Limits Case-Control Loosely speaking: There is a 73% increase chance of asthma if you are low SES (versus high SES).