I\'m 2 weeks into using RStudio (MacOS) so please forgive me if I\'m overlooking an obvious function that would solve my problem.
As a project, I am attempting to reprod
The simplest way as far as I can see is to convert your tx
and dztype
to factors with the appropriate level names.
tx <- factor(tx, levels=c(0,1), labels=c("Talk Therapy", "Drug Therapy"))
dztype <- factor(dztype, levels=c(0,1), labels=c("Not severe", "Severe"))
bwplot(NBwtp1000 ~ tx | dztype, xlab="Talk Therapy or Drug Therapy",
ylab="Net Benefit @ wtp 1000", horizontal=FALSE)
Another solution is to use argument scale
for the tx
levels and argument strip
for dztype
:
tx <- c(0,0,0,0,1,1,1,1)
dztype <- c(1,0,1,0,0,0,1,1)
bwplot(NBwtp1000 ~ tx | dztype, xlab="Talk Therapy or Drug Therapy",
ylab="Net Benefit @ wtp 1000", horizontal=FALSE,
scales=list(x=list(labels=c("Talk therapy","Drug Therapy"))),
strip=strip.custom(var.name="Disease severity",
factor.levels=c(" Not Severe", "Severe"),
strip.levels=rep(TRUE,2)))