Hello,
In a dataset (I didn't create it myself), there is a variable "VarC" that is set as "character", because most values are such "AA, "AB, "BB", etc. However, for missing values, some are numbers, some are set as a dot (.) and some have nothing at all. I would like to create a variable VarA (numeric) where all those missing values are set as a dot.
I tried this
if VarC=VarB then VarA=0;
if VarC ne VarB then VarA=1;
if VarC in ('99', '5', '6', '7', '8', '9', '10', '11', '12', '13', '14', '.', ' ') then VarA=.;
However, it results as this. Some of the '99' have not been transformed and I can't figure out why. Also, I have no idea how to select the dot values of VarC. I tried with '.' but it didn't pick them up.
Table of COUNTR1Ycar by migration
VarC
VarA
.
0
1
29997.7
0
0
.
0
0
4556.41
99
0
0
58.4293
10
4.40122
0
0
11
6.82265
0
0
12
3.34725
0
0
13
6.78349
0
0
14
5.68027
0
0
5
4.65671
0
0
6
12.3363
0
0
7
9.62901
0
0
8
4.04315
0
0
9
4.61319
0
0
99
4394.16
0
0
AD
0
0
2.3538
AE
0
0
1.16401
…
..
…
…
... View more