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
Restructure Survival DatasetHi, I have survival data and I would like to change the structure of the dataset. stnum=patient id s…
How to compare two ivregress models with two independent samplesHi there, I want to compare two ivregress models with two independent samples. I am trying to see i…
3 slsHi everyone, I am quite new to use Stata for 3 stage least square. Please help! I would like to est…
r(198) errorI'm trying to use prior code to create a Turnip plot in STATA 11.2. I keep getting a r(198) error wh…
recreating the output from -margins- with interactionsI am trying to understand Stata's -margins- command by recreating results by hand, and I am getting …
Subscribe to:
Post Comments (Atom)
0 Response to Using local variable in forvalues loop
Post a Comment