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
Changing reference category in categorical variable gives more significant resultsHi everyone! I am new to statistics so I guess there is an obvious answer to this question, but I f…
Failure of extracting a regression table with -esttab- commandHello everyone, I want to modify then extract the regression table generated with -esttab- command …
Create peer groups by matching industry code with size quartile, per year.Hello all, I have panel data for years 1998-2020 about firm performance (stock returns). For my fut…
Generate new variableHey, in the panel study I am working with, there are two times the same variable (t34005a & t34…
dividing the dataset in 2 grouphello, I want to divide my data set into an intervention and control group but i don't know how …
Subscribe to:
Post Comments (Atom)
0 Response to Coding Loops
Post a Comment