Hello everyone. I am new to Stata. I need your help for a short question.
I have a dataset, and I hope to write a loop that counts from a value I set, say, 300, to the total number of observation. This is my code:
import excel "data/xyz.xlsx", firstrow case(lower) clear
sca start_obs = 300
foreach i = start_obs/`r(N)'{
display `i'
}
However, I got error message repetatedy "invalid syntax". How may I write the loop to make it work?
I appreciate your help!!
Related Posts with forval with a variable
Non-linear IV: Dependent count variable and binary endogenous variableHallo I have a problem in my research project where my dependent variable is a (very dispersed) cou…
Using Local in a LoopHello everyone, I'm having a problem commanding a local to do a function. The idea of the whole loo…
Marginplot and Khb graphDear statalists, It is my first post on this forum, so i hope that i won't wrong section or formulat…
Binary Variable for all years in panel dataHello, I will preface by saying the data i am using is confidential so i cannot share the whole file…
Standard DeviationIn my panel data, There are 20 individuals and 32-time points. Within the data set, the "Exchange ra…
Subscribe to:
Post Comments (Atom)
0 Response to forval with a variable
Post a Comment