Announcement

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

  • Help with mi data: how to calculate beta coefficients

    Good afternoon,


    How can I calculate beta coefficients for linear regression model with mi data?

    I tried the following sintax, but it does not work:

    mi estimate: xtmixed PHQ_suma_sintomas_pos i.CI || centre:, beta

    Thank you so much in advance.

    Irene.



  • #2
    Irene,

    The beta coefficients are the coefficients in the output table. In any case, I don't see a beta option described in the Stata 13 or later manuals for the mixed command. (Note: it's no longer xtmixed, although Stata will still run mixed if you type xtmixed.) What are you trying to do?

    Your syntax would otherwise be correct if not for the non-existent option.
    Be aware that it can be very hard to answer a question without sample data. You can use the dataex command for this. Type help dataex at the command line.

    When presenting code or results, please use the code delimiters format them. Use the # button on the formatting toolbar, between the " (double quote) and <> buttons.

    Comment


    • #3
      Weiven thank you for your response, it is really useful for me.


      I am trying to create a linear regression model to evaluate the effectiveness of an intervention. In such a way that, as in logistic regression models, odd ratios can be calculated, in this case I wanted to calculate the beta coefficient.

      So, do you mean that "Coef" in the autoput table is beta coefficients?

      ---------------------------------------------------------------------------------------
      PHQ_suma_sintomas_pos | Coef. Std. Err. t P>|t| [95% Conf. Interval]
      ----------------------+----------------------------------------------------------------
      _cons | .9413106 .1483072 6.35 0.000 .6462082 1.236413
      ---------------------------------------------------------------------------------------




      Comment


      • #4
        Recall that in a logistic model, the raw coefficients are on the log odds scale. The model is ln(p/1-p) = XB. You can ask for the raw coefficients. To get the odds ratio, which is p/1-p, you can manually exponential them, or you can ask Stata to exponentiate them for you. Or, pro tip, you can use the margins command to get effects on the probability scale (I.e. in terms of p).

        In a linear model, the equation is y = XB + error. So, the betas are on the same scale as the dependent variable. There’s no equivalent to to an odds ratio. Unless you were thinking of standardizing the outcome variable first, e.g.

        Code:
        egen PHQ_std = std(PHQ_suma_sintomas_pos)

        if that is the Patient Health Questionnaire for depressive symptoms, then consider that clinicians might prefer to have the betas on the raw scale anyway. NB for other readers: this is a 0-27 point scale. 10 points is consistent with a current major depressive episode. It’s frequently used to screen for depression or to monitor if the patient has achieved remission.
        Be aware that it can be very hard to answer a question without sample data. You can use the dataex command for this. Type help dataex at the command line.

        When presenting code or results, please use the code delimiters format them. Use the # button on the formatting toolbar, between the " (double quote) and <> buttons.

        Comment


        • #5
          Dear Weiwen,


          Thant you so much for you response.

          As you say in this case PHQ is the Patient Health Questionnaire (PHQ-9) and I have to perform multilevel lienal regression with mi data.

          Best regards,
          Irene.

          Comment

          Working...
          X