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: Fatal error: you must specify '--save', '--no-save' or '--vanilla'. I would be grateful if you could advise something to address this issue.
Code:
. global ado "/Users/smp462/Desktop/State/twang/ado files" adopath + "$ado" mnps st $demo $race $income $edu $married $dual $living $area $health1 $health2 i.year, /// ntrees(3000) intdepth(3) shrinkage(0.01) /// stopmethod(es.mean ks.mean) estimand(ATE) /// rcmd(/usr/local/bin/r/) /// objpath(/Users/smp462/Desktop/Stata/twang/output) /// plotname(/Users/smp462/Desktop/Stata/twang/mnps_example_plot.pdf) Running R script, please wait... ARGUMENT '/Users/smp462/Desktop/Stata/twang/output/mnps.R' __ignored__ Fatal error: you must specify '--save', '--no-save' or '--vanilla' Error: R did not complete successfully. file /Users/smp462/Desktop/Stata/twang/output/mnps.Rout not found r(601);
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_example_plot.pdf) save C:\Users\username\twang\output\aod_ate_wgts, replace
0 Response to mnsp command to execute R in Stata
Post a Comment