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
Panel data Fractional Response Models with a binary Endogenous explanatory variables and a binary instrumentHello, I am estimating the balanced panel data for the model where the dependent variable is a fract…
Problem with outfileHi! I am using the outfile command to export a dataset.dta into csv: outfile using dataset.csv, co…
Dropping all the variables that are positioned after a variable.Hi, I would like to drop all the variables that are positioned after a given variable of my dataset…
Maybe the dumbest question everHello, I'm new to Stata. I have hunted around and can't seem to find a simple answer to what I'm sur…
ADF unit root testHello everyone. I am new on ADF unit root test and I want to ask something related to the ADF unit …
Subscribe to:
Post Comments (Atom)
0 Response to Generate vars with conditions inside a loop
Post a Comment