Announcement

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

  • exponentiating coefficients in margins and a couple other things

    Hello! I have not posted here before and I hope these are not silly questions. I have a couple questions about nestreg and margins.
    1. Can stata do nestreg, eform and esttab all at the same time on a logged dependent variable? I was told there might be a problem with overseasoning.
    2. Is there a way to exponentiate the coefficients and means from the margins command properly? When I run eform (code below) it doesn't seem to give me a correct answer for the coefficients and I can't figure out how to do it on the margins at all. Is it possible?
    The code I use is below. I simplified things by just saying IV1,2,3 etc. The DV is log income.

    Thank you,
    Jen
    nestreg, store(lnpisvy): svy: regress logincome pIV (IVgroup1) (IVgroup2) (IVgroup3) (IVgroup3) (IVgroup4) if (...)
    estadd scalar pvalue = Ftail(e(df_r), e(df_m),e(F))
    esttab lnpisvy*, eform se star obslast scalars(N r2_a F pvalue) mtitles
    margins, at(pIV=(0(1)1)) atmeans
    margins, at(pIV=(0(1)1)) atmeans over(IVfromgroup4)


  • #2
    Regarding #2, try:

    Code:
    margins, at(plV = (0 1)) atmeans expression(exp(predict(xb)))
    Similarly for the other -margins- command. Note, my changing the list of values for pLV in your at() option was just to make the typing simpler--your syntax, though more complicated than necessary, does the same thing in that regard.

    Comment


    • #3
      Clyde,

      This is fantastic, works perfect! thank you so much!

      Any thoughts on question 1?

      Comment

      Working...
      X