Open crsh opened 8 years ago
scale() changes the meaning of the variable so IMHO it would be inappropriate to keep the label. Frank
On 10/19/2015 05:33 AM, Frederik Aust wrote:
I really like the |label()| function. I have recently noticed that when I scale a variable this label attribute is lost. I haven't had time to go deeper into this, hence, I'm not sure if this problem is specific to |scale()| (and could be fixed by adding a |scale.labelled|-method) or needs a more general solution. I may take a closer look at some point, but I wanted to bring it to your attention in case I forget.
— Reply to this email directly or view it on GitHub https://github.com/harrelfe/Hmisc/issues/31.
Frank E Harrell Jr Professor and Chairman School of Medicine
Department of *Biostatistics* *Vanderbilt University*
Thanks for the quick reply.
I agree it renders the "units" attribute useless, but doesn't, e.g., a scaled household income variable nonetheless represents household income?
Not in an exact sense, and some people put units of measurement inside the labels.
On 10/19/2015 09:30 AM, Frederik Aust wrote:
I agree it renders the "units" attribute useless, but doesn't, e.g., a scaled household income variable nonetheless represents household income?
— Reply to this email directly or view it on GitHub https://github.com/harrelfe/Hmisc/issues/31#issuecomment-149231899.
Frank E Harrell Jr Professor and Chairman School of Medicine
Department of *Biostatistics* *Vanderbilt University*
I really like the
label()
function. I have recently noticed that when I scale a variable this label attribute is lost. I haven't had time to go deeper into this, hence, I'm not sure if this problem is specific toscale()
(and could be fixed by adding ascale.labelled
-method) or needs a more general solution. I may take a closer look at some point, but I wanted to bring it to your attention in case I forget.