* 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.
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.
Comment