**Transcript of Cyberseminar**

**HERC Econometrics with Observational Data**

**Limited Dependent Variables**

**Presenter: Ciarin S. Phibbs, PhD**

**November 13, 2013**

Ciarian S. Phibbs:So my name is Ciarian S. Phibbs. I am one of the economists at the Health Economics Resource Center and this is part of an ongoing series on selected topics and econometrics, and I think the selected topics are relevant. The focus of this course grew out of things that were important to know that our work covered well in standard and sort of nph-level regression analysis courses. That is sort of the general background, and it has evolved a little bit. And so for this course we are looking at what are broadly called limited dependent variables.

So the classic limited dependent variable is when you have a dichotomous choice, a 0-1 is how it would be expressed in the model, but a yes-no or live-die, et cetera. Or there are small numbers of options or small numbers of counts. And the key identifying factors to the dependent variable is not only not continuous, it is not even close to continuous. And this causes problems for our estimate. 

So in general, the topics that we are going to cover are binary choice; what is called a multinomial choice, which is you have multiple choices or options to choose among; counts; and we will also talk of models in the general framework or a probability event. We are interested in a probability that an event occurs in some way.

The basic problem of all of this in terms of your classic ordinary least squares regression framework is that we have heteroscedastic error terms and the predictions are not constrained to match the actual outcomes. This is a real problem when the predicted values are negative and negative numbers are not possible.

If we look at the classic regression framework where we have Y equals an intercept plus a vector of coefficients and a matrix of data, let us just take sort of the classic we are looking at a yes-no, live-die, Y can assume a value of 0 if you live and 1 if you die. Or you can do it the other way. But that is the normal when you are trying to predict mortality. And the probability that Y equals 1 is F (Xβ) and the probability that is 0 is 1- F (Xβ). 

And if you were to estimate this using ordinary least squares, which is what is also referred to as linear probability model, your error term is going to be heteroscedastic because it is going to depend systematically on βX and your predictions are not constrained to 0-1. You cannot be 50% dead and you cannot be -.25 dead. You are either alive or dead, pretty much. And so this causes problems both in terms of the error terms and in terms of your predictions.

 Binary outcomes are common in healthcare. I refer to mortality, but you can have many other outcomes. Does the patient get an infection or not? Did the patient have some sort of a patient safety event? Was the patient rehospitalized within 50 days? For a given illness or set of symptoms, did the patient decide to seek medical care? Did the patient take their outpatient medications or fill their prescriptions? 

There is a host of these types of things. So this comes up very commonly and in most regression classes and public health schools, you are introduced to the logistic model, which is one of the standard approaches to this and formally logistic is the probability that Y=1 is expressed as the eβX / 1+eβX. 

The advantages of a logistic are two. One, it is designed and works for relatively rare events. And it is commonly used in healthcare, and most readers of clinical journals will know how to interpret an odds ratio, which is how the results are expressed.

There is another model out there that comes from the economic literature called a probit model. The classic example of this would be when a consumer is making a large purchase. Did they buy a car? Did they buy a house? And you only observe if they bought it or not. The model is framed in such that they would buy it if the y* >0 and not if it is <0. 

There are other methods of looking at these distributions as well that I am not going to talk about here. I am going to talk about some of the details of logistic. I am not going to talk more about the probit, either. There are a few things I want to talk about with respect to logistic models. Logistic and probit give about the same answer. In the old days, it used to be easier what are called marginal effects with probit, but not so anymore. Modern packages like Stata will give you marginal effects.

One important thing about logistics is that people commonly transform that odds ratio into a relative risk. The standard method is you have a logistic and it gives you a coefficient, which is then converted to an odds ratio and people convert that odds ratio into a percentage effect. So if you have an odds ratio of 1.5, you are saying you have a 50% increase in the relative risk of the patient incurring that condition. 

That is just an approximation and it is important to realize that that approximation starts to break down about 10% in terms of the probability of the event occurring. What I mean is, if you look at this graph, this maps out what the relative risks are relative to – down on the bottom here we have the incidence among the nonexposed. 

So what this really means is if you are looking at a sample, to continue the mortality example, the mortality rate is 5% or less, here is the odds ratio. This is 5% here would give 5% mortality. This would show how the odds ratio differs here. So the relative risk of 0.5, if you have an odds of – I mean with an odds ratio of 0.5, the relative risk is 0.5 or very close to that when the mortality rate is very, very low. As the mortality rate in the sample increases, that starts to diverge. If you have an odds ratio of 0.5 and a 50% mortality rate, that relative risk is going to be more like about 0.65. Or to turn it around to get that 0.5 relative risk, your odds ratio has to be down to about 0.35.

And these divergences are actually more pronounced for bigger odds ratios so that if you have an odds ratio of 3, the relative risk is 3. But even at 20% mortality rate, to get a relative risk of 3 you need an odds ratio of 5. These just go up very, very quickly. And so you need to be careful.

Fortunately, there is a way of adjusting this or correcting for that. The reference is listed here and you have a relatively simple formula. It will adjust the odds ratio to an approximate relative risk. This is not an exact adjustment. But it is approximate and it gives you quite a good adjustment. And it is, as you can see from the formula, relatively easy to calculate. 

And I actually have here a table—this is from a paper of mine—where the mortality risk in the sample was about 0.2. It was a little bit less than that. And, as you can see, at the odds ratio of 1.08, the calculated relative risk per this formula is essentially the same; and as the odds ratios go up, the effect on the relative risk gets larger. So here we have a 2.72 odds ratio and the relative risk is only 2.08, and the underlying reason for these shifts is that we were dealing with a mortality of around 20% and logistics really do not work as well when the incident is that high. 

Logistic is really designed for 5%, 10%; and above that you need to be really careful in terms of how you interpret. The regression itself just works fine. It is just in terms of interpreting the results you need to be careful.

There are all kinds of extensions now. I mean in Stata you can estimate logistic regressions with panel data, with random effects, fixed effects. There are actually over 30 related regression commands in this data manual when I counted them out a couple years ago. You can look at group data. So basically you can estimate this 0-1 choice model for just about any kind of a variant in a model that one needs to deal with.

In terms of goodness of fit, I want to talk about a couple things here. There are several tests. The most commonly reported tests for statistics are just logistic regression are the area under the receiver operator curve, a characteristic curve or ROC curve. In SAS that is reported as the c-statistic down at the bottom of ROC logistic. 

The range of the c-statistic is 0.5 to 1.0. What it is reporting is how much better – the 0.5 reflects essentially flipping a coin or guessing that, so your model will predict correctly half of the time. What it is reporting is how often does your model correctly predict the actual outcome? So if you have a perfect model, you are going to perfectly predict the outcome all the time. So a c-statistic of 0.9 says 90% of the time you are correctly predicting what the actual outcome was.

The second statistic that is often reported is the Hosmer-Lemeshow test. Those results that I just put out there, the c-statistic was 0.86 in the Hosmer-Lemeshow. It passed because there you are looking to not reject and the p-value was 0.34.

What the Hosmer-Lemeshow test does is it breaks your sample up into a series of equal groups based on sample size. The default is usually 10. Stata will let you vary this. Some other programs will let you vary this. Within each of those groups, it looks at the number of observed to expected events in each group.

So to continue the mortality example, you would slice your sample into 10 different groups. How many deaths are in that sample? And it is ordered by the predicted probability. So you get the predicted number of deaths and you compare that to the actual number of deaths.

One little twist that I will note is that if you have a sample where the mortality is only occurring in the people with the very highest predicted mortality, all of the predicted deaths and probably the actual deaths will be in tenth decile if you are using deciles. That is okay if that is what you are interested in. It depends on your application. 

But if you are really interested in really discriminating between a person who has the highest predicted probability and those groups are not going to distinguish it. One other test that is not a formal test; it does not have the probabilities because there is some ad hoc-ness to it. But in terms of looking at how well your model predicts that one can do—and you have to do this by hand; it is not in any group—is to slice the active order then by predictive probability. Slice the patients into groups. Slice the data such that not the number of observations is equal, but the number of predicted deaths is equal. The first decile is going to be a very big decile, but it is going to get you one-tenth of the deaths. And then repeat the exercise. How do the observers does expected death occur? It is a way of seeing if your model really discriminating?

It is not a formal test, but it can be useful in terms of understanding how your model is actually working. This goes back to an underlying theme that I have always stressed in terms of applying econometric models, which is know your data. Look at your data very carefully and understand what your models are giving you. This can be informative. If you do this and you get some weird, weird results, it may be a flag that something is wrong.

One note for estimating these models for very large samples: If you have very large samples like millions, it takes a lot longer for a maximum likelihood estimation method to actually estimate a model than it does OLS because of the iterative procedure. And if you do not have sufficient computing power, this can just leave you stuck if you want to try comparing various models.

One thing to realize is that the X matrix is identical whether you are running OLS or a maximum likelihood routine. So the p-values that you get from an OLS regression are approximately the same. The coefficients are messed up, but in terms of model specification-type stuff and in terms of model development, you can frequently use OLS to help you sort out issues because it runs so much faster.

I see a question. All right. Before I move on, if there are no questions about the logistic – yes, one. We are going to move to this other set of choices called multinomial choice models and if there is more than one choice or outcome. 

The options become much more limited. There is a multivariate probit model. There are sort of two versions of this. You have multiple decisions, each with two alternatives. There is also an ordered probit. These have not been used that much in healthcare. They have been used a little bit. 

There are two different logit models. Or you are looking at choices of a multiple or pluritives [PH] for a single decision. The conditional logit model, which is associated with Dan McFadden—it is associated with a Nobel Prize for that matter—is for unordered choices. The classic example was you have several choices about how you are going to commute to work. You can take the bus. You can walk. You can take the train. You can take your car. How do you choose?

For a multinomial logit model, the choices can be ordered in terms of how their preference is. And again this is just an overview of these. A classic example that has been applied many times in healthcare is the choice of hospital to use among those in the market. How do patients choose which hospital they go to, or the choice of a treatment among several treatment options.

The conditional logit model is formally expressed as the probability that hospital i is chosen by consumer j is expressed as the exponent of the Xβ above the summation of that across all choices. 

This model is also known as the random utility model. It has a nice property in it that is directly derived from consumer theory about how consumers choose from a set of options. The model is driven by the characteristics of the choices. 

Because you are looking at the individual across the individual – the individual sort of essentially cancels out, so you cannot put an individual’s age in the model. But you can indirectly include it.

For example, from looking at hospital choices, you can interact it with something that is variable across the choices. So an individual who you know where they live and you know how far it is to each hospital. Let us say, does age matter? So I can interact age with distance. So you are pulling age in through some other characteristic, a characteristic of choice that varies, and that may vary with age. So older people might less willing to travel because of the distance. Or if they are retired, they may have more time so they may be willing to travel further. You can come up with a hypothesis. 

It should be something that you have to interact it in a way that makes sense in terms of the underlying consumer theory.

The results for both of these models are expressed as odds ratios, so it is familiar in terms of interpreting them.

Moderator:There is a question about that, Ciaran.

Ciarian S. Phibbs:Yeah.

Moderator:It says: for the multinomial logistic regression for three or more choices, is the interpretation of the odds ratio the same as for the logistic regression?

Ciarian S. Phibbs:Pretty close. Because what it is – what I am doing is I am estimating this model and these are not specific to the choices. So I get a model and let us say I get a parameter on distance. And what that says is, this is how each additional mile of distance affects the odds that I am going to choose that. And again, this is for a continuous variable, so you have the interpretation. Or if I get a coefficient in this model of 0.5 in terms of the odds ratio for let us say a public hospital, so I am half as likely to choose this hospital given all the other characteristics that you might have put in the model like quality measures and how far it is. And if it is a public hospital, I do not want to go there. So do I even get an odds ratio smaller than that? And so it is because with the conditional logit model, the characteristics of a hospital and how do those affect the choice.

Estimating this model—I have not done it recently, but it used to be that it was a real bear to estimate this in SAS because it requires that the number of choices be equal across all observations. And so the number of choices – and think about this in terms of looking at how people chose hospitals, well, the markets or the available choices for an individual living at a particular location are going to vary by where you live. You are going to have many more choices if you are in a big metropolitan area than you will if you are in a small city that is relatively isolated.

There is a program out there called LIMDEP, which has an NCHOICES option that lets you set the number of choices for each observation. This is a very useful feature for some applications. I have not formally checked this out, but I have been told that in clogit in Stata you may be able to do this with the group option. But this can be relevant because you want to limit the choices to those that are relevant with the consumer’s making.

Relevant here in terms of the example the person just asked for, I actually estimated a choice model for looking at elderly service-connected veterans and their choice of a VA versus a non-VA hospital. And so holding distance and other characteristics of the hospital constant, these veterans we got an odds ratio of 2.8, so they were much more likely to choose to use the VA. Everything else held constant. Now that could be offset by the added distance because as distance increased, they were less likely to use the hospital.

The multinomial logit model: what you have to do here is formally expressed like this and it is defined for each of the choices with one of the choices being a reference. I am not going to go into the math.

And so what you are doing here is you have to identify a reference choice and the model sets the parameters for each of the other choices relative to the reference choice. So it is restrictive that way. Compared to Hospital B I am more likely to choose Hospital A given these characteristics. 

But the advantage of this model is that it allows for direct estimation of the individual characteristics. So I can put age in the model. I can put, does the patient have insurance or the type of insurance that the patient has. So it has some additional advantages.

But it has this other restriction because it is all relative to some reference choice and you have to figure out how to make that reference choice.

One thing that applies to all of these models is an assumption known as the independence of irrelevant alternatives, and that is essentially that the results should be robust to varying the number of choices.

There are ways that you can do this. You can re-estimate the model after deleting some of the possible choices and see what happens to the results, and are they relatively robust. McFadden actually has a regression-based test that allows you to do this formally. I put the reference here.

If you fail this, you may need to estimate what is called a nested logit model because the choices really might be a nested set of choices where it is not just, do I need a hospital, but if that, do I need a certain type of hospital? And you could come up with lots of other things where the choices are actually nested. And again, you can do these nested choices by estimating the model in two stages, the S-1 stage and then the next.

The McFadden test is actually quite robust and can also be used to test for omitted variables. One thing that you will encounter in using these models is, if you get a knowledgeable reviewer, they are going to push you on this. One of the nice things is, for many of the applications, the models are pretty robust.

For example, the hospital choice model, distance is such a big driver of the choice that the model results are very robust to the independence of irrelevant alternatives.

I am going to pause for one second. If there are no questions, I will move on. 

Moderator:Um.

Ciarian S. Phibbs:Yes.

Moderator:There is a question that went back asking about relative risk.

Ciarian S. Phibbs:Yes.

Moderator:They want to know: in what situations are referring relative risk estimates more appropriate than odds ratios? Or can they be used interchangeably?

Ciarian S. Phibbs:One is a transformation of the other. It is a different way of expressing it and it depends on the point you are trying to make, would be my simple answer. It is just a different way of expressing it. The thing is that when we estimate a logistic regression, log odds, people have a hard time getting their hands around that, whereas a 20% increase in the risk of mortality, which is what the relative risk is, is easier for people to interpret. So it is easier to explain things in terms of the relative risk. And implicitly most people are converting the odds ratio into relative risks. So if you have an application where your event rate is more than 10%, you want to be making that adjustment so that when they make this conversion, they are doing it accurately. Hope that answers your question.

Count data is another set of problems and count data just means integers. We are looking at one, two, three, four. You think of, okay, I have got counts. I have data on the number of outpatient visits each patient has. They have one, two, three, four. Some patients come in a lot. That is sort of continuous. Essentially you need to think about it. There is the same problem. You cannot have 1.5 healthcare visits. You can have one or two. So you have these same problems with the error terms. The extent of the problem diminishes as the counts increase. It is also the case that you cannot have non-zero value.

As a rule of thumb count data models should be used when your counts are under 30, but that is just a rule of thumb and one needs to examine your data. If you have data where most of your counts or most of your observations are zeros or ones or twos or threes, and even if you have some hundreds, you may well want to still be using a count data model. You need to check your data carefully to see what fits.

Examples of where count data apply in healthcare. I just mentioned if you are looking at the number of outpatient visits. You can look at the number of times a prescription or a chronic disease medication is refilled in a given year when you have 30-day prescription amounts. That is going to vary between zero and 12. If you were looking at the number of times there was an adverse event or some sort of a failure to rescue or a patient fall or something in a unit of a hospital over some period of time like a month or a week or something, those are going to be small counts. You are going to  want to use a count data model.

The classic example that people get in a statistics class for counts is the Poisson distribution. It is a distribution specifically designed for counts, but there is one problem with it. It has a very restrictive assumption that the mean and variance are equal and that is often not met. Very often the variances are going to be bigger than the mean and the Poisson will not fit quite right.

There is another distribution called a negative binomial, which is a better choice. In Stata that is nbreg—and you can estimate – and the Stata package actually includes a test for what distribution should be used in terms of there is a formal terms for over-dispersion.

Interpreting count data models. What you get is the 1nE(event rate) = βX. So the incident rate ratio = eβ is like an odds ratio with a similar interpretation. So just down at the bottom I pulled some numbers from one I had run and I had a coefficient where the β = -0.262 and you get an incident rate ratio. The negative data as it corresponds to an incident rate ratio less than zero

Compared to a binary choice where people tend to totally use logistic, you tend to see people using the wrong model and using OLS for counts. Empirically, the real problem here is that OLS really breaks down if you have lots of zeroes. It just cannot handle that. So if you have a situation where you really have counts and you get a lot of zeroes, observations with zeroes, you are going to have problems. You are going to get negative predictions and it will actually reduce your significance. 

But the effect on the statistical significance can go in the opposite direction. And I actually put here an example where I am just putting the t-values, and I used the t-values—this is for a count data model where we were looking at adverse events. This is a function of nurse staffing and the parameter estimates are not directly comparable. 

But if you look and see, you can see here that for the first one, for RN staffing, I got in the count data model, the point estimate is a positive effect, not significant. But the t-value is very small. So essentially this is no effect. Things are close to zero, whereas in OLS, the same model, I am getting a negative thing. So more RN staffing will reduce the events. And not quite statistically significant.

For LPNs, I got in the count data model, I get not quite significance, negative effects. So in this case, increased staffing will reduce the event rate; whereas in OLS I was getting a very strong result.

And for aides I was getting a very strong result, borderline statistical significance; whereas no effect in the count data model and in the opposite direction.

I will just note for those of you who are, gee, why are LPNs effective and not RNs? This was in a long-term setting where most of the nurses are LPNs. So you would expect the staffing effect to occur in LPNs, but that is aside.

The point here is that because we were compiling enough events that they were a little more common and so the OLS was overestimating the effects and had standard errors that were not correct and the standard errors were too small; so it was overestimating significance. 

As I said in the previous slide, the effect on the standard errors can go in either direction and you tend to get an overestimate of the significance with OLS when the counts are larger. When the counts are really small, when you have a lot of zeroes, you will be underestimating your statistical significance with OLS compared to what you get with a count data model.

I mentioned the rule of thumb is 30, but you should still consider a count data model if most of the counts are really, really small. You need to look at your data and you need to look carefully at the error terms in your regression and how those are affecting your standard errors. You just need to carefully check your data.

I want to make one other point. That is, when you are estimating models, you need to consider and think about the distribution and the data-generating processes. There may be sort of a mixed data-generating processes and you need to split the sample. I am going to use a newborn example because it is a particularly good example.

If I take the length of stay of all newborns, there is really a mixed data-generating process. For the normal, healthy newborns, the LOS<=5 days, which is clearly a count; and what is driving it is really the type of delivery: C-section versus vaginal delivery. Whereas with sick newborns have a very skewed and long length of stay. Very small, pre-term infants will stay over 100 days if they live.

So I look at that overall distribution and say, okay, I can just use OLS. Well, not really because 90% of those kids are going to have lengths of stay of less than five days and have a different data-generating process. And so if you are trying to predict the lengths of stay, you need to split the sample.

And the other thing is what really drives those long lengths of stay among the sick newborns is going to be how premature they are, the effects of birth weight and gestational age; but that has essentially no effect among the variance within the term infants, and that is 90% of your sample. So it is really going to mess up your estimate and the solution in this case would be to split the sample. 

Analogous to this you see two-part models where you do not try to predict the costs. In the Rand health insurance experiment, they did not try to predict the costs of hospitalization for everybody. They ran a model to predict, do you have any hospitalization, and then they only predicted hospital costs among those who did have the hospitalization.

So again, you have to understand your data-generating process and you may need to use different models for different parts of the sample if the data-generating processes used are fundamentally different.

I want to close by noting a couple things. One, new models are being introduced all the time. There are more and better ways to address the problems of limited dependent variables. This includes that there has been a lot of work in terms of semi-parametric and non-parametric methods. Those semi-parametric and non-parametric methods have advantages and disadvantages depending on the particular application you are trying to use. The classic disadvantage of a non-parametric method is that you are suppressing some of the information. 

But it really depends on what your application is and if you have some of these particular applications, you may need to get some statistical help because it is impossible to keep track of all these unless that is your full-time job.

Actually, the other thing I want to add and reemphasize—I have mentioned it a couple times—is know your data. I mean before you even start running a regression, look at your data very carefully. Look at the distributions. And it is not just a matter of the means. Look at the distributions of the different variables because you need to carefully look and make sure that the model that you are using for your estimation matches what is appropriate. Last week we talked about the right hand side variables and it applies in terms of the right hand side variables as well as the dependent variables. Carefully check your data, then figure out how to proceed.

Some good references. I mean it is showing my age in terms of Greene’s Econometric Analysis. It is a classic thing. Jeff Wooldridge has a very good book that is sort of a next-step beyond a first class, and in Econometric Analysis of Cross Section and Panel Data he has good treatment of a whole host of problems. If one wants something focused on just limited dependent variables, Maddala has sort of a classic text on this. It is older, but it provides a good but more advanced treatment of the various issues. I am sure there are others; these are just some examples.

And again, at the end, I have just listed the references for correcting odds ratios to relative risk and the specification tests that McFadden preferred.

If there are no other questions, the next lecture will be “Cost as the Dependent Variable” and I think it is actually Part 1 of that that Paul Barnett is going to give and what is that, next week, I guess. 

And one thing—this is another case. This is actually an extreme case of the problem that we are talking about in terms of the error terms. It is with the continuous variable, but it is more of the problem with the error terms not fitting and causing problems for prediction.

Moderator:Okay. A couple of questions here, Ciaran. 

Ciarian S. Phibbs:Okay.

Moderator:The one says: when there are lots of zeroes and lots of extreme lengths of stay for the same sample, is this an example of when a two-part model is appropriate or is the negative binomial regression appropriate?

Ciarian S. Phibbs:Well, it is going to depend on the data-generating process. So if there are lots of really big values and lots of zeroes, a two-part model may well be appropriate, and you may get estimates that do not make sense if you do not use a two-part model.

Moderator2:Ciarian, I am so sorry. I just screwed up and I actually accidentally ended the meeting.

Ciarian S. Phibbs:Okay. That is all right.

Moderator2:I am so sorry. The people who are still on the phone can hear us, people who are streaming cannot. I am mortified. I am so sorry I hit the wrong button.

Ciarian S. Phibbs:Okay. Well, for those who are still on the phone, Jean, you said you had another question?

Moderator:I cannot see it.

Ciarian S. Phibbs:Can you remember it? [Laughter]

Moderator:There was one question asking about can you give examples of semi-parametric and non-parametric methods that you mentioned at the end?

Ciarian S. Phibbs:I am not prepared to give specific examples at this point in time. I did not pull up any specific examples. It is just that I have seen them out there.

Moderator:Okay. So I do not have the other questions, but there is a log of the questions.

Moderator2:Yes. There is a log and I will get that printed out and sent over to you guys as soon as I can this afternoon. You should have that within the next half-hour or so.

Ciarian S. Phibbs:Okay. Is there a way that we could answer them and distribute them to everybody, then?

Moderator2:Yes. That is not a problem. I have the entire list of everyone who attended and registered, so if you send the responses to me, I am happy to forward that out to everyone.

Ciarian S. Phibbs:Okay. We will try to do that.

Moderator2:Fantastic. For the audience, for those of you who are still here, thank you for joining us for today’s session, I did just send out registration information for Paul’s session next week, “Cost as the Dependent Variable Part 1.” We hope you are able to join us for that. And I apologize for the very sudden end to today’s session. That is not very typical for me, but we will get the last question answered and get that response out to everyone as soon as we can. Thank you, everyone, for joining us for today’s session and we hope to see you at a future session. Thank you.

Ciarian S. Phibbs:All right.

Page 1 of 12