Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • how to constrain the predicted dependent variable to certain values?

    Hi everybody

    I am running 4 models in Stata: OLS reg, -xtreg, fe- and -xtreg, re- and -mixed-. I am trying to calculate the prediction of the dependent variable for each one of these models. I am doing the following for all models:

    predict variable_name if e(sample), xbMy dependent variable is from 0 to 3, but Stata is giving me predicted values outside this range. Could you please advise?

    Thanks a lot for your help!
    Oliveira

  • #2
    Without knowing more about your dependent variable, it is difficult to advise. What is it and how is it measured? Does it take just the values 0, 1, 2, or 3, or can it take fractional values, like 3.14 or 2.72? in the former case, perhaps you should be fitting a multinomial logit or probit model, or an ordered logit or probit model. In the latter case, perhaps you should be fitting a transformation of your dependent variables,

    Comment


    • #3
      Hi William

      Thanks for your message. My dependent variable is HAQ (health assessment questionnaire). It is calculated based on a series of answers patients give in a questionnaire. It can take any values between 0 and 3, including 3.14 or 2.72, for example, and it is kind of normally distributed (except a higher than expected number of 0s) so thats why I am using OLS and than mixed (ML). Most of the times it is just 6 or 7 negative values and actually Stata does not predict more than the value 3. I am thinking about setting all negative numbers Stata is generating to 0, what do you think?

      Thanks for your help!
      Oliveira

      Comment


      • #4
        Oliveira: The linear model estimators you are using don't respect the bounded nature of your dependent variable. An alternative you could consider (at least relative to OLS) is fracreg which is guaranteed to give predictions that respect the bounds (you'd have to normalize your dependent variable to the [0,1] interval, but you could then multiply the predictions by 3 and that would be fine). This approach is not suitable for the xt/fe/re/mixed models you are estimating, however.

        Comment


        • #5
          Hi John

          Thanks a lot for your message. I will check fracreg as you mentioned. I just want to pointed out that, even though it is a linear model estimator, it gives me the estimates in the range I want. Only a few are negative (7 out of 800) and none are higher than 3, so I guess I could go with the models I have?

          Another question I have: I am using xtreg, fe and xtreg, re in the following model:
          xtset Hospital
          xtreg HAQ6m HAQT0 controls, fe cluster(Hospital)
          xtreg HAQ6m HAQT0 controls, re cluster(Hospital)

          I am looking for the hospital-effect that will give me the performance of each hospital. I don't have a panel though, I have patients within hospitals and instead of temporal variation I am looking at patient variation in each hospital. Can I run these models (xtreg) even though I don't have panel dataset?

          Otherwise If I do a FE dummy variable analysis and use mixed for the RE I cannot do the hausman test, I get an error message saying:
          no coefficients in common; specify equations(matchlist)
          for problems with different equation names.

          Can you please advise on both questions please?

          Thank you very much for the help and time!
          Oliveira

          Comment

          Working...
          X