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

74 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 in this section we'll deal the accounting the uncertainty in

Â the estimates we get, the slope and intercept for

Â logistic regression model when we estimate from a sample from some larger population.

Â So, I don't think there will be an surprises in this lecture, but

Â what were going to show how to do is create 95% confident intervals mainly from

Â slopes from logistic regression.

Â Because we can convert those to slopes.

Â 95% confidence intervals for the corresponding odds ratios, but

Â we can also do it for intercepts.

Â And convert these to 95% confidence intervals for

Â the odds of having the binary outcome in those whose x1 value is 0.

Â We're also showing how to estimate p-values for testing the null of no

Â association between the risk of the binary outcome and at the predictor x1.

Â In terms of the slope that would be the null that the slope is 0.

Â This corresponds is equivalent to the null that the exponentiated slope is 1.

Â Or in other words, the odds ratio of the binary outcome for

Â two groups who differ by 1 unit next 1 is 1 indicating no association.

Â So the last two sections we show the results from

Â several simple logistic regression models.

Â For example, the relationship between breastfeeding and child sex estimated

Â from a random sample of 236 Nepalese children between 0 and 36 months old

Â was given by the following equation, x1 is for males and 0 for females.

Â And we saw a very slight increase in the log odds and

Â hence log odds ratio of being breast fed for males relative to females.

Â But how is this estimated?

Â Well, it's no surprise that I used a computer to do this.

Â But what is the algorithm the computer uses to estimate this equation?

Â There must be some algorithm that will always yield the same results for

Â the same sample of data.

Â So for logistic regression this approach is called maximum likelihood.

Â Actually, the approach we use for linear regression of these squares is

Â a version of maximum likelihood applied to linear regression estimation.

Â But what maximum likelihood means is that the resulting estimates we get for

Â both the intercept and the slope are the values that make our

Â observed sample data most likely among all choices for the intercept and slope.

Â So the computer iterates choices for beta not hat and

Â beta 1 evaluates how likely our sample results are given those choices and

Â iterates until it can't make the likelihood any larger.

Â And it finds the values that maximize it and

Â those are the presented values for beta naught and beta one-hats.

Â This has to be done by the computer and

Â can be computationally intense under circum, certain circumstances.

Â So the values chosen for beta naught-hat and beta one-hat are just

Â estimates based on the single sample from a larger population.

Â Suppose by chance, we had gotten a different random sample of

Â 236 children from the same population of children 0 to 36 month olds.

Â Well, the resulting estimates we would get from the second sample would likely be

Â different just by chance than the estimates for beta naught-hat and

Â beta one-hat when we just looked at in our original sample.

Â So is such, there is potential for

Â readability in our estimates from sample to sample and all regression coefficients

Â have an estimated standard error that estimates that potential variability.

Â And this can be used coupled with their estimates to make statements about

Â the true relationship for example between the log odds of our outcome and x1.

Â For example, the true underlying population slope and

Â we can do this based on the results of a single sample.

Â So let's go and look at the estimated regression equation.

Â This is the estimated regression equation for

Â the relationship between breastfeeding and sex of a child estimated from

Â a random sample of 236 Nepali children less than 36 months old.

Â And these are the numbers we just looked at.

Â But the computer not only gave me the slope and

Â intercept estimates, it gives an associated standard error for each one.

Â And it turns out just in, this is probably no surprised,

Â because let's think of the slope for a moment that estimates a log odds ratio.

Â We already discussed back in statistical reasoning one how the distribution of

Â ratios from sample to sample is not necessarily normal, but

Â their log values are normally distributed.

Â So you may recall we had to do our confidence interval estimation for

Â log, for odds ratios and log scale.

Â And since our slope is a log odds ratio we can do

Â the imprints right on the slope scale.

Â So what we're going to do is use the same old logic.

Â If we looked at the distribution of the slopes the log odds ratios from

Â multiple random samples of the same size and

Â did a histogram, they'd be roughly normally distributed.

Â There'd be some variability, but

Â on average they'd equal the true underlying population slope.

Â So, let's look at the results for relating arm circumference to sex.

Â So the estimated slope was 0.002 with the standard error estimate the slope from

Â a computer is 0.03.

Â We want to create a 95% confidence interval for the slope.

Â We take our estimate plus or minus 2 standard errors.

Â And it gives us a 95% confidence interval from negative 0.598 to positive 0.602.

Â So this interval for the slope includes the null value for

Â the log odds ratio of 0.

Â If you wanted to get the corresponding confidence interval for

Â the odds ratio associated with breastfeeding for males to females,

Â we could take the endpoints of the slope and exponentiate them.

Â And if we do so we take e to the negative

Â 0.598 and e to the 0.602.

Â We get an interval approximately equal to 0.55 up to 1.83.

Â So our interval for the log odds ratio included the null value in

Â that scale of 0 and the interval for the odds ratio includes 1.

Â So this says after accounting for the uncertain year estimates,

Â the true difference in odds being breast fed between males and

Â females in this population could be that hutched males have anywhere from

Â 0.55 times the odds of females to 1.83 times the odds.

Â Anywhere from 45% reduced odds up to 83% greater odds than females.

Â So there's no clear consensus here as to, you know, what the nature of

Â the association is and we cannot rule out the null of no association.

Â So these results indicate that we did not find a statistically significant

Â association between breastfeeding and sex in this population.

Â When we want to get a p-value, the p-value for testing the null that

Â the slope is 0 versus the null alternative, but it's not 0.

Â Or in other words, that the odds ratio is 1 versus not 1.

Â Well, this is business as usual.

Â We do it on the slope scale.

Â We assume the null is true that the true, that our data comes from

Â a population where the true slope or log odds ratio is 0.

Â We measure how far our result is in standard errors.

Â We get a result that's 0.01 standard errors above what we'd expect,

Â very close to it.

Â We already knew the p-value for this test would be

Â greater than 0.05 given our previous intervals, but we actually looked this up.

Â P-value is very large at 0.997.

Â So again, we fail to find a statistically significant association after

Â accounting for the uncertainty in our data.

Â So we wanted to summarize this findings in a paragraph.

Â As if we were running a result section for an abstract, for example.

Â Might say, something like logistic regression was used to

Â estimate the relationship between breastfeeding and sex of the child using

Â data from a random sample of 236 Nepalese children 0 to 36 months old.

Â The results show no substantive, now this is my interpretation,

Â because the estimated odds ratio in the sample was essentially 1,

Â or statistically significant association breastfeeding status and sex.

Â And so I report the odds ratio, the estimate we got from the sample.

Â Rounding to two decimals of 1.00 with a confidence interval that we

Â just computed 0.55 to 1.83.

Â So there's the long honest ratio and

Â the computations are necessary to do the interval only ratio scale.

Â But we would ultimately present things on the ratio scale.

Â How about the risk of obesity in HDL cholesterol levels that we

Â estimated from Anne Haynes data?

Â We called the result look like this.

Â The estimated intercept was negative 0.005,

Â negative 0.05, estimated slope was negative 0.033.

Â The computer will give me estimated standard errors for

Â each of these quantities, so

Â we could go ahead and create a confidence interval for this slope, for example.

Â So if we did that, we take our estimate negative 0.033.

Â Add and subtract two estimated standard errors of 0.003.

Â And if you do this now,

Â we get an estimate of negative

Â 0.039, negative 0.027.

Â Now we can parlay this into an estimate for the odds ratio confidence interval,

Â and just to remind you the estimated odds ratio is actually equal to 0.967.

Â I rounded it in the previous set of lectures to 0.97,

Â because this confidence interval we'll see is very tight from the observation scale.

Â I'm going to represent it here with, to three decimal places.

Â So if we actually get the 95% confidence interval for

Â the population level odds ratio of obesity per 1 unit change in

Â HDL cholesterol levels, we'd exponentiate these endpoints up here.

Â If you have to take e with a negative 0.039, you get 0.9 roughly 0.96.

Â And if you take e to the negative 0.027, you get roughly 0.97.

Â This is between those two,

Â but not perfectly symmetric because we're on the ratio scale.

Â So this is a very type confident sort of rule indicating that after accounting for

Â the uncertainty in our sample based estimates.

Â The estimated association between obesity and HDL cholesterol level in

Â the population is on the order of anywhere from a 3% to 4% decrease in

Â the odds of obesity per unit, milligram per deciliter increase in HDL.

Â Suppose we wanted to do this for

Â a comparison of groups who differed by more than 1 unit of HDL cholesterol level.

Â Well, we could do this in several different ways.

Â The perhaps the easiest way to do it would be do it on the slope scale.

Â We know that a difference now in 20 units of x1 results in a,

Â because 100 minus 80 is 20, results in a 20 unit difference in the slope.

Â We've seen this many times by now.

Â And so the estimated difference in the log odds of obesity for these two groups

Â is 20 times the slope, which estimates the log odds ratio for a 1 unit difference.

Â If you do this, it's equal to 20 times

Â negative 0.033 or negative 0.66.

Â We exponentiate that our estimated odds ratio.

Â If we exponentiate, then it's 0.52.

Â So this, this decrease compounds relatively quickly.

Â And we'd say, those with 100 milligrams per deciliter have nearly half the odds of

Â obesity compared to those with 80 milligrams per deciliter.

Â But this is just a slope based on our sample.

Â So to get confidence interval for a multiple of the intercept all we have

Â to do is take the intercept end points and multiply them by the confidence interval,

Â multiply them by this difference in the two groups we're comparing.

Â So we take 20 times the lower end point we just computed for

Â the confidence interval for the slope.

Â And we take 20 times the upper interval we just computed.

Â And I'll let you verify this.

Â But if you then exponentiate, exponentiate to get the confidence

Â interval on a ratio scale it becomes 0.46 to 0.58.

Â So after accounting for the uncertainty in our estimate for

Â the odds ratio of this comparison, we see that this 20 unit difference in

Â HDL cholesterol levels is associated with a decrease of anywhere from.

Â 42%.

Â To 54% at the population level.

Â We got one more example.

Â Respiratory failure and gestational age.

Â Remember, this is where we had an ordinal but categorical variable.

Â Our reference group, the one whose x1 values were equal to 0,

Â were children who were 37 plus weeks in gestational age.

Â And x1 for example is an indicator of being 34 weeks.

Â So let's just take that on for a minute.

Â Let's first, we haven't done this yet, but

Â we can easily do it estimate the confidence interval for the intercept.

Â This estimate's, in this case,

Â is it's a real useful quantity applicable to our dataset.

Â It's the log odds of respiratory failure for children who are full term or

Â 37 plus weeks, because that's our reference.

Â All x-values are 0 for that group.

Â If we do that and standard error is equal to 0.039.

Â So if we take negative 5.5 plus or

Â minus 2 times 0.039 we get

Â an interval that goes from negative 5.58.

Â Roughly speaking, after rounding to negative 5.42.

Â Certainly, this does not include our null value of 0 on this scale.

Â If we exponentiate these end points, we get an interval from 0.0038 to 0.0044.

Â This is the confidence interval, not for a ratio because there's no comparison here.

Â This estimates the confidence interval for the odds.

Â The odds in this group.

Â The estimated odds I should have stated e to the negative 5.5 is 0.004.

Â So we estimate very low odds and that would translate into very low probability,

Â which we'll see in the next section a respiratory failure for

Â full term for children.

Â And after we account for the uncertainty, we see that it's relatively

Â tight on the odds scale and all the possibilities show a low odds.

Â if we wanted to get an odds ratio for the comparison of relative odds for

Â respiratory failure for those most premature in our data set that was

Â with the gestational age of 34 weeks compared to this reference group.

Â Well, we have the estimated log odds ratio of 3.4.

Â We add and subtract 2 estimated standard errors.

Â If we do the math, we get a confidence interval here on the log odds ratio or

Â slope scale, 3.27 to 3.53.

Â Now, the estimated odds ratio we got was approximately 30.

Â If we actually exponentiate the endpoints to get a 95% confidence interval,

Â the odds ratio of the endpoints of our confidence interval for

Â the slope goes from 26.3 to 34.1.

Â So it's pretty convincing even after accounting for

Â the uncertainty in our data that being premature at 34 weeks is highly

Â associated with respiratory failure as compared with children who are full term.

Â It's a strong risk factor.

Â How would we get the p-value for the slope if we wanted to test?

Â We already know that the confidence interval for the odds ratio of

Â the slope did not include 1, was way off from 1 as a matter of fact.

Â But if we wanted to get a p-value, to get the exact p-value we,

Â instead of just comparing it to 0.05, we need to do this computation.

Â We measure how far our result was from the log odds ratio.

Â We'd expect it to null 0 in terms of standard errors.

Â If you do this, we get a test statistic.

Â We get a distance measure of 51.2.

Â Our result is more than 51 standard errors above what we'd expect.

Â If there were no association between low gestational age and

Â increased or decreased respiratory failure risk compared to full-term infants.

Â So I don't have to tell you that this p-value is very, very small.

Â So in summary, it, it's business as usual.

Â In 95% confidence intervals for the slopes and

Â intercepts can be found by generically taking our beta,

Â whatever it is naught or 1, and adding or subtracting 2 standard errors.

Â These results can be exponentiated to get confidence

Â intervals on the odds ratio and odds scales.

Â And if we want to test whether the odds ratio we're estimating with

Â the slope exponentiated is different than one.

Â It's business as usual, as well.

Â We measure how far our log odds ratio estimate is from 0 in terms of

Â standard errors and get a p-value based on that.

Â In the next section, we'll look at how to translate the results from logistic

Â regression into risks and probabilities under allowable study designs.

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