Dear Community,
I am trying to generate a dummy for current Y and N values.
My code looks like this:
gen CGCPO09Vbyte = .
replace CGCPO09Vbyte = 1 if CGCPO09V == "Y"
replace CGCPO09Vbyte = 0 if CGCPO09V == "N"
However, Stata makes no changes when I use this command:
. gen CGCPO09Vbyte = .
(11,894 missing values generated)
. replace CGCPO09Vbyte = 1 if CGCPO09V == "Y"
(0 real changes made)
. replace CGCPO09Vbyte = 0 if CGCPO09V == "N"
(0 real changes made)
It does not recognize the Y and N, and I do not know how to solve this.
The variable list looks like this:
Please let me know what I am doing wrong, thank you in advance
I am trying to generate a dummy for current Y and N values.
My code looks like this:
gen CGCPO09Vbyte = .
replace CGCPO09Vbyte = 1 if CGCPO09V == "Y"
replace CGCPO09Vbyte = 0 if CGCPO09V == "N"
However, Stata makes no changes when I use this command:
. gen CGCPO09Vbyte = .
(11,894 missing values generated)
. replace CGCPO09Vbyte = 1 if CGCPO09V == "Y"
(0 real changes made)
. replace CGCPO09Vbyte = 0 if CGCPO09V == "N"
(0 real changes made)
It does not recognize the Y and N, and I do not know how to solve this.
The variable list looks like this:
Please let me know what I am doing wrong, thank you in advance

Comment