I'm trying to write a loop that will remove all observations except those from a specific data point.
The code I've written:
What stata gives me is:
Is this because my Location variable is a part of var _all?
If so, how do I write a loop that will remove all observations except those that belong to a specific type of observation designated by Location number 19?
The code I've written:
Code:
foreach i of var _all { replace `i' = . if Location != 19 }
Code:
type mismatch r(109)
If so, how do I write a loop that will remove all observations except those that belong to a specific type of observation designated by Location number 19?
Comment