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
odksplit for ODK and SurveyCTODear all, I am happy to announce that odksplit is now available in ssc. odksplit is a module to spl…
NIS database helpHi, I am realtively new to large database analysis and trying to work on the NIS 2011 database. Does…
nbreg only converges when starting from poisson estimatesI am using nbreg (Stata MP 15.1) to analyze the rate of days on which patients use two different dru…
Multinomial logistic regression - RRR is too bigHi, I am running a regression where a firm performance measure ( a categorical variable) is regress…
Trying to save collapsed files - invalid file specification errorHello, I am trying to collapse all files in a folder and replace the old files with the new ones. S…
Subscribe to:
Post Comments (Atom)
0 Response to Value label defining within a variable
Post a Comment