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

76 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

Module 1B: More Simple Regression Methods

In this model, more detail is given regarding Cox regression, and it's similarities and differences from the other two regression models from module 1A. The basic structure of the model is detailed, as well as its assumptions, and multiple examples are presented.

- John McGready, PhD, MSAssociate Scientist, Biostatistics

Bloomberg School of Public Health

So in this section,

Â we'll look at simple Cox regression with a continuous predictor.

Â And hopefully, by the end of this section, you'll be able to again interpret

Â the slopes from simple Cox regression as log hazard ratios.

Â But interpret the proper comparison being made when our predictor is continuous,

Â and similarly, interpret the exponentiated slopes as hazard ratios.

Â And we'll also talk about a process by which one can empirically assess

Â whether the relationship between the log hazard of the outcome and

Â a continuous predictor is linear, which is an assumption of the model.

Â We don't have similar visual assessments, like we did with linear and

Â logistic regression, to do this.

Â But there is a process by which we could compare the results from different

Â regression models, dealing with our continuous predictor as categorical

Â versus continuous, to look at this.

Â And the reason I showed this to you is because you'll sometimes see reference to

Â this type of process in the method sections of papers.

Â So let's look at our study from the 312 patients with the primary biliary

Â cirrhosis studied at the Mayo clinic.

Â And this study was a randomized clinical trial to look at the association between

Â treatment and mortality.

Â And patients were followed from their time of enrollment until death or censoring,

Â and the follow-up period was up to 12 years.

Â But at the time of enrollment,

Â some other measurements were taken on the patients as well.

Â And we could use these to look at their associations with mortality.

Â For example,

Â the patient's bilirubin level was measured at enrollment in milligrams per deciliter.

Â And we can look at the association between this as a marker for

Â progression of disease and mortality.

Â So here is the distribution of serum bilirubin levels in mg/dL in the sample,

Â here's a boxplot presentation.

Â We can see from this picture that this is right skewed data.

Â And it's further evidenced by the fact that the mean,

Â 3.3 mg/dL, is compared to the median of 1.4.

Â 25th percentile is 0.8 mg/dL, the 75th percentile is 3.5 mg/dL.

Â And the range for individual values in this data set runs from 0.3 mg/dL to 28.

Â So for the moment, let's assume the relationship between the log hazard and

Â bilirubin levels is linear.

Â And we're going to fit a Cox regression that looks like this.

Â We're going to estimate the log hazard of mortality given time t

Â as a function of some baseline log risk.

Â And this slope times the group,

Â we're looking at bilirubin levels in mg/dL,

Â so x1 is bilirubin in mg/dL.

Â And here's the result we get when we run this in the computer.

Â We get a positive association estimate, the slope is positive.

Â So increased log hazard of mortality with increased bilirubin,

Â which translates into increased mortality with increased bilirubin.

Â But how do we interpret this slope of 0.15?

Â Well, again, this is a slope that compares two groups who differ by one unit

Â in the predictor, compares them in terms of what they have on the left-hand side.

Â So beta 1 hat here, this 0.15, equals the difference in the log

Â hazard or risk of mortality at a given time

Â for two groups whose bilirubin differs by one unit, or 1 mg/dL.

Â So say log hazard of mortality at time t for

Â a group with bilirubin of b + 1, that's being generic,

Â minus the log hazard, Of mortality.

Â At the same time, a follow up period for a group whose bilirubin is just b.

Â So b + 1 and b differ by one unit.

Â There's just a generic representation, it could be 2 mg/dL versus 1,

Â 4 versus 3, 3.5 versus 2.5, etc.

Â So when all the dust settles, we know we can rewrite this as the log,

Â I won't write it out fully, but of the ratio of this hazard for

Â the group with the higher bilirubin to the lower where the difference is one unit.

Â So this is the log of a hazard ratio.

Â So if we wanted to get this to make sense to us,

Â give a number we can report in a journal article,

Â we could exponentiate this estimate to get the estimated hazard ratio.

Â And it would equal about 1.16.

Â So each 1 mg/dL increase in

Â bilirubin is associated with a 16% increase in mortality.

Â Or if we can compare the hazard of mortality at any point in the follow-up

Â period for two groups who differ by 1 mg/dL in their baseline bilirubin levels,

Â the group with the higher value would have 16% greater hazard of mortality.

Â What is this intercept piece?

Â Well, again, this estimates the log hazard of mortality for

Â a baseline, a reference group.

Â But in this situation where bilirubin is measured

Â on a continuous scale, this is technically the log

Â hazard at a given time when bilirubin is equal to 0.

Â So this is a sort of a fictional referent group,

Â because we don't have any subjects in our sample with 0 bilirubin,

Â and that's biologically not possible.

Â So this function over time doesn't track the risk for

Â any group in the population from which our sample is taken from.

Â But it provides a starting point at any given time for getting the log hazards for

Â other groups, given their bilirubin levels.

Â We start with this and add the appropriate multiple, 0.15,

Â depending on the group bilirubin level we're looking at to get the log hazard for

Â that specific group at that time.

Â So this is again like a placeholder that varies as a function of time.

Â So we can do other comparisons besides that given by the slope.

Â We could estimate, for example, the hazard ratio of mortality for

Â persons with bilirubin levels at the 75th percentile,

Â 3.5 mg/dL, versus those at the 25th percentile, 0.8 mg/dL.

Â So on our slope scale,

Â we know the slope estimates the difference in log hazard per 1 mg/dL.

Â This difference we're looking at is 3.8- 0.8, which is 2.7 mg/dL.

Â So we could take that difference per 1 unit and

Â multiply it by the total difference here of 2.7 on the slope scale.

Â And this gives us a difference in the log hazards of 0.405.

Â So if we exponentiate 0.405, we get our estimated hazard

Â ratio of mortality at any point in the follow-up period for

Â these two groups, and it's about 1.5.

Â So this 16% per mg/dL compounds across this 2.7 mg/dL

Â difference to give us an estimated 50% increase in the risk

Â of mortality at any given time in the follow-up period for

Â the group with starting bilirubin levels of 3.5 compared

Â to the group with starting bilirubin levels of 0.8 mg/dL.

Â So how can we assess?

Â We've fit that model.

Â We've stuck x1 in.

Â Bilirubin in forming a linear relationship between a log hazard and

Â this continuous predictor.

Â But how can we assess whether linearity assumption is reasonable?

Â Well, unlike with linear or logistic regression, there's no easy visual

Â tool like a scatterplot or lowess graph to help with assessment.

Â One thing we could do if we were analyzing these data though, is use what I call and

Â empirical approach.

Â We could take this continuous predictor,

Â categorize it into several groups, and see if the difference in the log

Â hazard between consecutive ordinal groups is similar.

Â So let me give you an example of what I mean.

Â Let's suppose I took bilirubin, which we initially measured on a continuous scale,

Â and I categorized it into four quartiles.

Â So, those between the minimum and

Â 25th percentile, bilirubin got into the first quartile.

Â Those between the 25th percentile and

Â the median were put in the second quartile, etc.

Â And then what I do is fit the model with the log hazard of mortality at any

Â given time.

Â And here, because it's been categorized, the reference group,

Â the starting log hazard is for those in quartile 1.

Â That's in the reference group,

Â then this is an indicator here of being in quartile 2 versus not.

Â And this is an indicator of being in quartile 3 versus not,

Â Etc., well, let's look at this.

Â So, if I look at the increase in the log hazard going from at any given

Â point time from the first quartile to the second, this jump is 1.3.

Â The difference in the log hazard between the second quartile

Â compared to that reference group is 1.3.

Â If I go from the reference group to the third quartile,

Â this jump is 2.2 which differs from the jump for the second quartile by 0.9.

Â So the increase in log hazard going from quartile 2 to quartile 3 is 0.9.

Â And then the increase going from quartile 3 to quartile 4,

Â it goes from 2.2 to 3.3 is 1.1.

Â So what I see here, these are estimates and

Â there's some sampling variability and etc.

Â But I see, and this is my opinion,

Â a relatively similar increase with ordinal increase in the quartiles.

Â That the log hazard of mortality increases by relatively similar amounts

Â with each increase in bilirubin quartile.

Â So that to me reinforces the assumption that the association is relatively linear.

Â That the increases with similar increases in the magnitude percentile wise,

Â we get similar increases in the log hazard on the order of one or

Â something, on the order of about one.

Â So, this reinforces to me that the linearity assumption may be reasonable and

Â there's some subjectivity in this.

Â But this would cause me to feel comfortable about the model we fit

Â previously where we had bilirubin as a continuous predictor.

Â And I would choose that model over this one because

Â I only had to estimate one measure of association, the single slope,

Â as opposed to the three separate quartile 2, quartile 3, and quartile 4 slopes.

Â So I could use all the data to estimate one slope as opposed to three and

Â get a more precise estimate.

Â Another nicely however of categorizing bilirubin into quartiles or

Â some of other arbitrary categorizations is at least for tissue purposes.

Â I can't display relationship in Kaplan-Meier curves when bilirubin

Â is continuous.

Â So if I group it into four quartiles,

Â I can at least show the time to mortality curves for the four different groups.

Â And you can see pretty clearly that the lowest quartile bilirubin has

Â the highest survival curve and in order, followed by the second quartile,

Â The third quartile and the fourth.

Â So this, at least, establishes that ordinality that would

Â also be appropriate and necessary for the linearity assumption.

Â Let's look at another example, infant mortality and gestational age.

Â Here's the gestational age distribution for our sample of 10,295 Nepali newborns

Â who were followed for up to six months after birth to see about mortality.

Â So, this is a much more symmetric distribution in our

Â bilirubin measurements in the previous example.

Â The mean gestational age is 38 weeks, the median is also 38,

Â and the range in sample goes from 28 weeks to 46.

Â So let's just for the moment assume that the relationship between the log hazard of

Â mortality at any given time and gestational age is linear.

Â And we're going to fit a model that looks like this,

Â the log hazard of mortality at any given time t is equal to some starting log

Â hazard plus a slope times the gestational age for the group we're looking at.

Â If we do this, we actually end up with the slope estimate of -0.13.

Â So what is this compared?

Â Well this is, I'm going to not write it out fully for this example.

Â But this is a log of the hazard ratio of mortality at any point in the follow

Â up period for two groups who differ by one week in gestational age.

Â And the group with the longer gestational age has lower log hazard of mortality.

Â So, if we exponentiate this to get our estimated hazard ratio.

Â It's equal to about 0.88.

Â So this suggests that each additional week of gestational age is associated

Â with a 12% decrease in mortality in the six-month follow up period.

Â What is the relative hazard of mortality, for example, for

Â babies born at 40 weeks compared to babies born at 34 weeks?

Â Well based on this linearity assumption with this estimated slope, to get

Â this difference in a log hazard scale, we take the difference in x which would be 6.

Â (40- 34) times our slope of -0.13 to give

Â a difference in log hazards or log hazard ratio of -0.78.

Â If we exponentiate this,

Â we get the hazard ratio, it's 0.46.

Â So this difference, 40 week gestational age to 34 weeks is associated

Â with a 54% reduction in mortality in the six months following birth.

Â There's a pretty large association between reduce to mortality and

Â longer gestational age.

Â So how can we assess whether your linearity assumption is reasonable?

Â Well again, there's no easy visual tool to look at, so

Â we'll try first this empirical approach.

Â So what I did was categorize gestational age into five categories.

Â I did pre-term, less than 36 weeks, and

Â I'm going to use that as the reference to compare the other four groups too.

Â And then I made categories 36 to 38 weeks, 38 to 39 weeks,

Â 39 to 41 weeks, and then 41 plus weeks.

Â Since we had five categories, I made four indicator variables And

Â this just shows the respective values for each of these categories.

Â The preterm group,

Â the reference group, takes on a value of 0 for all four indicators.

Â x1 is an indicator of being in the 36 to 38 week group.

Â So x1 is a 1 for that group and the other xs are 0s.

Â And similarly, the rest of the table plays out for

Â showing that each of these is the indicator for yet

Â another one of those four non pre-term groups.

Â So, we do this, and we actually look at the association,

Â estimate this with the computer,

Â we get that the ln(Hazard of mortality at time t) is equal to starting point.

Â And this, because we've categorized, is going to be the log hazard for

Â the reference group, the less than 36 week gestational age group, at any given time.

Â This is going to estimate the difference between those who are 36 to 38 weeks and

Â that reference of 36 weeks.

Â This is going to be the 38 to 39 week group,

Â the 39 to 41 group, and the 41 plus weeks group.

Â So, what do you see here?

Â Well, as we go from pre-term to full term at 36 weeks,

Â the 36 to 38 week group has a lower log hazard by about

Â 0.88 relative to the reference of less than 36 weeks.

Â But then if we look at the subsequent groups, they have,

Â A greater reduction, but not by much.

Â And across these three groups,

Â the reduction relative to that reference group of 36 weeks is similar.

Â So I get the sense here that maybe the relationship isn't linear.

Â It maybe is more of a pretty big drop-off in the risk for

Â log risks, going from pre-term to full term.

Â So what I am seeing with these numbers is,

Â if we're looking at less than 36 weeks versus these other categories.

Â And this is the log hazard scale here,

Â what we see is just this drops off really quickly and then sort of stabilizes.

Â So before, we were estimating sort of a linear function to this.

Â We were interpolating across that entire shape.

Â And we'd missed the sort of

Â big jump initially going from pre-term to full term.

Â And so in order to capture sort of the richness in what we're seeing here,

Â I would suggest going with a model like this, as opposed to the previous model.

Â Because it's going to underestimate the decrease

Â in mortality early in the gestational age scale and overestimate it later.

Â So I think that this categorization schema shows us

Â really that there's a big jump going from pre-term to full term and

Â then slightly greater reduction going up to 38 weeks, relative to 36 to 38.

Â And it's not strictly linear.

Â If we look at the Kappa Meyer curves for these five gestational age categories,

Â we see pretty clear evidence of this.

Â This is it on the full scale on the y axis, let me blow this up,

Â so that the y axis goes from 90% to 100.

Â We can see clearly that the group here, the less than 36 week group has much

Â greater risk and mortality over the follow up period visually.

Â This tracks the proportion that were still alive compared to these other groups.

Â And among these other groups, there is a little bit of a distinction between the 36

Â to 38 week groups and the other three.

Â But in general, I think the big picture in this data is that being

Â full term is very beneficial in terms of reducing mortality.

Â And so the relationship isn't decreasing across the entire gestational age

Â spectrum.

Â But there's this big jump from being pre-term to full term.

Â And so it's not strictly linear as a function of gestational age.

Â I mean, we may prefer to present it with that alternative representation,

Â treating gestational age as categorical.

Â So in general, slopes from simple Cox regressions with continuous predictor,

Â just like the other Cox regressions we looked at with binary and

Â categorical predictors, have a log hazard ratio interpretation.

Â And the slopes could be exponentiated to estimate hazard ratios.

Â The assumption of linearity between the log hazard and

Â the binary outcome and a continuous predictor x1 can be assessed empirically.

Â By comparing the results from Cox regressions with x1 modelled as continuous

Â versus where the continuous values are categorized into several ordinal groups.

Â And I want you to be aware of that.

Â We aren't doing the actual analyses ourselves in this class, but

Â you'll see reference to this type of thinking in the method sections of papers,

Â where Cox regression is used occasionally.

Â In the next section,

Â we'll talk about how to deal with the uncertainty in our estimates.

Â And it'll look pretty similar to what we did with linear and

Â logistic regression as well.

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