I have a slight doubt with using text() with the label parameter having to contain a vector of of integers (specifically integers in the range [1, 21] corresponding to factors of my categorical variable that I want to numbers to tell).

What I'm currently plotting is the following command:

text(dta[trt == 0 & skin == 1 & gender == 0,]$age,invlogit(predict(fit5, newdata=dta[trt == 0 & skin == 1 & gender == 0,])),label=1:21, col = dta[trt == 0 & skin == 1 & gender == 0,]$exposure)

(it's a plot of a logistic model)

$exposure is the categorical variable that takes values of integers in the range [1, 21]. The coloring seems to work, but I'm not sure whether label=1:21 makes it so that it actually labels the point with the corresponding exposure level or whether it just walks through 1 to 21 and 1 to 21 over and over again.

Can someone explain?

Also how can I get the label parameter to put the number of the level of the exposure as the corresponding point?

______________________________________________
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to