Hi everyone,
I am trying to run the following code:
count if productcode == 21
scalar nobs = r(N)
local n nobs
forvalues b = 1(1)`n' {
display `b'
}
However, I get invalid syntax error. Can anyone help me on this issue? Thanks in advance.
Best,
Ulas
Related Posts with Using local variable in forvalues loop
Getting end date of the monthDear all, Suppose I have the following dataset Code: clear input str8 yearmonth "1960m1" "1960m2…
How to get the standard errors for marginal effects that is calculated based on estimated coefficients and a spatial matrix?I am calculated the long-run and short-run marginal effects of a variable in a spatial dynamic panel…
[putdocx] problem about tostring with comma, table fontHello. I am making some report using -putdocx- command. My data is like following result table. C…
Saving intermediate matrices from a loop using post?Dear Stata community, I want to save matrices from each iteration of an r-class program which I am …
CrosstabulationsHi- Why does the sample size need to be larger if the table is bigger than a 2x2 for cross tabulatio…
Subscribe to:
Post Comments (Atom)
0 Response to Using local variable in forvalues loop
Post a Comment