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
New Stata module for robust estimation of production functionsA new Stata module for robust estimation of production functions is now available at the SSC archive…
How to change dot appearance in a marginsplot with recast(dot)?Hello all, Title is self explanatory. I'm presenting margins output in a marginsplot, and I'm choos…
ISOweek from dates in Stata: Code belowThere is no direct command for generating the ISOweek (ISO8601) from a date in Stata. The following …
Multi-level multiple imputation in a longitudinal dataset with three levelsI have a longitudinal dataset that is hierarchical in nature with repeated measures of outcomes take…
Summing a row for one observation onlyDear all, I would like to sum values that are in the same row but on different columns. For instanc…
Subscribe to:
Post Comments (Atom)
0 Response to Coding Loops
Post a Comment