Hello, everyone! This is my first post on the forum.
I am having difficulties when either dropping or keeping string variables. I have a 3-wave longitudinal dataset with 17 different European countries. Variable name: "country"; categories: "Austria," "Belgium," etc. I want to drop all the other countries form the dataset.
This is what I've tried so far:
1. keep if country=="Belgium"
I keep getting error r(111). Then I tried dropping the other countries, and it didn't work.
2. I then tried the the destringing and recording commands to turn the "country" variable into a numeric variable (thinking that I might have to be numeric in order to use the keep command like in some other software), but that didn't work either. I get error r(199).
Does anybody have any information to offer about what I'm doing wrong?
Thanks for your help!
I am having difficulties when either dropping or keeping string variables. I have a 3-wave longitudinal dataset with 17 different European countries. Variable name: "country"; categories: "Austria," "Belgium," etc. I want to drop all the other countries form the dataset.
This is what I've tried so far:
1. keep if country=="Belgium"
I keep getting error r(111). Then I tried dropping the other countries, and it didn't work.
2. I then tried the the destringing and recording commands to turn the "country" variable into a numeric variable (thinking that I might have to be numeric in order to use the keep command like in some other software), but that didn't work either. I get error r(199).
Does anybody have any information to offer about what I'm doing wrong?
Thanks for your help!
Comment