Categorical Independent Variables STA302 Fall 2013.

Slides:



Advertisements
Similar presentations
Qualitative predictor variables
Advertisements

STA305 Spring 2014 This started with excerpts from STA2101f13
Regression and correlation methods
1 1 Chapter 5: Multiple Regression 5.1 Fitting a Multiple Regression Model 5.2 Fitting a Multiple Regression Model with Interactions 5.3 Generating and.
C 3.7 Use the data in MEAP93.RAW to answer this question
Factorial ANOVA More than one categorical explanatory variable.
Introduction to Regression with Measurement Error STA431: Spring 2015.
Chapter 14, part D Statistical Significance. IV. Model Assumptions The error term is a normally distributed random variable and The variance of  is constant.
Lecture 28 Categorical variables: –Review of slides from lecture 27 (reprint of lecture 27 categorical variables slides with typos corrected) –Practice.
Inference for Regression
Regression Part II One-factor ANOVA Another dummy variable coding scheme Contrasts Multiple comparisons Interactions.
Logistic Regression STA302 F 2014 See last slide for copyright information 1.
January 6, afternoon session 1 Statistics Micro Mini Multiple Regression January 5-9, 2008 Beth Ayers.
Final Review Session.
Treatment Effects: What works for Whom? Spyros Konstantopoulos Michigan State University.
Stat 112: Lecture 18 Notes Chapter 7.1: Using and Interpreting Indicator Variables. Visualizing polynomial regressions in multiple regression Review Problem.
Introduction to Regression with Measurement Error STA431: Spring 2013.
Summary of Quantitative Analysis Neuman and Robson Ch. 11
Leedy and Ormrod Ch. 11 Gray Ch. 14
Active Learning Lecture Slides
Normal Linear Model STA211/442 Fall Suggested Reading Davison’s Statistical Models, Chapter 8 The general mixed linear model is defined in Section.
Chapter 13: Inference in Regression
Normal Linear Model STA211/442 Fall Suggested Reading Faraway’s Linear Models with R, just start reading. Davison’s Statistical Models, Chapter.
Double Measurement Regression STA431: Spring 2013.
Maximum Likelihood See Davison Ch. 4 for background and a more thorough discussion. Sometimes.
Multiple Regression Analysis Multivariate Analysis.
Anthony Greene1 Correlation The Association Between Variables.
Introduction to Regression with Measurement Error STA302: Fall/Winter 2013.
Introduction To Biological Research. Step-by-step analysis of biological data The statistical analysis of a biological experiment may be broken down into.
OPIM 303-Lecture #8 Jose M. Cruz Assistant Professor.
Applications The General Linear Model. Transformations.
Regression Part II One-factor ANOVA Another dummy variable coding scheme Contrasts Multiple comparisons Interactions.
The Use of Dummy Variables. In the examples so far the independent variables are continuous numerical variables. Suppose that some of the independent.
● Final exam Wednesday, 6/10, 11:30-2:30. ● Bring your own blue books ● Closed book. Calculators and 2-page cheat sheet allowed. No cell phone/computer.
Analyzing Data: Comparing Means Chapter 8. Are there differences? One of the fundament questions of survey research is if there is a difference among.
Factorial ANOVA More than one categorical explanatory variable STA305 Spring 2014.
Logistic Regression STA2101/442 F 2014 See last slide for copyright information.
Copyright © 2011 Pearson Education, Inc. Analysis of Variance Chapter 26.
Regression Part II One-factor ANOVA Another dummy variable coding scheme Contrasts Multiple comparisons Interactions.
Lesson Multiple Regression Models. Objectives Obtain the correlation matrix Use technology to find a multiple regression equation Interpret the.
Copyright © 2013, 2009, and 2007, Pearson Education, Inc. Chapter 13 Multiple Regression Section 13.3 Using Multiple Regression to Make Inferences.
Multiple Regression BPS chapter 28 © 2006 W.H. Freeman and Company.
Political Science 30: Political Inquiry. Linear Regression II: Making Sense of Regression Results Interpreting SPSS regression output Coefficients for.
Inferential Statistics. The Logic of Inferential Statistics Makes inferences about a population from a sample Makes inferences about a population from.
Single-Factor Studies KNNL – Chapter 16. Single-Factor Models Independent Variable can be qualitative or quantitative If Quantitative, we typically assume.
Copyright © 2013, 2009, and 2007, Pearson Education, Inc. Chapter 14 Comparing Groups: Analysis of Variance Methods Section 14.3 Two-Way ANOVA.
STA302: Regression Analysis. Statistics Objective: To draw reasonable conclusions from noisy numerical data Entry point: Study relationships between variables.
28. Multiple regression The Practice of Statistics in the Life Sciences Second Edition.
General Linear Model.
Categorical Independent Variables STA302 Fall 2015.
STA302: Regression Analysis. Statistics Objective: To draw reasonable conclusions from noisy numerical data Entry point: Study relationships between variables.
© 2000 Prentice-Hall, Inc. Chap Chapter 10 Multiple Regression Models Business Statistics A First Course (2nd Edition)
Copyright © 2014, 2011 Pearson Education, Inc. 1 Chapter 26 Analysis of Variance.
The Sample Variation Method A way to select sample size This slide show is a free open source document. See the last slide for copyright information.
Logistic Regression For a binary response variable: 1=Yes, 0=No This slide show is a free open source document. See the last slide for copyright information.
Lecturer: Ing. Martina Hanová, PhD. Business Modeling.
Chapter 11 Analysis of Covariance
Logistic Regression STA2101/442 F 2017
Poisson Regression STA 2101/442 Fall 2017
Political Science 30: Political Inquiry
Interactions and Factorial ANOVA
Logistic Regression Part One
STA302: Regression Analysis
Multinomial Logit Models
Inferences About Means from Two Groups
CHAPTER 29: Multiple Regression*
Soc 3306a: ANOVA and Regression Models
Prepared by Lee Revere and John Large
Soc 3306a Lecture 11: Multivariate 4
Regression and Categorical Predictors
Presentation transcript:

Categorical Independent Variables STA302 Fall 2013

Categorical means unordered categories Like Field of Study: Humanities, Sciences, Social Sciences Could number them 1 2 3, but what would the regression coefficients mean? But you really want them in your regression model.

One Categorical Explanatory Variable X=1 means Drug, X=0 means Placebo Population mean is For patients getting the drug, mean response is For patients getting the placebo, mean response is

Sample regression coefficients for a binary explanatory variable X=1 means Drug, X=0 means Placebo Predicted response is For patients getting the drug, predicted response is For patients getting the placebo, predicted response is

Regression test of Same as an independent t-test Same as a oneway ANOVA with 2 categories Same t, same F, same p-value. Now extend to more than 2 categories

Drug A, Drug B, Placebo x 1 = 1 if Drug A, Zero otherwise x 2 = 1 if Drug B, Zero otherwise Fill in the table

Drug A, Drug B, Placebo x 1 = 1 if Drug A, Zero otherwise x 2 = 1 if Drug B, Zero otherwise Regression coefficients are contrasts with the category that has no indicator – the reference category

Indicator dummy variable coding with intercept Need p-1 indicators to represent a categorical explanatory variable with p categories. If you use p dummy variables, columns of the X matrix are linearly dependent. Regression coefficients are contrasts with the category that has no indicator. Call this the reference category.

Now add a quantitative variable (covariate) x 1 = Age x 2 = 1 if Drug A, Zero otherwise x 3 = 1 if Drug B, Zero otherwise

Covariates Of course there could be more than one Reduce MSE, make tests more sensitive If values of categorical IV are not randomly assigned, including relevant covariates could change the conclusions.

Interactions Interaction between independent variables means “It depends.” Relationship between one explanatory variable and the response variable depends on the value of the other explanatory variable. Can have – Quantitative by quantitative – Quantitative by categorical – Categorical by categorical

Quantitative by Quantitative For fixed x 2 Both slope and intercept depend on value of x 2 And for fixed x 1, slope and intercept relating x 2 to E(Y) depend on the value of x 1

Quantitative by Categorical One regression line for each category. Interaction means slopes are not equal Form a product of quantitative variable by each dummy variable for the categorical variable For example, three treatments and one covariate: x 1 is the covariate and x 2, x 3 are dummy variables

Make a table

What null hypothesis would you test for Equal slopes Comparing slopes for group one vs three Comparing slopes for group one vs two Equal regressions Interaction between group and x 1

General principle Interaction between A and B means – Relationship of A to Y depends on value of B – Relationship of B to Y depends on value of A The two statements are formally equivalent

What to do if H 0 : β 4 =β 5 =0 is rejected How do you test Group “controlling” for x 1 ? A reasonable choice is to set x 1 to its sample mean, and compare treatments at that point. How about setting x 1 to sample mean of the group (3 different values)? With random assignment to Group, all three means just estimate E(X 1 ), and the mean of all the x 1 values is a better estimate.

Copyright Information This slide show was prepared by Jerry Brunner, Department of Statistics, University of Toronto. It is licensed under a Creative Commons Attribution - ShareAlike 3.0 Unported License. Use any part of it as you like and share the result freely. These Powerpoint slides will be available from the course website: