Dear all,
I use Stata16 and need your kind assistance with generating marginal effect from a moderation model. Here is my model:
reg lnnpl lnpc inf xr je cinfo jecinfo y2-y7, ro ...............................[1]
reg lnnpl lnpc inf xr c.je##c.cinfo y2-y7, ro ...............................[2]
//both specifications gave IDENTICAL results.
where, lnnpl = dependent variable (continuous variable)
je = key explanatory variable (continuous variable)
cinfo = moderation variable (ranges from 0 to 8)
lnpc inf xr = control variables
OBJECTIVE: Compute and plot the marginal effect of JE on LNNPL.
I executed Equation [1] and thereafter tried to execute this syntax:
margins cinfo, dydx(je)
I received the following error message:
factor cinfo not found in list of covariates
r(322);
Initially, I thought this will be easy after reading the Stata help files and watching Prof. Chuck Huber's YouTube tutorials, but it has been a roller-coaster of errors. I really need your help. Here is my dataset:
Please help me, thank you.
Ngozi
I use Stata16 and need your kind assistance with generating marginal effect from a moderation model. Here is my model:
reg lnnpl lnpc inf xr je cinfo jecinfo y2-y7, ro ...............................[1]
reg lnnpl lnpc inf xr c.je##c.cinfo y2-y7, ro ...............................[2]
//both specifications gave IDENTICAL results.
where, lnnpl = dependent variable (continuous variable)
je = key explanatory variable (continuous variable)
cinfo = moderation variable (ranges from 0 to 8)
lnpc inf xr = control variables
OBJECTIVE: Compute and plot the marginal effect of JE on LNNPL.
I executed Equation [1] and thereafter tried to execute this syntax:
margins cinfo, dydx(je)
I received the following error message:
factor cinfo not found in list of covariates
r(322);
Initially, I thought this will be easy after reading the Stata help files and watching Prof. Chuck Huber's YouTube tutorials, but it has been a roller-coaster of errors. I really need your help. Here is my dataset:
HTML Code:
c_id country year lnnpl cinfo je jecinfo lnpc inf xr y1 y2 y3 y4 y5 y6 y7 1 Israel 2013 1.051114 7 41 287 10.49983 1.5713922 3.6107583 1 0 0 0 0 0 0 1 Israel 2014 .7659684 7 43.3 303.1 10.53686 .48503094 3.577925 0 1 0 0 0 0 0 1 Israel 2015 .6123633 7 43.3 303.1 10.48505 -.63249001 3.8868333 0 0 1 0 0 0 0 1 Israel 2016 .4731912 7 43.3 303.1 10.52733 -.54438861 3.8405667 0 0 0 1 0 0 0 1 Israel 2017 .2551538 7 43.3 303.1 10.61009 .24421053 3.5995555 0 0 0 0 1 0 0 1 Israel 2018 .2047327 7 43.3 303.1 10.63873 .81485215 3.5905581 0 0 0 0 0 1 0 1 Israel 2019 .3278704 8 43.3 346.4 10.68376 .84159653 3.5645273 0 0 0 0 0 0 1 2 Kuwait 2013 1.292079 6 25 150 10.80747 2.6822968 .28358944 1 0 0 0 0 0 0 2 Kuwait 2014 1.061399 6 25 150 10.69336 2.9089267 .28456714 0 1 0 0 0 0 0 2 Kuwait 2015 .8636156 6 33.6 201.6 10.30459 3.2717017 .30085203 0 0 1 0 0 0 0 2 Kuwait 2016 .7997411 6 33.6 201.6 10.22749 3.1983978 .30213744 0 0 0 1 0 0 0 2 Kuwait 2017 .6675166 6 33.6 201.6 10.3009 2.171833 .30334976 0 0 0 0 1 0 0 2 Kuwait 2018 .4845843 6 33.6 201.6 10.43395 .54313315 .30195649 0 0 0 0 0 1 0 2 Kuwait 2019 8 33.6 268.8 10.37449 1.091848 .30361116 0 0 0 0 0 0 1 3 Malta 2013 2.191424 0 36.5 0 10.07901 1.1802844 1 0 0 0 0 0 0 3 Malta 2014 2.17813 0 36.5 0 10.16619 .31030647 0 1 0 0 0 0 0 3 Malta 2015 1.959806 0 36.5 0 10.08591 1.1005483 0 0 1 0 0 0 0 3 Malta 2016 1.666705 4 36.5 146 10.13194 .64270277 0 0 0 1 0 0 0 3 Malta 2017 1.403631 4 36.5 146 10.21241 1.3643545 0 0 0 0 1 0 0 3 Malta 2018 1.210538 5 36.5 182.5 10.31339 1.1578236 0 0 0 0 0 1 0 3 Malta 2019 1.165716 5 36.5 182.5 10.2893 1.64206 0 0 0 0 0 0 1 4 Saudi Arabia 2013 .2676111 8 47.5 380 10.1204 3.5325247 3.75 1 0 0 0 0 0 0 4 Saudi Arabia 2014 .077274 8 47.5 380 10.10495 2.2362903 3.75 0 1 0 0 0 0 0 4 Saudi Arabia 2015 .2126785 8 47.5 380 9.934402 1.2060732 3.75 0 0 1 0 0 0 0 4 Saudi Arabia 2016 .3245146 8 47.5 380 9.897434 2.0688404 3.75 0 0 0 1 0 0 0 4 Saudi Arabia 2017 .4784981 8 47.5 380 9.942888 -.83819458 3.75 0 0 0 0 1 0 0 4 Saudi Arabia 2018 .6690173 8 47.5 380 10.05788 2.4581416 3.75 0 0 0 0 0 1 0 4 Saudi Arabia 2019 .6197107 8 47.5 380 10.04931 -2.0933333 3.75 0 0 0 0 0 0 1 5 United Arab Emirates 2013 1.895465 6 30.4 182.4 10.6552 1.1011184 3.6725 1 0 0 0 0 0 0 5 United Arab Emirates 2014 1.729302 7 30.4 212.8 10.68629 2.3462687 3.6725 0 1 0 0 0 0 0 5 United Arab Emirates 2015 1.61484 7 30.4 212.8 10.56265 4.0699661 3.6725 0 0 1 0 0 0 0 5 United Arab Emirates 2016 1.623702 7 30.4 212.8 10.54907 1.6174881 3.6725 0 0 0 1 0 0 0 5 United Arab Emirates 2017 1.666817 8 31 248 10.61263 1.9668256 3.6725 0 0 0 0 1 0 0 5 United Arab Emirates 2018 1.724629 8 31 248 10.68829 3.0686338 3.6725 0 0 0 0 0 1 0 5 United Arab Emirates 2019 1.86524 8 31 248 10.67136 -1.9310811 3.6725 0 0 0 0 0 0 1
Ngozi
Comment