|Subject||st: Data manipulation question|
|Date||Fri, 14 Nov 2003 10:00:42 +0100|
I have discovered errors in my dataset, and it seems some of my data are recorded in the wrong variable. The variable the data should have been recorded as, is left missing. A few examples: (Missing values marked as "")
Record CarManufacturer CarModel CarEngine
1 Ford Mustang .
2 Chevrolet Starcraft .
3 Ford Galaxy .
4 Honda Civic 1.4 I S
6 "" Ford Excursion .
7 "" BMW 520 I Touring 520 I
8 "" 318 BMW
9 BMW 320 I 320 I
10 Alfra Romeo Spider .
11 "" Alfa Romeo .
What I wish to do is to search for an expression in each record that can also be observed as a distinct value in CarManufacturer, and then replace it into CarManufacturer. I have failed in both creating tests across records and on an attempt to fetch the unique values of CarManufacturer into an object which I then can perform checks against. But then again, I'm no seasoned veteran in this game.
Is there any way of pulling this off in Stata?