Hi,
I have a question, why the next sintaxis(with conditions) is not possible?
foreach i of numlist 1/30{
gen brd1=c if i>10
gen brd2=c if i>15
gen brd3=c if i>25
gen brd4=c if i>30
}
When I run "brd1" the values are between 1/30, and I want values between 1/10.
Thanks for your help.
S.
Related Posts with Generate vars with conditions inside a loop
Dark themeI have STATA 17 on Linux. I use a Linux dark theme for my desktop. Stata generally respect the the…
define a dummy with cond()Dear All, Suppose the data set is Code: * Example generated by -dataex-. For more info, type help d…
For elimination a specific group in a variable X on panel dataDear All users, I try to panel regression using panel data. I need to capture effect here that, Yi…
Generating average variable of previous observationsHi All, I am writing my Bachelor thesis which is about how total payout policy (dividends + share r…
Clustering Industry typesI have constructed the following one year lagged regression of ESG on ROA. However, I do not get an …
Subscribe to:
Post Comments (Atom)
0 Response to Generate vars with conditions inside a loop
Post a Comment