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
estimate gravity model to calculate potential trade by uisng OLS, REM, FEM, TOBIT and PPLMHi everyone, I'm new here. I am working on my Ms.thesis. the topic related to DETERMINANTS AND POTEN…
Egen with an if statementHi, I have a long dataset with multiple observations per patient id. I’m trying to generate a medic…
Remove combination of quotes and asterisk in variable labelHi all, I have a extrange combination of quotes and asterisk in variable label in my data base... L…
One way random effects estimationHow do I run one way rand effects estimation on panel data set …
Problem running synth_runner commandHi there! I'm having problems running synth_runner command. There are various treated units giving a…
Subscribe to:
Post Comments (Atom)
0 Response to Using if statements using foreach
Post a Comment