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