Hello guys,
I'm new to both Satata and R. I'm trying to do a regression to find the causal effect between the use of pesticides and birds' population, and i'm now using a Arellano-Bond estimator, i have this code for Satata and i want to convert it to R. I tried different versions but i don't even get the same sign of effect of the lagged dependant variable, in Satata its positive, while my versions in R give me a negative sign which doesn't make much of a sense since an increase in bird's population of the past period should have a positive impact on the bird population in the current period. Can you guys tell me how the correct code in R should be written?
Here's the Stata code
xtabond2 sum_grass_no L.sum_grass_no crop_acre total_neon develop_acre mtemp1 mtemp4 mtemp5 mtemp6 lag_mtemp12 pcpn1 pcpn4 pcpn5 pcpn6 lag_pcpn12 pop_den, gmm(L.( sum_grass_no ),lag(1 2)) iv(lag_fertp pest_price develop_acre mtemp1 mtemp4 mtemp5 mtemp6 lag_mtemp12 pcpn1 pcpn4 pcpn5 pcpn6 lag_pcpn12 pop_den, eq(diff) ) robust twostep
Also, i'm using the plm package on R and the the command is pgmm.
Thanks for the help!
Related Posts with Converting a code from Stata to R
Mininum edge weights in the path between two nodes (Network Analsysis)Dear Statalisters, (Stata version 15.1) I have a network N and I am using the user-developed packag…
How to allow for time-varying treatment effects and heterogeneous treatment subgroup effects in generalized DD?Hi all, I am running a generalized DD to estimate the effect on infant mortality rate (imr) of a he…
how to count the numbers of variables that meet some requirements in the matrix?I want to count the numbers of variables whose p value is less than .2 after running a regression mo…
fmm invalid nameI'm trying to run a finite mixture model Code: fmm 2: logit y x1 x2 x3 However, I get the error "2 …
Dropping lowest n values of a group variableHi, my question is a bit silly but I am just not being very bright today As you can see from the da…
Subscribe to:
Post Comments (Atom)
0 Response to Converting a code from Stata to R
Post a Comment