You are on page 1of 5

Simple

Regression
Osa Rafshodia
with a simple linear regression model with one continuous variable predicting a continuous outcome

F a k u l t a s K e d o k t e r a n U n i v e r s i t a s M u l a w a r m a n 2 0 1 3

Continuous predictors: Linear ................................................................................. 3 Chapter overview ............................................................................................................................................... 3 Simple Linear Regression ............................................................................................................................... 3 Multiple regression ............................................................................................................................................ 4 Graphing ................................................................................................................................................................. 5 Checking for nonlinearity graphically ...................................................................................................... 5 1. Examining scatterplot of predictor and outcome ........................................................................... 5 2. Checking for nonlinearity using residuals .......................................................................................... 5 3. Checking for nonlinearity using locally weighted smoother ..................................................... 5 4. Graphing outcome mean at each level of predictor ....................................................................... 5

Continuous predictors: Linear

Chapter overview

By : dr. Osa Rafshodia Rafidin, MSc.IH, MPH This chapter focuses on how to interpret the coefficient of a continuous predictor in a linear regression model. This chapter begins with a simple linear regression model with one continuous variable predicting a continuous outcome. Terminology: Continuous and categorical variables When I use the term continuous variable, I am referring to a variable that is measured on an interval or ratio scale. By contrast, when I speak of a categorical (or factor) variable, I am referring to either a nominal variable or an ordinal/interval/ratio variable that we wish to treat as though it were a nominal variable

Simple Linear Regression

Lets focus only on males who were interviewed in 2008, and use the educational level of respondent as the outcome variable (tab educ, missing). Below we see a frequency distribution of this variable. We can see that the variable ranges from 0 years of education to 20 years of education. The missing value code .n indicates no answer. The dataset includes several variables that can be used as predictors of the respondents education, including the education of the respondents father, the education of the respondents mother, and the age of the respondent. (-- sum paeduc maeduc age). As we interpret the meaning of these education variables, lets assume that having 12 years of education corresponds to graduating high school and having 16 years of education corresponds to completing a four-year college degree. Lets run a simple regression model in which we predict the education of the respondent from the education of the respondents father. (-- regress educ paeduc). educ = 9.74 + 0.36paeduc The intercept is 9.74 and the coefficient for paeduc is 0.36. The intercept is the predicted mean of the respondents education when the fathers education is 0. For every one-year increase in the education of the father, we would predict that the education of the respondent increases by 0.36 years. We could use the regression equation to compute the predicted mean of the respondents education for any given level of the fathers education. For example, if the father had 8 years of education.. (-- margins, at(paeduc=8).. margins, at(paeduc=(8 12 16)) vsquish

Multiple regression