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
Looking for files issuesHello everyone, So I am doing an assignment. Our professor gave us zipped .dta files to use in Stat…
estpost with xtsumHi all I have used the command estpost sum esttab using nsw_12_summary_all.csv, cells("mean") to …
Finding a target variabel across datasets in the same directory*Hi, I've several datasets in the directory, and want to know which ones contain my variable of inter…
How to draw bivariate random vector (v,u) which is bivariate normal, but with a correlation which depends on a third variable x?Dear all, I would like to simulate some data: a bivariate random vector (v,u) which is bivariate no…
Fixed effects model with high rho and negative corr(u_i, Xb): a problem?I'm running some regression models with panel data from Brazilian municipalities (N = 64,708, Number…
Subscribe to:
Post Comments (Atom)
0 Response to Value label defining within a variable
Post a Comment