Announcement

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

  • Margins from non-linear responses (i.e. probability)

    Hi there,

    I am running a Hausman-Taylor model to investigate the relationship between 'cheap alcohol units' (dependent variable) and economic & demographic regressors (income groups, occupations, age, gender, type of product, year of purchase, promotion...).

    Thereafter, I'd like to obtain the probability that low-income groups buy cheap alcohol using the margins command.
    I tried different Stata commands but I am not able to converge to an answer.

    Please, could you give me advice me on which 'margins' command to use?
    Thank you

  • #2
    What did you try (exact commands for both the original estimation command and the subsequent margins commands) and why do you think that the outcome is not what you want?
    ---------------------------------
    Maarten L. Buis
    University of Konstanz
    Department of history and sociology
    box 40
    78457 Konstanz
    Germany
    http://www.maartenbuis.nl
    ---------------------------------

    Comment


    • #3
      The Stata command for the Hausman-Taylor (HT) is as follows:

      xthtaylor Weekly_cheap_units_new Low_income2 Intermediate_income2 Intermediate Routine_manual Total_number_of_adults Household_with_children5 ///
      Gender Age3040 Age4050 Age5060 Age60p MeanWeeklyAlcoholLvl_0wks2 MeanWeeklyAlcoholLvl_0wks3 Year_of_purchase2 Year_of_purchase3 ///
      Total_alcohol_spending Beer_lager2 Cider2 Fabs2 Other_wines2 Spirits2 Promotion_dummy Percentage0Week ///
      if Social_Class!=6 ,endog(Percentage0Week Total_alcohol_spending Beer_lager2 Cider2 Fabs2 Other_wines2 Spirits2)

      Thereafter, I use the following command to obtain the average predicted quantity of cheap alcohol units purchased within income group:

      margins if Low_income2==1 & Mean_weekly_alcohol_level2==0


      Finally, I am interested in obtaining the predicted probability that households purchase cheap alcohol within income group and by purchase level and I tried the following Stata command, but Stata specifies that the option is not allowed:

      margins if Low_income2==1 & Mean_weekly_alcohol_level2==0, xbu


      Thank you

      Comment


      • #4
        I would start with using factor varialbes for your xthtaylor command instead of using your own dummy variables, see help fvvarlist. The margins uses this information to compute its quantities, so not using factor variables can lead to serious problems. Second, for the quantities I would look at the at() or over() options, for the difference between the two, see the help-file of margins. Third for your probability, I would look at the predict() option for margins. to see what is available you need to look at help xthtaylor_postestimation.
        ---------------------------------
        Maarten L. Buis
        University of Konstanz
        Department of history and sociology
        box 40
        78457 Konstanz
        Germany
        http://www.maartenbuis.nl
        ---------------------------------

        Comment


        • #5
          Hi Martin,
          thank you very much for your suggestions.
          I will have a look at them.

          Thank you

          Comment

          Working...
          X