A practical and example filled tour of simple and multiple regression techniques (linear, logistic, and Cox PH) for estimation, adjustment and prediction.

Loading...

From the course by Johns Hopkins University

Statistical Reasoning for Public Health 2: Regression Methods

75 ratings

A practical and example filled tour of simple and multiple regression techniques (linear, logistic, and Cox PH) for estimation, adjustment and prediction.

From the lesson

Introduction and Module 1A: Simple Regression Methods

In this module, a unified structure for simple regression models will be presented, followed by detailed treatises and examples of both simple linear and logistic models.

- John McGready, PhD, MSAssociate Scientist, Biostatistics

Bloomberg School of Public Health

So just allow me to jump in quickly and

Â say, welcome back to Statistical Reasoning.

Â This is part two, and in this first lecture set of three lectures we're

Â going to discuss the basis for something that will permeate the entire course,

Â something called Regression Methods.

Â So onward and upward, I look forward to working with you this term and

Â let's have some fun with regression.

Â Greetings, and welcome to the first lecture in Statistical Reasoning Two.

Â In this first lecture set, we're going to give an overview of an umbrella method

Â called Simple Regression, just a generalized method for

Â relating an outcome of any type to a single predictor via linear equation.

Â And then for the remaining lecture sections,

Â we'll talk about a specific type of simple regression called Linear Regression.

Â So in this set of lectures, we will develop a framework in the first section,

Â section A, for linear, simple logistic, and

Â simple Cox Proportional Hazards Regression.

Â The remaining sections will focus on simple linear regression, which is

Â a general framework for estimating the mean of a continuous outcome

Â using a single predictor, which may be binary, categorical, or continuous.

Â So, let's first give an overview of simple regression regardless of

Â the type of regression.

Â So hopefully in this section, if you're rusty,

Â you'll be able to re-familiarize yourself with the properties of a linear equation.

Â And then identify the group comparisons being made by

Â a simple regression coefficient regardless of the outcome variable type,

Â whether it be continuous, binary, or time-to-event.

Â And by simple regression coefficient here,

Â I'm referring to a specific quality called the Regression Slope.

Â So, what we're going to be doing to start will provide an extension of

Â the framework we set up for estimation and testing from the first term.

Â All methods we covered in term one can be done as simple regression models.

Â But the beauty of regression is that it'll cover situations we were not able to do

Â with the models we looked at.

Â And regression models can be extended to allow for

Â analyses beyond the scope of what we did in the first term,

Â which was comparing outcomes across two or more levels of a single predictor.

Â We'll be able to extend regression, and we'll get into this in subsequent lectures

Â to include multiple predictors which will allow us not only to estimate adjusted

Â relationships, but also do better prediction of outcomes using more inputs.

Â So just to link what we've done in the past term to what we'll be doing here with

Â the simple regressions is, the comparing means we did between two or

Â more groups using the t-test or ANOVA approaches, and then the corresponding

Â ways to estimate competence intervals for the mean differences.

Â This can all be done via a simple linear regression model.

Â Comparing proportions between two or more groups, which we did with

Â the Chi-square approach, can be done via a simple logistic regression model.

Â And comparing incidence rates between two or more groups, which we did with

Â a log rank test, can be done by a simple Cox Proportional Hazards regression model.

Â So the basic structure of these regression models will be a linear equation.

Â We'll have something that we're trying to estimate, some function of our outcome.

Â Depending on what type it is.

Â And we're going to model that as a linear function of our predictor.

Â So the generic equation of a line with a single predictor

Â is an intercept value plus a slope, times the predictor value, the x value.

Â You may have fond memories from secondary school where you saw this written in

Â the form of mx plus b for example where b was what was called the Intercept.

Â And m was the slope of the variable x.

Â We're going to change the notation slightly.

Â In statistics we like to use Greek letters specifically betas, and we'll rewrite this

Â as beta not or beta zero plus beta one times our predictor, x1.

Â So beta not here plays the role of the intercept.

Â And beta one plays the role of m in the previous formula.

Â It's the slope.

Â And x1 represents our predictor of interest.

Â The left hand side, the thing I left purposely empty as a box,

Â depends on what variable the outcome type is.

Â So if our outcome,

Â we're trying to the model the outcome of a continuous variable.

Â What we can do with linear regression is estimate the mean for

Â continuous variable as a function, a linear function of our predictor X.

Â So we can estimate different mean estimates for different values of X.

Â For binary outcomes, we start with zero one variables.

Â And you may recall we summarize them as proportions, but

Â we could also write them as odds.

Â And what can actually, or what we actually need to do to get an appropriate linear

Â function is take an interesting transformation of the binary outcome and

Â turn it into the log odds.

Â And we'll detail this in lecture two, but this is just a heads up.

Â Where we'll write the log odds of our outcome as a linear function of our

Â predictor X.

Â And then for time-to-event outcomes, this black.

Â This empty box on the left-hand side is, will relate the log of

Â our hazard rate of our event to a linear function of our predictor of interest.

Â The right-hand side, for simple progression.

Â Simple just means that we have one predictor of interest.

Â This includes the predictor of interest, x1.

Â And we'll see in a moment, that sometimes we have one predictor of interest, but

Â may need more than one x to represent it.

Â And this predictor, x1, or some form of it, can be binary,

Â categorical or it can be allowed to be continuous.

Â Something we haven't experienced thus far in the course.

Â Thus allowing the grouping factor to be continuous.

Â So let's just, let's kind of get a sense of what the resulting equation gives us

Â under a couple different scenarios.

Â We are not going to specify what our left-hand side is yet.

Â We'll get into the specifics for each type of regression.

Â But suppose I have a binary predictor such as sex.

Â So, it only takes on two values so this equation is only predicting two

Â outcomes one for those who are coded one and one for those who are coded zero.

Â So, if I'm looking at a group of females from my sample,where x1 equals one.

Â This equation is going to predict whatever function of my outcome,

Â depending on the outcome type is going to be equal to the intercept plus beta 1,

Â the slope times 1.

Â So together the entire full prediction for females will be

Â the sum of these two qualities for males, where x1 equal 0.

Â The predicted values equal the intercept plus the slope times zero, so

Â the slope disappears.

Â So this intercept functionally gives us the estimated value of the outcome for

Â the males in this sample in order to get the same value.

Â But for females, we take the value for males the intercept and

Â add this slope of beta one.

Â So what beta one really quantifies is the difference in the outcome.

Â For females for those with x1 equals one compared to those with x1 equals 0.

Â So this slope compares those two groups.

Â Suppose we had a predictor where it was nominal categorical.

Â Took on more than two values and

Â they were not ordinal in nature, so it was more than binary.

Â So suppose we were getting data from three different clinics in

Â the United Sates; from Johns Hopkins, from the University of Maryland, and

Â from the University of Michigan.

Â And we wanted to see how our outcome differed between these

Â three different clinic sites.

Â How can we handle this in a regression framework and

Â represent uniquely these three groups?

Â Well, we only have one predictor which is clinic.

Â But we're going to need more than one x to do this.

Â And, the approach to do this generically, and again, we'll do this in detail or

Â specific examples.

Â But I just want to give you a sort of starting point,

Â is we designate one of the three groups as our reference category,

Â the thing we'll compare the other groups to.

Â And then we create binary xs for each of the other groups.

Â And this is pretty much, when we hit a binary indicator in the previous example.

Â We had females and males.

Â We only needed one x, but we designated males to be the reference group.

Â They were the group that the other group, females, would be compared to.

Â So, what we're going to do here is, if we designate Hopkins, the reference group,

Â then we're going to make one indicator which is a one.

Â If the subject is from University of Maryland,.

Â And x1 will be a zero if the subject

Â is not from the University of Maryland.

Â Similarly, we'll do another predictor x2.

Â And I won't write this out fully but you can.

Â Which will be a one if the subject is from the University of Michigan,

Â a zero if they are not from the University of Michigan.

Â So how is this going to play out?

Â The resulting equation will look like this.

Â And think about this, there's only three groups we're estimating an outcome for.

Â But we get this linear equation that perfectly uniquely identifies each of

Â the three groups in terms of what we estimate.

Â So let's start with the University of Michigan.

Â Suppose we have a subject from the University of Michigan.

Â Well, his value of x2 is equal to 1.

Â His value as x1 is equal to 0, since he or she is not from University of Maryland.

Â Their predicted outcome is the intercept plus beta1 times 0.

Â because x1 is 0.

Â Plus beta2 times x1.

Â So, they pick up this beta2.

Â If we are looking for subjects from the University of Maryland,

Â it is up here with Michigan, sorry for the abbreviation, Maryland,

Â we have got x 2 is equal to 0, because they are not from Michigan,

Â x 1 is equal to 1, and so this group's predicted value of the outcome

Â is the intercept plus the slope for the indicator of University of Maryland.

Â If they're from Hopkins, the reference group, then both of the x's

Â are equal to zero, and the predicted outcome is simply the intercept.

Â So this intercept estimates the outcome for the reference group.

Â And then the slope for X one compares those who are coded one for

Â X one relative to the reference group if you take the difference between Maryland

Â and Hopkins you get this slope for Maryland.

Â Those whose X one is one.

Â Similarly, the slope for X two compares those subjects from Michigan.

Â It's the difference between them relative to those subjects from Hopkins.

Â So they get the estimate for the subjects from Michigan based on starting with

Â the Hopkins estimate the intercept we'd have to add this slope for being a 1 on

Â that variable, which corresponds to being from University of Michigan.

Â Here's the beauty of regression, and

Â this is where we're start getting into new territory, is that it allows for

Â continuous predictors, unlike the methods we learned in Statistical Reasoning 1.

Â All the comparisons we did between groups and

Â Statistical Reasoning 1 were for two or more categories.

Â But, sometimes, it's efficient to handle measurements that are made continuously,

Â age, height, et cetera, without having to arbitrarily categorize them to

Â become a predictor, and we'll see that this is under certain assumptions.

Â If the outcome predictor association when the predictor is

Â continuous is well characterized by a line.

Â So we'll look at that assumption for the different methods we'll explore.

Â But suppose for the moment that our x1 variable is age in years.

Â Well, we might want to relate some outcome to age and

Â years, treating age and years as continuous.

Â So let's think about what we get here.

Â Well, what we're describing in space is in, this is our outcome called

Â the Box because we haven't specified what it is, scaling here the vertical axis.

Â And x here, our predictor age and years, is on the horizontal axis.

Â And this is the line formed by the equation where we say the outcome

Â equals beta-knot, the intercept plus beta-1 times x1 or x1 is years.

Â So, what does the intercept represent?

Â Well, this is the value of our outcome,

Â the left hand side, when x is 0, at 0 years.

Â It is the point on the graph where this line crosses the vertical axis,

Â at the coordinate x equals 0,

Â and y the vertical component is equal to the intercept.

Â The slope, what the slope measures is the change in

Â the left-hand side corresponding to a unit increase in our predictor x1.

Â So for every 1 unit increase in x1, our y value changes by beta one.

Â In this particular instance, beta one is positive, so Y increases by beta one but

Â where beta one negative, it would indicate that the vertical value, the outcome value

Â which I'm generically calling Y decreases for each one unit increase in X1.

Â So the slope beta one is the change on

Â the left-hand side corresponding to a unit increase in X1.

Â Another way to think about this is beta one quantifies the difference in whatever

Â we're predicting on the left-hand side for X1 plus one compared to x1.

Â In other words, the difference between two groups who differ by one unit and x.

Â And this change or difference is the same across the entire line.

Â This one number pretty much summarizes any comparison of the outcome we make for

Â our range of ages for whatever generic x we have.

Â So this change in left hand side quantifies and

Â applies anywhere on this line.

Â Now we'll see that, you know, this line theoretically goes on forever into space,

Â but we'll see in practice we'll have to limit our

Â interpretations of it to the x range we have in our data.

Â But anywhere in that x range, this slope quantifies the difference in the vertical,

Â or predicted value for a one unit difference in our predictor X

Â regardless of the two values of X we're comparing the different by one unit.

Â Alright.

Â All information about the difference in our outcome are the left-hand side for

Â two differing values of x one is contained in that slope.

Â So, for example if I was comparing the outcome for two values of X1, for example

Â h, which were three units apart, two groups who differed by three years of age.

Â Their difference in the outcome would be three times theta one.

Â Because theta one represents the difference in the outcome for

Â one unit difference in x1 or age.

Â And the two groups are comparing different by three units.

Â So this is what that would look like on our linear scale.

Â [noise] So again, this slope contains all the information

Â when x is continuous to make any comparisons between

Â any groups who differ by specified values in x's.

Â So we'll see some very specific examples and put some context to this,

Â interpreting it in scientific realm, starting in the next section.

Â But, to close out, regression is a general set of methods for

Â relating a function of an outcome variable to a predictor by a linear equation.

Â And regardless of what our outcome looks like, in terms

Â of what the intercept and slope represent, in terms of which groups they estimate for

Â and the group differences, that will be consistent,

Â whether we're doing linear logistic or Cox Proportional Hazards Regression.

Â So in the next section,

Â we'll jump right into some concrete examples using simple linear regression.

Â Coursera provides universal access to the worldâ€™s best education,
partnering with top universities and organizations to offer courses online.