Setting up group models Part 1 NITP, 2011

Similar documents
Analysis of Variance. Copyright 2014 Pearson Education, Inc.

Chapter 13. Factorial ANOVA. Patrick Mair 2015 Psych Factorial ANOVA 0 / 19

A few things to remember about ANOVA

Week 7 One-way ANOVA

Factorial Analysis of Variance

Legendre et al Appendices and Supplements, p. 1

Running head: DATA ANALYSIS AND INTERPRETATION 1

GLMM standardisation of the commercial abalone CPUE for Zones A-D over the period

Verification of Peening Intensity

ANOVA - Implementation.

y ) s x x )(y i (x i r = 1 n 1 s y Statistics Lecture 7 Exploring Data , y 2 ,y n (x 1 ),,(x n ),(x 2 ,y 1 How two variables vary together

Unit 4: Inference for numerical variables Lecture 3: ANOVA

Name May 3, 2007 Math Probability and Statistics

Introduction to Analysis of Variance (ANOVA) The Structural Model, The Summary Table, and the One- Way ANOVA

One-factor ANOVA by example

One-way ANOVA: round, narrow, wide

Lesson 14: Modeling Relationships with a Line

Announcements. % College graduate vs. % Hispanic in LA. % College educated vs. % Hispanic in LA. Problem Set 10 Due Wednesday.

REACTION RATES. The reaction rate is the progress of the reaction over time.

Empirical Example II of Chapter 7

Stats 2002: Probabilities for Wins and Losses of Online Gambling

Lab 11: Introduction to Linear Regression

Announcements. Lecture 19: Inference for SLR & Transformations. Online quiz 7 - commonly missed questions

Example 1: One Way ANOVA in MINITAB

PLANNED ORTHOGONAL CONTRASTS

Class 23: Chapter 14 & Nested ANOVA NOTES: NOTES: NOTES:

The Simple Linear Regression Model ECONOMETRICS (ECON 360) BEN VAN KAMMEN, PHD

LABORATORY EXERCISE 1 CONTROL VALVE CHARACTERISTICS

Stat 139 Homework 3 Solutions, Spring 2015

Manual for continuous distillation

11. Paragraphs (Same Font Size)

Taking Your Class for a Walk, Randomly

a) List and define all assumptions for multiple OLS regression. These are all listed in section 6.5

Select Boxplot -> Multiple Y's (simple) and select all variable names.

Statistical Analysis of PGA Tour Skill Rankings USGA Research and Test Center June 1, 2007

LESSON 5: THE BOUNCING BALL

Chapter 12 Practice Test

Simulating Major League Baseball Games

Design of Experiments Example: A Two-Way Split-Plot Experiment

Guide to Computing Minitab commands used in labs (mtbcode.out)

Factorial ANOVA Problems

MGB 203B Homework # LSD = 1 1

An Empirical Comparison of Regression Analysis Strategies with Discrete Ordinal Variables

N. Abid 2 and M. Idrissi 1 ABSTRACT

Robust specification testing in regression: the FRESET test and autocorrelated disturbances

Session 2: Introduction to Multilevel Modeling Using SPSS

Exploring the relationship between the pressure of the ball and coefficient of restitution.

100-Meter Dash Olympic Winning Times: Will Women Be As Fast As Men?

Citation for published version (APA): Canudas Romo, V. (2003). Decomposition Methods in Demography Groningen: s.n.

TRAFFIC CHARACTERISTICS. Unit I

Evaluation of Regression Approaches for Predicting Yellow Perch (Perca flavescens) Recreational Harvest in Ohio Waters of Lake Erie

Math SL Internal Assessment What is the relationship between free throw shooting percentage and 3 point shooting percentages?

Impulse Lab Write Up. K leigh Olsen. 6th hour

Unit4: Inferencefornumericaldata 4. ANOVA. Sta Spring Duke University, Department of Statistical Science

Unit 5: Prioritize and Manage Hazards and Risks STUDENT GUIDE

arxiv: v1 [stat.ap] 18 Nov 2018

2.5. All games and sports have specific rules and regulations. There are rules about. Play Ball! Absolute Value Equations and Inequalities

A N E X P L O R AT I O N W I T H N E W Y O R K C I T Y TA X I D ATA S E T

Navigate to the golf data folder and make it your working directory. Load the data by typing

Optimizing Vial Pressurization Parameters for the Analysis of <USP 467> Residual Solvents Using the 7697A Headspace Sampler

Section I: Multiple Choice Select the best answer for each problem.

A Combined Recruitment Index for Demersal Juvenile Cod in NAFO Divisions 3K and 3L

Objectives. Materials

Gerald D. Anderson. Education Technical Specialist

Draw a graph of the water level as a function of time for each of the following situations:

Saturated-Unsaturated Consolidation

Effect of homegrown players on professional sports teams

Sketch each type of footprint

Political Science 30: Political Inquiry Section 5

σ = force / surface area force act upon In the image above, the surface area would be (Face height) * (Face width).

ATION TITLE. Survey QC, Decision Making, and a Modest Proposal for Error Models. Marc Willerth, MagVAR

AP Physics 1 Summer Packet Review of Trigonometry used in Physics

Driv e accu racy. Green s in regul ation

100-Meter Dash Olympic Winning Times: Will Women Be As Fast As Men?

Supporting Online Material for

BIOL 101L: Principles of Biology Laboratory

Biostatistics & SAS programming

On the association of inrun velocity and jumping width in ski. jumping

STAT 155 Introductory Statistics. Lecture 2: Displaying Distributions with Graphs

Figure 1: A hockey puck travels to the right in three different cases.

Chem 110 General Principles of Chemistry

Practice Test Unit 6B/11A/11B: Probability and Logic

Copy of my report. Why am I giving this talk. Overview. State highway network

Exercise 8. Closed-Loop Pressure Control, Proportional-Plus-Integral Mode EXERCISE OBJECTIVE

ISyE 6414 Regression Analysis

ANOVA and its terminology Within and between subject designs Case study. supports moderately complex experimental designs and statistical analysis

Therapeutic Exercise Cage for Muscle Development

Habit Formation in Voting: Evidence from Rainy Elections Thomas Fujiwara, Kyle Meng, and Tom Vogl ONLINE APPENDIX

Lesson 22: Average Rate of Change

Lecture 22: Multiple Regression (Ordinary Least Squares -- OLS)

Statistical Method Certification, Coal Combustion Residuals Landfill, Reid Gardner Generating Station

Evaluating NBA Shooting Ability using Shot Location

USING DELTA-GAMMA GENERALIZED LINEAR MODELS TO STANDARDIZE CATCH RATES OF YELLOWFIN TUNA CAUGHT BY BRAZILIAN BAIT-BOATS

Special Acknowledgement: J. Richard Trout, Ph.D. (biostatistics)

Anabela Brandão and Doug S. Butterworth

MJA Rev 10/17/2011 1:53:00 PM

extraction of EG and DEG from the matrix. However, the addition of all diluent at once resulted in poor recoveries.

REAL LIFE GRAPHS M.K. HOME TUITION. Mathematics Revision Guides Level: GCSE Higher Tier

B31.3 Piping Checklist and Rules of Thumb March 1, 2008 Program Version Paulin Research Group s

Chapter 2: ANOVA and regression. Caroline Verhoeven

Transcription:

Setting up group models Part 1 NITP, 2011

What is coming up Crash course in setting up models 1-sample and 2-sample t-tests Paired t-tests ANOVA! Mean centering covariates Identifying rank deficient matrices

Recall GLM is flexible One Sample T Test ANOVA Two sample T Test Paired T test What do the models look like?

1-Sample T Test Overall mean

2-Sample T Test Mean group 1 Mean group 2

2-Sample T Test OR

Understanding a model If you re unsure about a model or the contrasts Plug in numbers Look at graphs (fmri data) Always ask yourself if your model is doing what you want it to

For example For the 2 sample T test Set Then G1=8 and G2=3 So is the mean of group 2 and is the difference between the groups What are the contrasts to test Mean of G2 Mean of G1 G1-G2

For example For the 2 sample T test Set Then G1=8 and G2=3 So is the mean of group 2 and is the difference between the groups What are the contrasts to test Mean of G2 Mean of G1 G1-G2

For example For the 2 sample T test Set Then G1=8 and G2=3 So is the mean of group 2 and is the difference between the groups What are the contrasts to test Mean of G2 Mean of G1 G1-G2

Paired T Test A common mistake is to use a 2-sample t test instead of a paired test Tire example Automobile Tire A Tire B 1 10.6 10.2 2 9.8 9.4 3 12.3 11.8 4 9.7 9.1 5 8.8 8.3 2-sample T test p=0.58 Paired T test p<0.001

Why so different?

Why so different? Mean A Mean B

Why so different? Difference is OK

Why so different? Residuals are HUGE!

Paired T Test Adjust for the mean of each pair

Paired T Test Mean A Mean B

Paired T Test Difference is same Residual variance much smaller

Paired T Test GLM Difference Mean of each pair

ANOVA 1-way ANOVA 2-way ANOVA B A

Modeling ANOVA with GLM Cell means model Model a mean for each cell B A

Modeling ANOVA with GLM Factor effects model Model each factor as a set of regressors One regressor for overall mean, other regressors describe how factor effects relate to the overall mean

Modeling ANOVA with GLM Factor effects model Model the overall mean and have regressors for each factor Hypothesis tests from this model correspond to standard ANOVA hypotheses Eg, if group (2 levels) and stimulus type (3 levels) are modeled you can test for a main group effect, main stimulus type effect and interaction effect

1 Way ANOVA - Cell Means

1 Way ANOVA - Cell Means

1 Way ANOVA - Cell Means

1 Way ANOVA - Cell Means

1 Way ANOVA factor effects Always start with overall mean (column of 1s) Number of regressors for a specific factor is number of levels 1 Why? If I know the mean of 4 numbers is 10, then I only need to know 3 of the numbers to figure out what the fourth is.

1 Way ANOVA factor effects Always start with overall mean (column of 1s) Number of regressors for a specific factor is number of levels 1 Why? If I know the sum of 4 numbers is 10, then I only need to know 3 of the numbers to figure out what the fourth is.

1 Way ANOVA - Factor Effects In general # of regressors for a factor = # levels-1 Factor with 4 levels

1 Way ANOVA - Factor Effects In general # of regressors for a factor = # levels-1 Factor with 4 levels Note: I m assuming a balanced design!!

1 Way ANOVA - Factor Effects mean

1 Way ANOVA - Factor Effects mean

1 Way ANOVA - Factor Effects Mean g1 Mean g2 Mean g3 Mean g4

1 Way ANOVA - Factor Effects Mean g1 Mean g2 Mean g3 Mean g4

1 Way ANOVA - Factor Effects Mean g1 Mean g2 Mean g3 Mean g4

1 Way ANOVA - Factor Effects Mean g1 Mean g2 Mean g3 Mean g4

1 Way ANOVA - Factor Effects Mean g1 Mean g2 Mean g3 2 3 Mean g4

1 Way ANOVA - Factor Effects mean Test main effect of factor A? c = 0 1 0 0 0 0 1 0 0 0 0 1

1 Way ANOVA - Factor Effects

1 Way ANOVA - Factor Effects

1 Way ANOVA - Factor Effects

1 Way ANOVA - Factor Effects

2 Way ANOVA (3x2)

2 Way ANOVA (3x2) B1 B2 A1 A2 A3 No effect means the marginals would be the same Null: A1=A2=A3 equivalently A1-A3=0 and A2-A3=0

2 Way ANOVA (3x2)

2 Way ANOVA (3x2)

2 Way ANOVA (3x2)

2 Way ANOVA (3x2) B1 B2 A1 A2 A3 No effect means the lines would be parallel

2 Way ANOVA (3x2) B1 B2 A1 A2 A3 No effect means the lines would be parallel A1B1-A1B2=A2B1-A2B2=A3B1-A3B2

2 Way ANOVA (3x2) B1 B2 A1 A2 A3 No effect means the lines would be parallel A1B1-A1B2-A3B1+A3B2 = A2B1-A2B2-A3B1+A3B2 = 0

2 Way ANOVA (3x2)

By the way If you feel confused by that last example, that was my goal!

2 Way ANOVA - Factor Effects Recall for factor effects, a factor with n levels has regressors set up like A has 3 levels, so 2 regressors B has 2 levels, so 1 regressor

2 Way ANOVA - Factor Effects A B AB

2 Way ANOVA - Factor Effects

2 Way ANOVA - Factor Effects

2 Way ANOVA - Factor Effects

2 Way ANOVA - Factor Effects

2 Way ANOVA - Factor Effects

2 Way ANOVA - Factor Effects

For more examples The FSL folks have a bunch of great examples http://www.fmrib.ox.ac.uk/fsl/feat5/detail.html Check the FSL help list regularly Subscribe at jiscmail Often others have already asked your questions!

Mean centering covariates Why do we mean center? When should we mean center? What does it do to the parameter estimate interpretation?

Single group with covariate You have a single group of subjects and you also have measured age. You would like to see if there is an age effect. What would the model look like? What contrasts would you specify for the age effect? Can you still obtain the overall mean from this model?

Use age Use demeaned age Both models will give exactly the same result for C2, but C1 will be different.

Simulated data

Summary of mean centering Only really necessary if you want your PE of column of 1s to be the overall mean Often people have rounding errors after demeaning. Double-check this when you do it.

Two groups with continuous covariate We have two groups and a confounding covariate (depression). Our primary interest is in the difference of means between the two groups. What is the model to simply test the difference in means If I wanted to make sure this difference wasn t due to between group differences in depression, what would that model look like? What are some restrictions of this model?

Do not demean the confounding measure within group This removes any confounding effect the measure might have

Why you shouldn t demean within group What if this is what your data look like? Difference in means is clearly due to range of X sampled, not the group membership

Will mean centering across all subjects change anything?

Will mean centering across all subjects change anything? Nope!

Testing the interaction Same as previous example, but you d like to know if the relationship with depression score differs between your groups What would the design matrix and contrasts look like?

Design matrix No mean centering!

What contrasts make sense? Do comparisons of means make any sense? What is interesting about a significant interaction?

Compare means with a significant interaction? For what value of depression is the difference in means interesting?

What is interesting when there s an interaction effect?

Mean centering when testing an interaction It doesn t make much sense Difference between means varies by continuous covariate when there s an interaction effect Testing the mean difference in general doesn t make sense Only interesting contrast tests difference in slope for continuous covariates between groups

Mean centering guide http://mumford.fmripower.org/mean_centering/

Important assumption That the effect tested is linear! Relationship between BOLD activation and depression score is linear for both groups If your continuous covariate is significantly different between your groups, you must be very careful with interpretation

When trends are linear, it doesn t matter where I sample age, I get the same slope

When trends are linear, it doesn t matter where I sample age, I get the same slope

When trends are linear, it doesn t matter where I sample age, I get the same slope

With a nonlinear trend, the trend may be the same in both groups, but sampling different ranges show different trends

With a nonlinear trend, the trend may be the same in both groups, but sampling different ranges show different trends

With a nonlinear trend, the trend may be the same in both groups, but sampling different ranges show different trends

Rank deficient designs I highly recommend becoming an expert on spotting rank deficient design matrices Don t email the FSL list to ask why you got the error message at least one EV is (close to) a linear combination of the others

Rank deficient designs I highly recommend becoming an expert on spotting rank deficient design matrices Don t email the FSL list to ask why you got the error message at least one EV is (close to) a linear combination of the others (the answer to the problem is in the error message!!)

Rank deficient One column is a linear combination of some of the other columns Linear combination of one set of columns equals a linear combination of another set of columns

Rank deficient

Rank deficient

Rank deficient?

Rank deficient?

That s it! Next lecture we ll look at more models. If you have a design that has you stumped, let me know what your data look like and we can all try to figure it out!