Hi all,
I have this kind of reproducible code:
What I would expect is for it to produce a column with "a, b, c, d,...". Instead, I get a column full of "L".
I also checked Statalist but could not figure out why the code is not working.
I'm sure it's a silly mistake, but I find myself stuck.
Thank you
I have this kind of reproducible code:
Code:
clear
set obs 10
gen str names = ""
gen num = _n
su num, meanonly
di `r(max)'
local abc a b c d e f g h i l
forval i = 1/`r(max)' {
foreach x of local abc {
replace names=`"`x'"' if num == `i'
}
}
I also checked Statalist but could not figure out why the code is not working.
I'm sure it's a silly mistake, but I find myself stuck.
Thank you

Comment