Announcement

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

  • nlcom for two different models

    * Example generated by -dataex-. To install: ssc install dataex
    clear
    input byte foreign int(price mpg turn)
    0 4099 22 40
    0 4749 17 40
    0 3799 22 35
    0 4816 20 40
    0 7827 15 43
    0 5788 18 43
    0 4453 26 34
    0 5189 20 42
    0 10372 16 43
    0 4082 19 42
    0 11385 14 44
    0 14500 14 43
    0 15906 21 45
    0 3299 29 34
    0 5705 16 43
    0 4504 22 31
    0 5104 22 41
    0 3667 24 40
    0 3955 19 43
    0 3984 30 35
    0 4010 18 46
    0 5886 16 46
    0 6342 17 46
    0 4389 28 33
    0 4187 21 43
    0 11497 12 51
    0 13594 12 48
    0 13466 14 41
    0 3829 22 39
    0 5379 14 48
    0 6165 15 44
    0 4516 18 41
    0 6303 14 45
    0 3291 20 43
    0 8814 21 43
    0 5172 19 42
    0 4733 19 42
    0 4890 18 42
    0 4181 19 43
    0 4195 24 40
    0 10371 16 43
    0 4647 28 37
    0 4425 34 37
    0 4482 25 36
    0 6486 26 38
    0 4060 18 44
    0 5798 18 42
    0 4934 18 42
    0 5222 19 45
    0 4723 19 40
    0 4424 19 43
    0 4172 24 41
    1 9690 17 37
    1 6295 23 36
    1 9735 25 34
    1 6229 23 35
    1 4589 35 32
    1 5079 24 34
    1 8129 21 38
    1 4296 21 36
    1 5799 25 36
    1 4499 28 34
    1 3995 30 33
    1 12990 14 38
    1 3895 26 34
    1 3798 35 36
    1 5899 18 36
    1 3748 31 35
    1 5719 18 36
    1 7140 23 36
    1 5397 41 35
    1 4697 25 35
    1 6850 25 36
    1 11995 17 37
    end

    label values foreign origin
    label def origin 0 "Domestic", modify
    label def origin 1 "Foreign", modify

    probit foreign price mpg
    estimates store model1
    reg mpg price turn
    estimates store model2

    How can I use nlcom to see the partial effect of turn on foreign, obtained by multiplying the effects of mpg on foreign and turn on mpg. nlcom [model1]_b[mpg] * [model2]_b[turn] does not work for me. Thanks so much.

  • #2
    nlcom cannot do what you want it to do. You need to reformulate your model so that both estimations are in one equation/model. It sounds like that you are looking for some kind of moderation effect. To get better answers, you need to ask a better question and explain what exactly you want to achieve.

    Comment


    • #3
      Thank you so much Sven-Kristjan. This is a simple example I am hypothesizing. I dont want to estimate them in a single model for some an econometric reasoning aimed to address unobserved hetrogeneity with in the probit model. But I want to link the effect of the variables to capture the total partial effect as explained earlier. My worry now is that I cant capture the estimates of the previous model through preserve and restore commands in Stata to work with nlcom. Only the last recent estimates appear. So, I would be happy if you give me some hints on it. Thank you.

      Comment


      • #4
        Why would you want to combine a probit coefficient and an OLS coefficient? For the record, Stata works with one estimation sample at a time, but there are ways to combine estimates. So practically, it can be done, but the reasoning in this case is highly suspect.

        Comment


        • #5
          I forgot to check for the suest-command. So technically it is possible. If it is reasonable depends your exact problem. You should give more details about your exact econometric concerns regarding unobserved hetrogeneity with in the probit model. Just google "unobserved heterogeneity in probit model". You should find a presentation about using "Modeling unobserved heterogeneity in Stata".

          You can combine coefficients in Stata with using something like
          Code:
          sysuse auto,clear
          probit foreign price mpg
          estimates store model1
          reg mpg price turn
          estimates store model2
          suest model1 model2
          nlcom (_b[model1_foreign:mpg] * _b[model2_mean:turn])

          Comment


          • #6
            Thanks Andrew Musaufor your recommendation. Sven-Kristjan, I am so much grateful. Your code works perfect for my previous question. I was also hopping that the same approach can be followed after an xttobit model in a panel data setting. However, I found an error message "unable to generate scores for model new suest requires that predict allow the score option r(322);". Would there be an alternative after xttobit so that I would be able to link the estimates using nlcom? Your kind supports are always appreciated.

            Comment

            Working...
            X