1 Experimental Statistics - week 4 Chapter 8: 1-factor ANOVA models Using SAS.

Slides:



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

Experimental Statistics - week 5
A. The Basic Principle We consider the multivariate extension of multiple linear regression – modeling the relationship between m responses Y 1,…,Y m and.
Statistical Methods Lynne Stokes Department of Statistical Science Lecture 7: Introduction to SAS Programming Language.
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.
Today: Run SAS programs on Saturn (UNIX tutorial) Runs SAS programs on the PC.
Multiple regression analysis
ANOVA notes NR 245 Austin Troy
Reading – Linear Regression Le (Chapter 8 through 8.1.6) C &S (Chapter 5:F,G,H)
Be humble in our attribute, be loving and varying in our attitude, that is the way to live in heaven.
ANalysis Of VAriance (ANOVA) Comparing > 2 means Frequently applied to experimental data Why not do multiple t-tests? If you want to test H 0 : m 1 = m.
A Simple Guide to Using SPSS© for Windows
Lecture 9: One Way ANOVA Between Subjects
Inferences About Process Quality
Welcome to SAS…Session..!. What is SAS..! A Complete programming language with report formatting with statistical and mathematical capabilities.
Week 3 Topic - Descriptive Procedures Program 3 in course notes Cody & Smith (Chapter 2)
Collection and Analysis of Data CPH 608 Spring 2015.
Advanced Research Methods in Psychology - lecture - Matthew Rockloff
1 Experimental Statistics - week 3 Statistical Inference 2-sample Hypothesis Tests Review Continued Chapter 8: Inferences about More Than 2 Population.
Introduction to SAS Essentials Mastering SAS for Data Analytics
1 Experimental Statistics - week 7 Chapter 15: Factorial Models (15.5) Chapter 17: Random Effects Models.
Introduction to SAS Essentials Mastering SAS for Data Analytics Alan Elliott and Wayne Woodward SAS ESSENTIALS -- Elliott & Woodward1.
1 Experimental Statistics - week 6 Chapter 15: Randomized Complete Block Design (15.3) Factorial Models (15.5)
 Combines linear regression and ANOVA  Can be used to compare g treatments, after controlling for quantitative factor believed to be related to response.
Introduction to SAS BIO 226 – Spring Outline Windows and common rules Getting the data –The PRINT and CONTENT Procedures Manipulating the data.
Introduction to SAS Essentials Mastering SAS for Data Analytics
1 Experimental Statistics - week 10 Chapter 11: Linear Regression and Correlation.
1 Experimental Statistics - week 10 Chapter 11: Linear Regression and Correlation Note: Homework Due Thursday.
INTRODUCTORY LINEAR REGRESSION SIMPLE LINEAR REGRESSION - Curve fitting - Inferences about estimated parameter - Adequacy of the models - Linear.
1 Experimental Statistics - week 2 Review: 2-sample t-tests paired t-tests Thursday: Meet in 15 Clements!! Bring Cody and Smith book.
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.
One-Factor Analysis of Variance A method to compare two or more (normal) population means.
Lecturer’s desk INTEGRATED LEARNING CENTER ILC 120 Screen Row A Row B Row C Row D Row E Row F Row G Row.
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.
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.
Xuhua Xia Polynomial Regression A biologist is interested in the relationship between feeding time and body weight in the males of a mammalian species.
One-Way Analysis of Variance … to compare 2 or population means.
Lab 5 instruction.  a collection of statistical methods to compare several groups according to their means on a quantitative response variable  Two-Way.
6-1 Introduction To Empirical Models Based on the scatter diagram, it is probably reasonable to assume that the mean of the random variable Y is.
The Completely Randomized Design (§8.3)
BUSI 6480 Lecture 8 Repeated Measures.
General Linear Model 2 Intro to ANOVA.
1 Experimental Statistics - week 14 Multiple Regression – miscellaneous topics.
STA 286 week 131 Inference for the Regression Coefficient Recall, b 0 and b 1 are the estimates of the slope β 1 and intercept β 0 of population regression.
PSYC 3030 Review Session April 19, Housekeeping Exam: –April 26, 2004 (Monday) –RN 203 –Use pencil, bring calculator & eraser –Make use of your.
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.
By: Corey T. Williams 03 May Situation Objective.
Xuhua Xia Correlation and Regression Introduction to linear correlation and regression Numerical illustrations SAS and linear correlation/regression –CORR.
1 Experimental Statistics - week 12 Chapter 12: Multiple Regression Chapter 13: Variable Selection Model Checking.
1 Experimental Statistics - week 9 Chapter 17: Models with Random Effects Chapter 18: Repeated Measures.
1 Experimental Statistics Spring week 6 Chapter 15: Factorial Models (15.5)
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.
IE241: Introduction to Design of Experiments. Last term we talked about testing the difference between two independent means. For means from a normal.
One-Way Analysis of Variance Recapitulation Recapitulation 1. Comparing differences among three or more subsamples requires a different statistical test.
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.
Other Types of t-tests Recapitulation Recapitulation 1. Still dealing with random samples. 2. However, they are partitioned into two subsamples. 3. Interest.
CRD, Strength of Association, Effect Size, Power, and Sample Size Calculations BUSI 6480 Lecture 4.
1 Experimental Statistics - week 13 Multiple Regression Miscellaneous Topics.
Experimental Statistics - week 9
1 Experimental Statistics - week 8 Chapter 17: Mixed Models Chapter 18: Repeated Measures.
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.
1 Experimental Statistics - week 11 Chapter 11: Linear Regression and Correlation.
1 Experimental Statistics - week 5 Chapter 9: Multiple Comparisons Chapter 15: Randomized Complete Block Design (15.3)
Introduction to ANOVA.
Experimental Statistics - Week 4 (Lab)
Introduction to SAS Essentials Mastering SAS for Data Analytics
Experimental Statistics - week 8
Presentation transcript:

1 Experimental Statistics - week 4 Chapter 8: 1-factor ANOVA models Using SAS

2 EXAM SCHEDULE: Exam I – Take-home exam (handed out Thursday, March 3, due 8:00 AM Tuesday, March 8) Exam II – Take-home exam (handed out Thursday, April 14, due 8:00 AM Tuesday, April 19) Final Exam – optional (scheduled for 8:00 AM – 11:00 AM Friday, May 6) GRADE COMPUTATION: Exam Grades (75%) Daily Assignments (25%)

3 ANOVA Table Output - hostility data - calculations done in class Source SS df MS F p-value Between <.001 samples Within samples Totals

4 SPSS ANOVA Table for Hostility Data

5 ANOVA Models Consider the random sample Population has mean . Note: Example:

6 For 1-factor ANOVA

7 Alternative form of the 1-Factor ANOVA Model General Form of Model: (pages ) - random errors follow a Normal ( N) distribution, are independently distributed ( ID ), and have zero mean and constant variance -- i.e. variability does not change from group to group

8

9 Analysis of Variance Table Recall: In our model:

Introduction to SAS Programming Language

11 Recall CAR DATA For this analysis, 5 gasoline types (A - E) were to be tested. Twenty cars were selected for testing and were assigned randomly to the groups (i.e. the gasoline types). Thus, in the analysis, each gasoline type was tested on 4 cars. A performance-based octane reading was obtained for each car, and the question is whether the gasolines differ with respect to this octane reading. A B C D E

12 The CAR data set as SAS needs to see it: A 91.7 A 91.2 A 90.9 A 90.6 B 91.7 B 91.9 B 90.9 C 92.4 C 91.2 C 91.6 C 91.0 D 91.8 D 92.2 D 92.0 D 91.4 E 93.1 E 92.9 E 92.4

13 Case 1: Data within SAS FILE : DATA one; INPUT gas$ octane; DATALINES; A 91.7 A E 92.4 ; PROC GLM; (or ANOVA) CLASS gas; MODEL octane=gas; TITLE 'Gasoline Example - Completely Randomized Design'; MEANS gas/duncans; RUN; PROC MEANS mean var; RUN; PROC MEANS mean var; class gas; RUN; SAS file for CAR data

14 Brief Discussion of Components of the SAS File: DATA Step DATA STATEMENT - the first DATA statement names the data set whose variables are defined in the INPUT statement -- in the above, we create data set 'one' INPUT STATEMENT - 2 forms 1. Freefield - can be used when data values are separated by 1 or more blanks INPUT NAME $ AGE SEX $ SCORE; ($ indicates character variable) 2. Formatted - data occur in fixed columns INPUT NAME $ 1-20 AGE SEX $ 26 SCORE 28-30; DATALINES STATEMENT - used to indicate that the next records in the file contain the actual data and the semicolon after the data indicates the end of the data itself

15 SPECIFYING THE ANALYSIS SPECIFYING THE ANALYSIS -- PROC STATEMENTS GENERAL FORM PROC xxxxx; implies procedure is to be run on most recently created data set PROC xxxxx DATA = data set name; Note: I did not have to specify DATA=one in the above example Example PROCs: PROC REG - regression analysis PROC ANOVA - analysis of variance PROC GLM - general linear model PROC MEANS - basic statistics, t-test for H 0 :  PROC PLOT - plotting PROC TTEST - t-tests PROC UNIVARIATE - descriptive stats, box-plots, etc. PROC BOXPLOT - boxplots

16 PROC GLM Proc GLM data = fn ; –Class … ;  List all the factors. –Model … / options;  e.g., model octane = gas; –Means … / options; –Run;

17 SAS Syntax MUSTEvery command MUST end with a semicolon –Commands can continue over two or more lines Variable names are 1-8 characters (letters and numerals, beginning with a letter or underscore), but no blanks or special characters –Note: values for character variables can exceed 8 characters Comments –Begin with *, end with ;

18 Titles and Labels TITLE ‘…’ ; –Up to 10 title lines: TITLE ‘include your title here’; –Can be placed in Data Steps or Procs LABEL name = ‘…’ ; –Can be in a DATA STEP or PROC PRINT –Include ALL labels, then a single ; Note: For class assignments, place descriptive titles and labels on the output. Print the data to the output file.

19 Case 2: Data in an External File FILENAME f1 ‘complete directory/file specification’; FILENAME f1 ‘a:car.data'; DATA one; INFILE f1; INPUT gas$ octane; PROC GLM; (or ANOVA) CLASS gas; MODEL octane=gas; TITLE 'Gasoline Example - Completely Randomized Design'; RUN; PROC MEANS mean var; RUN; PROC MEANS mean var; class gas; run;

20 The SAS Output for CAR data: Gasoline Example - Completely Randomized Design General Linear Models Procedure Dependent Variable: OCTANE Sum of Mean Source DF Squares Square F Value Pr > F Model Error Corrected Total R-Square C.V. Root MSE OCTANE Mean Source DF Type I SS Mean Square F Value Pr > F GAS Source DF Type III SS Mean Square F Value Pr > F GAS

21 Text Format for ANOVA Table Output - car data Source SS df MS F p-value Between samples Within samples Totals

22 PC SAS on Campus Library BIC Student Center SAS Learning Edition $125

23 1. Calculate the average, standard deviation, minimum, and maximum for the 20 octane readings. CS pp Graph a histogram of OCTANE. CS pp Calculate descriptive statistics in (1) above for OCTANE for each of the 5 gasolines. CS pp A and B. CS pp “Lab” Assignment Using CAR Data, run the following in this order with one set of code: 5. Plot side-by-side box plots for OCTANE for the 5 levels of the variable GAS 6. Compute a 1-factor ANOVA for the CAR data using only the first 3 GAS types. CS pp