Hi all,
I've recently moved to STATA from more point-and-click interfaces (i.e. SPSS), and am having trouble adapting to syntax use. I've recently came across an issue while running a simple loop. It's been an aggravating couple of hours.
Specifically, I am trying to replace the values in 'rows' 166, 185, 198, 205, etc... with the word "missing".
Please see:
foreach x in 166 185 {
2. replace example_variable_1_text = "missing" in "`x'"
3. }
'"166' invalid observation number
r(198);
Many thanks,
Shawn
Related Posts with Coding Loops
Use Margins for Interaction terms when model does not support factor notationHi Statalist My question is about how we can get Margins commands to work correctly when the estima…
My R value is a period?Hello, I am deeply sorry if this has been answered somewhere and I just not have found the right ke…
Local loop line graphHello, I am trying to make a line graph with 25 lines, one for each department, but I keep getting 2…
STATA 16 Update ErrorI was unable to update Stata 16 on win 10. The screenshot says Array My first guess is the permss…
Forecasting Personal Consumption expenditure: foodHello, I am forecasting PCE: food and I was wondering what is the best method to forecast. Would an …
Subscribe to:
Post Comments (Atom)
0 Response to Coding Loops
Post a Comment