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
Multiple Line Graph of MeanHello! I'm very new to Stata (I just started using it yesterday) and I'm trying to figure out how t…
Differences between cap and quiDear all, does anyone know the differences between the commands capture and quietly? So far it seem…
dropping per ID if condition is metHi Statalist, I can't seem to fulfill the following in stata, perhaps one of you would know the ans…
Introducing 'pmanage' utility to efficiently compile large projects and detects I/O errorsWe are pleased to introduce pmanage, a utility that leverages Robert Picard's project to efficiently…
Count Command in StataHello STATALIST, This is a silly question, but I need to create a table that shows the frequency of …
Subscribe to:
Post Comments (Atom)
0 Response to <istmt>: 3301 subscript invalid r(3301) when rdplot in nested loop
Post a Comment