I need 2 weeks to use RStudio (MacOS), so please forgive me if I missed an obvious function that would solve my problem.
As a project, I am trying to reproduce a cell graph with four graphs representing Net Benefit, provided that the disease type is “not severe” (0) or “serious” (1) as the x-axis label and this treatment is “speech therapy” (0) or “drug therapy” (1) as a marking of the x axis.
Here is my script:
tx <- c(0,0,0,0,1,1,1,1) dztype <- c(1,0,1,0,0,0,1,1) NBwtp1000 <- c(-5500,-4000,-5000,-1000,-5000,-5000,-2800,-2000) require(lattice) bwplot(NBwtp1000 ~ paste0("Tx ", tx) | paste0("Disease Severity ", dztype), xlab="Talk Therapy (Tx 0) or Drug Therapy (Tx 1)", ylab="Net Benefit @ wtp 1000", horizontal=FALSE)
If you run the code, you'll see a box-and-whisker graph: I'm almost there, thanks to some informative posts on this forum about the bwplot lattice bwplot .
However, I am still not happy with the result. I used the paste0 function to add line descriptors to the X axis paste0 for the treatment group (originally labeled “1,2” and now showing as “Tx 0, Tx 1”), but I would ideally want these sublayers to say “Talk Therapy” and "Drug Therapy", respectively. (I just did not know how to do away with existing numerical labels.)
Likewise, I would like the panel labels to say “Not Severe,” where the label is currently 0 and “Severe,” where the label is currently 1.