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
Filling in missing values in long dataI have some sample data pasted below. Code: * Example generated by -dataex-. To install: ssc instal…
Esttab - Compress labelsHi everyone, Is there a way to compress labels in esttab command? If two variables from two regress…
Hausman Test - "V_b-V_B is not positive definite" appearsBackground of question I am an economics student, currently writing my bachelor thesis, and quite i…
Wilcoxon rank sum test for more than 3 groups?So Stata is not letting me do a rank sum test for more than 3 groups with the command: ranksum score…
Histogram by groupsHello, I would like to know the code to create a bar graph with the values of the receipts of each …
Subscribe to:
Post Comments (Atom)
0 Response to <istmt>: 3301 subscript invalid r(3301) when rdplot in nested loop
Post a Comment