Skip to content

Lattice: How to draw curves from given formulae

2 messages · John Smith, Deepayan Sarkar

#
On Mon, Aug 4, 2008 at 1:39 PM, John Smith <zmring at gmail.com> wrote:
Here's one solution.

xyplot(flat(d) + linear(d) + logistic(d) +
       umbrella(d) + emax(d) + sigmoid(d) ~ d,
       data = list(d = seq(0, 8, length = 101)),
       ylab='Expected change from baseline in VAS at Week 6', xlab='Dose',
       type = "l", outer = TRUE,
       strip = strip.custom(factor.levels =
          c("FLAT", "LINEAR", "LOGISTIC", "UMBRELLA", "EMAX", "SIGMOID")))

-Deepayan