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
Multiple Imputation and mi stset for Cox RegressionDear Stata List I have a good sized data set ( >6000 records) of health data. In this data set I…
esttab LaTex export problem Hi everyone, I have encountered a problem and could not find a resource which discusses it. I am ex…
New packages available on SSC: comtrade and htmltab2stataThanks two Kit Baum two new packages are available on SSC. comtrade comtrade downloads trade data f…
How to using instrumental variables in gologit2There is a mutual causal relationship between the independent variable and the dependent variable in…
Change legend automatically in graphDear Statalists, Suppose I have a data like this Code: * Example generated by -dataex-. To insta…
Subscribe to:
Post Comments (Atom)
0 Response to Value label defining within a variable
Post a Comment