Hi Community,
I'm writing a nested Loop with Stata,
the Variable Cur is a numeric with label, and I want to do rdplot for each Cur,
with running variable in each of h_pes h_med and h_opt, with any cutoff of 0.1-0.9
Here's the code:
forval frx = 1/6{
preserve
keep if Cur == `frx'
local curname: label Cur `frx' // 取回Cur = `frx' 对应的label
foreach v in h_pes h_med h_opt {
forval i = 1/9{
local cut = `i'/10
local title = "Cur_`curname'_Cutoff_`i'_`v'"
rdplot exchange `v', c(`cut') ti("`title'") ///
name(fig`frx', replace)
}
}
restore
}
But I get ERROR:
<istmt>: 3301 subscript invalid
r(3301);
Does Anyone has an idea about what's happening?
Related Posts with <istmt>: 3301 subscript invalid r(3301) when rdplot in nested loop
Expanding years for mergingDear Statalist William Lisowski I would like to generate the year 2009, 2010, 2012, 2013, 2015, 201…
What is the syntax of Panel ARDL model with DCCE estimator (xtdcce2)?Dear all, I am learning Stata and trying to find out how to use the xtdcce2? I installed xtdcce2 v…
Reporting Adjusted R2 on StataHello Everyone! I am new to STATA and I am having trouble reporting the Adjusted R2 When I run a re…
Different results in Propensity Scores from probit reg using probit and psmatch2 probit.I'm trying to estimate the AT on my treated group using psmatch2. I don't get why the probit regress…
Export a table in a descriptive statistics/reg format to doc fileHello, I am trying to export my statistics table to doc, in a "publication format". I have: income…
Subscribe to:
Post Comments (Atom)
0 Response to <istmt>: 3301 subscript invalid r(3301) when rdplot in nested loop
Post a Comment