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
Unbalanced Panel data to balanced panel data for 5 YearsDear All I have an unbalanced panel data from year 2006 to year 2018. There are firms with data as …
caterpillar plot for multi level analysisHi, I would be grateful for some advice please. I have done a multi level regression analysis. Leve…
Crossed random effects model not working after update to Stata/MP 16.1 if sample size exceeds 50 000Dear Statalisters, I've found that a fairly simple crossed random effects multilevel model I estima…
'Wrong' sign with fixed effectsHi there, I was hoping to get help regarding a change is signs of a coefficient when using fixed ef…
Calculating distance for intensity analysis using DiDHello, I am currently trying to calculate distance between conflicts and population clusters. I wou…
Subscribe to:
Post Comments (Atom)
0 Response to forval with a variable
Post a Comment