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
How to tag the most recent fiscal year end value based on the calandar time?Dear Stata experts, I would like to find the most recent fiscal-year-end investment based on the ca…
Creating a Panel and Column namesHi, How could get the first row first Column: Germany to become a panel (so to match each observati…
nlcom after elastic net?Hi! I have used the user-written cvlasso (Ahrens, A., Hansen, C.B., Schaffer, M.E. 2018. cvlasso: Pr…
Did Stata 15 Change Loops?I just updated to Stata 15 and now a code I consistently use is broken. Have I overlooked something …
A question on insheetjson - Keep getting "Invalid column name/selector" error message when using -insheetjson-I am trying to get some data from the API of American Community Survey by using insheetjson. But whe…
Subscribe to:
Post Comments (Atom)
0 Response to Error while using _N in forvalues loop
Post a Comment