I want to use _N in place of the total count of observations in a loop like this:
forvalues i = 1(1)_N {
}
instead of directly putting the number. But I'm getting an "Invalid syntax" error. Can anyone help me with this or suggest any alternative?
Related Posts with Error while using _N in forvalues loop
Why the ''observations" in the regressions are not integers?Dear friends, I have run some simple 2sls regressions. Some results show that the observations are n…
Extract numbers (with varying lengths) from variable labelHi friends, I now face the following problem: Code: webuse auto,clear lab var make "STATA#1, 90" …
Creating LoopHi I have codes for a few states - {3,4,5,6,1} and years -{ 2007,2008} and indexes- {3,5,2,4,5,2,4,…
Esttab Indicate Option - Not Turning Off (Yes Instead of No)Hi all! I am using Stata 16. I am having an issue with esttab. I am running several regressions, an…
Questions on Stata command terminologyIf my indepvar is agegroup and have been categorized 31 to 40, 41 to 51 60 above 1. What is the su…
Subscribe to:
Post Comments (Atom)
0 Response to Error while using _N in forvalues loop
Post a Comment