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
guide of panel analysis (for beginner with STATA)I need an easy practical guide (paper) to study panel data. Starting from the beginning (import an e…
Category selectionhae guys can someone help me in previous post please!am stack. …
Category selectionHae guys kindly help me figure out this.i have a integer variable which is categorized into 3 measur…
Category selectionHae guys kindly help me figure out this.i have a integer variable which is categorized into 3 measur…
Foreach loop with tabsHello Statalist! This is my second post here; my first one ended up with quite helpful responses, so…
Subscribe to:
Post Comments (Atom)
0 Response to Value label defining within a variable
Post a Comment