I'd like to estimate propensity scores for multiple treatments and try to use the mnps command in Stata (https://www.rand.org/statistics/twang/downloads.html). I have followed the codes suggested by online tutorial. However, I am facing the following error: Array
my Code:
use C:\Program Files (x86)\Stata14\ado\base\6.20.dta,clear
global ado "C:\Program Files (x86)\Stata14\ado\base\adofiles"
adopath + "$ado"
mnps i.insurancedstatus i.race i.sex i.diagnisticperiod i.subtype i.summarystage i.age i.marriedstatus i.ses, ///
ntrees(3000) intdepth(3) shrinkage(0.01) ///
stopmethod(es.mean ks.mean) estimand(ATE) ///
rcmd(C:\Program Files\R\R-4.0.2\bin\Rscript.exe) ///
objpath(C:\Program Files (x86)\Stata14\ado\base\output4) ///
plotname(C:\Program Files (x86)\Stata14\ado\base\mnps_example_plot.pdf)
save C:\Program Files(x86)\Stata14\ado\base\aod_ate_wgts,replace
FYI, the following is the codes suggested by online tutorial (https://www.rand.org/statistics/twan...-tutorial.html).
Code:
mnps treat illact crimjust subprob subdep white, ///
ntrees(3000) intdepth(3) shrinkage(0.01) ///
stopmethod(es.mean ks.mean) estimand(ATE) ///
rcmd(C:\Program Files\R\R-3.3.1\bin\Rscript.exe) ///
objpath(C:\Users\username\twang\output) ///
plotname(C:\users\username\twang\output\mnps_examp le_plot.pdf)
save C:\Users\username\twang\output\aod_ate_wgts, replace
Thank you in advance!
Related Posts with mnPS command to use twang with stata for multiple treatments
estimated values by margins after mixed vs. observed values by sumHi, Here is the data set I am analyzing. It is in a long format: 3-time points (time=1, 2, and 3 ) …
adding zeros before the valueHello, I have this dataset and want to add 0s to before Company if the Company length is less that 6…
Facing Heteroscadcity in unbalanced panel dataHi There are two models. Data taken from only 1 country and there are 25 institutes. total observati…
Obtaining the 95% confidence interval overlapHi, My actual dataset includes my quantities of interest (A, B, C, and D) obtained from 1000 bootstr…
[STATA 17] Problem with using newly installed commandHello Stata people, I hope everything is fine with you!! I recently purchased a STATA version 17 …
Subscribe to:
Post Comments (Atom)
0 Response to mnPS command to use twang with stata for multiple treatments
Post a Comment