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
An issue using esttab syntaxHello, I would like to show the `y' variable in excel when running each of the following regressions…
Latent class analysis - constraining categorical variablesHi Statalist! I am trying to perform a latent class analysis and I am very new to this method, so I…
Comparing independent variables in different models with the samen depedent variableHello, I am running three multiple linear regression models. In all three, the dependent variable i…
Year and industry fixed efffectsHello; I have a paneldataset of the S&P 500 from 2002 to 2019 and need to implement industry an…
How to rename and format variables from appended tempfile?Hi Statalist, I'm trying to append, rename, format and generate new variables. may goals are to; 1.…
Subscribe to:
Post Comments (Atom)
0 Response to Using local variable in forvalues loop
Post a Comment