Dear All,

often I encounter variables, which have only few distinct values and an
inherent metric. An example would be a risk score, which classifies
patients in several groups like "low, intermediate, high, extreme" with
corresponding risk estimates of "0, 1, 2, 5.5".
In some cases, like tables and box-plots this score should be treated like
a factor, in other cases like cox-regression it should be treated like a
numeric variable.

Is there a convenient way to represent a variable like this?

The crucial point is that the variable should retain its numerical values
and its value labels. Without value labels it could be defined as factor
and used or directly or by as.numeric(), because the levels still represent
the numerical values, but as soon as labels are used, the original
numerical values get lost.

Thanks,

Heinz Tüchler

______________________________________________
[email protected] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

Reply via email to