Learn fundamental concepts in data analysis and statistical inference, focusing on one and two independent samples.

Loading...

From the course by Johns Hopkins University

Mathematical Biostatistics Boot Camp 2

41 ratings

Learn fundamental concepts in data analysis and statistical inference, focusing on one and two independent samples.

From the lesson

Two Binomials

In this module we'll be covering some methods for looking at two binomials. This includes the odds ratio, relative risk and risk difference. We'll discussing mostly confidence intervals in this module and will develop the delta method, the tool used to create these confidence intervals. After you've watched the videos and tried the homework, take a crack at the quiz!

- Brian Caffo, PhDProfessor, Biostatistics

Bloomberg School of Public Health

Okay, so last time we considered absolute changes in proportions.

Â But what about relative changes?

Â And as I said, relative changes are often of interest.

Â for example, when the proportions are small, you might have in,

Â in the example we were discussing earlier, a ten fold change.

Â In the exposed group contracting the disease

Â over the control group, the non exposed group.

Â but the absolute difference be quite, very small, less than a fraction of 1%.

Â And so in that case it's very natural

Â to consider relative amounts rather than absolute amounts.

Â The most obvious thing to do in the case of proportions is to define

Â the relative risk which is simply just one of the proportions divided by the other.

Â And then of course it doesn't matter which one you put in the numerator and

Â which one in, you put in the denominator as long as you remember what you did.

Â So and, and just to remind you, so

Â we have p1 and p2 population parameters defined here.

Â Because remember on the previous slide we actually

Â talked about a motto where our data IED

Â draws from a population.

Â There's other ways to think about this problem

Â but that's how we're going to think about it.

Â Okay, so the obvious estimator of the relative risk is the

Â estimated relative risk which is p1 hat divided by p2 hat.

Â Which of course is just x over n1 divided by y over n2.

Â and so the relative risk

Â is obviously there's an issue if, if y has zero counts right?

Â You're dividing by zero.

Â So that's potentially a problem.

Â But also if we want to create an asymptotic confidence interval

Â where we treat our data, our estimator as if it's normal.

Â There's a problem that this is of course bounded from below by zero.

Â And it turns out that the log relative

Â risk, the log estimated relative risk has much better

Â asymptotic behavior and the confidence interval looks a little bit better.

Â So what people do is they, they say okay and often when you're

Â working with ratios we know already that its very convenient to look at logs.

Â So the log relative risk is just the log of this quantity here.

Â X over n1, Y over x2.

Â And that quantity has a asymptotic standard

Â error that you can calculate and in fact,

Â in, in one of the next lectures.

Â One of the next two lectures or so, we

Â show you exactly how to get this standard error.

Â that standard error works our to be 1-p1 over p1n1,

Â plus 1-p2 over p2n2 all raised to the one half power.

Â And that's the standard error for the log relative risk.

Â So what you do to create a confidence interval for

Â the relative risk is you log the estimated relative risk.

Â You add and subtracted standard normal quantile, and then you multiply that

Â standard normal quantile times this standard error of the log relative risk.

Â That will give you a confidence interval for the Log relative risk.

Â And if you then want a confidence interval for the relative risk you then

Â exponentiate the end points. Okay, so we could equivalently

Â take the ratio of odds, instead of the ratio of probabilities, if you prefer.

Â There's a variety of reasons to do that, but one is maybe, what if

Â you just prefer to interpret things in, in terms of odds rather than probabilities.

Â Anyway, some people like to think about things in terms of odds.

Â saying the odds of say, 10 to 1 is

Â more interpretable than, than saying a probability of 10 elevenths.

Â So the, the odds ratio, the population odds ratio would just be

Â p1 over 1 minus p1, divided by p2 over 1 minus p2.

Â The odds associated with probability 1 divided

Â by the odds associated with probability 2.

Â So this would be the ratio of the odds

Â of contracting side effects comparing drug A to drug B.

Â and of course, just like the relative risk, you'll be comparing the odds

Â ratio to 1.

Â If it's bigger than one, it's going to suggest a greater propensity of

Â of side effects for drug A.

Â And if it's less than 1, it's going to suggest

Â a smaller propensity for side effects of drug A.

Â and then, of course, the obvious estimate of the odds

Â ratio is p1 hat divided by 1 minus p1 hat.

Â P2 hat divided by 1 minus p2 hat. And you can plug in you can plug in the

Â x and n1 and y and n2 into that formula. And what you'll find

Â is that it works out to be if we go to our notation where we talk about the cell

Â counts. The n11 the n22 times n21 times n2, n12.

Â And the easy way to remember that is its so called cross product ratio.

Â So the product along the Let's see.

Â When I'm recording, it's not, the product along that diagonal.

Â divided by the product along this other diagonal.

Â And and so that way you can you can always remember how to do it.

Â Some, some people tend to if, if, if you label the elements of the two by two

Â table a, b, c, d some people tend

Â to remember it in terms of the specific letters.

Â But I think its probably better to remember it in terms of its the.

Â The product along one diagonal divided by the

Â product along the other diagonal, the off diagonal.

Â So just like for the relative risk, the odds ratio, the

Â estimated odds ratio has better asyntotic Gaussian behavior if you log it.

Â so, so we can calculate a standard error for the log

Â odds ratio that works out to be an incredibly convenient formula.

Â It's the square root of 1 over all the cell counts added up.

Â So 1 over

Â n 1 1, plus 1 over n 1 2, plus 1 over n

Â 2 1, plus 1 over n 2 2, square root of the whole thing.

Â So you shouldn't forget the standard error of

Â the log odds ratio, because it's super easy.

Â So again, to create a confidence interval for

Â the population odds ratio, you calculate the odds ratio.

Â Show.

Â Log it.

Â Calculate the standard error of the log odds ratio.

Â Add or subtract a standard normal quantile say 1.96 if you wanted

Â a 95% confidence interval to your log odds ratio.

Â And that will give you an interval estimate for the log odds ratio.

Â Exponentiate the end points and that gives

Â you an interval estimate for the odds ratio.

Â Now, again we have a little bit of a problem if n 1 2 or n 2 1 is 0.

Â and there's some fixes for that often

Â involving adding small amounts to every cell is

Â a, is a, is a common fix.

Â Okay so some comments about the odds ratio.

Â So one interesting fact is if you, notice if you

Â transpose so that the little two by two tables a matrix.

Â If you transpose the matrix so simply recorded in this case

Â we had side effects versus non-labeled on the columns.

Â I believe in drug A versus drug B labelled along the rows.

Â But what if we correctly entered in the data with side effects entered

Â along the rows and drug A versus drug B entered along the columns.

Â And then calculate an odds ratio. Will you get identically the same number.

Â So the odds ratio doesn't care what is the sort of predictor and

Â what is the response. You get the same exact answer.

Â and for,for both the odds ratio and the relative risk,

Â taking logs help with the adherence to the error rate.

Â So again because its asypmtotics, you don't

Â necessarily, if you want a 95% confidence interval.

Â You don't exactly get a 95% confidence interval because its all based

Â on the central limit theorem and it's only true in the limit.

Â so the taking logs helps adherence to that error rate.

Â so the taking logs helps

Â adherence to that error rate.

Â and then the interval is just at log estimate, right, log

Â odds ratio log relative risk plus or minus the appropriate normal quantile.

Â Then times the standard error of the estimate.

Â And then exponentiating the odds interval on the natural scale.

Â a, a, and I would also add, though, the logging helps.

Â These, these intervals still do have some, some issues.

Â They're better than the the risk

Â difference which I,I,I,I think they are better than the risk difference.

Â but still, there's ways you can, you can improve on these confidence intervals.

Â But they involve a little bit more lengthy calculations, so we won't go over them.

Â These are the, the quick versions.

Â Okay, so let's go let's go over our example next.

Â [BLANK_AUDIO]

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