Hi everyone,
I'm fairly new to STATA and this one practice problem has been driving me crazy...I would really appreciate any help...
I'm trying to create a local variable that lists only the “long name variables of more than 8 characters in a dataset
So far I have
foreach var of varlist *{
display "`var'"
if length("'var'")>8 {
}
}
Which generates an error message. I've tried several other configurations but none has worked. Any guidance would really be appreciated!
Related Posts with Using if statements using foreach
Gregory Hansen mixed resultsHi All, I need some advice. I have performed the Gregory Hansen test for cointegration to check fo…
Choosing the best model- Panel data regression analysisHi, I am new in this forum, I read many useful comments related to panel data analysis. I am from fi…
ScatterplotHello, I need to create a figure such as the one below. How can I do it? I'd like to show the correl…
Levene’s testDear researchers, I have unbalanced panel data for more than 200 firms for the period that extend fr…
event study approach: coefficients different between 2 groupsHi there, I am working with an event study approach to see if the effect of becoming a parent on ea…
Subscribe to:
Post Comments (Atom)
0 Response to Using if statements using foreach
Post a Comment