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
Using marginsplot, category labels and plots overlap.I use Stata 15.1 SE on Windows 10. I am calculating predictive margins following an ologit in the sv…
Extracting coefficient from matrix after bayes commandCan anyone please suggest how I can extract the coefficient of my explanatory variable after using t…
Heteroskedasticity for Random EffectsHow can I test Heteroskedasticity in a Random Effects panel? I know xttest3 but it doesn't work in R…
How to write shorterHi reader, I would like to know how I could make these formulas a bit shorter, hope you can help. …
flag certain observationDear reader, I would like to flag a certain observation if it is the 24th observation starting at th…
Subscribe to:
Post Comments (Atom)
0 Response to Error while using _N in forvalues loop
Post a Comment