Dear Stata user, I am trying to define the value labels within a variable using the "if" code as follows. But something is wrong in my code, please suggest me
sysuse cancer.dta
label define z 1 "died" if drug==1 | drug==2
label values died z
My objective is to define value label for the variable "died", where 1 will have died if drug==1 or drug==2.
Similarly, 0 will have alieve if drug==3
Related Posts with Value label defining within a variable
How to run multiple likelihood-ratio tests using loop function on StataHi everyone, I am new to Stata. I would really appreciate any help you would provide me. I ran 209…
plabel(_all percent) with graph pieArray I have to graph a pie in stata. Everything is perfect exept I'm not able to see all percent …
Correlation between two observations across multiple variablesHello fellow Stata users: I have a panel dataset of patenting footprints of various companies. Each…
Testing for heteroskedasticity after xtregarHow do I test for heteroskedasticity after xtregar? My code is below: xtregar gp expansion populatio…
How to drop a missing seriesHello, I have a panel data set, extracted using Stata wbopendata package. I want to drop a country i…
Subscribe to:
Post Comments (Atom)
0 Response to Value label defining within a variable
Post a Comment