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
Choose Referans CatogryHello, I m working on a panel with GMM. I want to choose the reference category by myself. However, …
AverageHow should I proceed in the following situation: - I have the earnings of population in 2004 and 200…
Too many values error when trying using tabulate commandHi I am trying to create a table showing the distribution of age of first marriage across many diffe…
Fe glsHello, My data is suitable for FE model but with heteroscedasticity and autocorrelation, I want to c…
Understanding Monte Carlo simulations in "When Should You Adjust Standard Errors for Clustering?" (Abadie at al, 2017)Hi statalist members, This is my first post here so pardon me if I deviate from the established eti…
Subscribe to:
Post Comments (Atom)
0 Response to Generate vars with conditions inside a loop
Post a Comment