SCM

SCM Repository

[latticeextra] Diff of /pkg/man/panel.quantile.Rd
ViewVC logotype

Diff of /pkg/man/panel.quantile.Rd

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 64, Mon Dec 21 06:37:33 2009 UTC revision 148, Tue Jun 1 11:51:52 2010 UTC
# Line 5  Line 5 
5  }  }
6  \description{  \description{
7    Plot a quantile regression line with standard error bounds, using the    Plot a quantile regression line with standard error bounds, using the
8    \pkg{quantreg} package. This is based on the \code{\link[ggplot2]{stat_quantile}}    \pkg{quantreg} package. This is based on the
9    function from \pkg{ggplot2}.    \code{\link[ggplot2]{stat_quantile}} function from \pkg{ggplot2}.
10  }  }
11  \usage{  \usage{
12  panel.quantile(x, y, formula = y ~ x, method = "rq", ...,  panel.quantile(x, y, form = y ~ x, method = "rq", ...,
13      tau = 0.5, ci = FALSE, ci.type = "default", level = 0.95,      tau = 0.5, ci = FALSE, ci.type = "default", level = 0.95,
14      n = 100, col = plot.line$col, col.se = col,      n = 100, col = plot.line$col, col.se = col,
15      lty = plot.line$lty, lwd = plot.line$lwd,      lty = plot.line$lty, lwd = plot.line$lwd,
# Line 23  Line 23 
23  \arguments{  \arguments{
24    \item{x, y}{    \item{x, y}{
25      data points. If these are missing, they will be looked for in the      data points. If these are missing, they will be looked for in the
26      \code{formula} environment. So in many cases you can skip these if      environment of \code{form}. So in many cases you can skip these if
27      passing \code{formula}. In fact, for convenience, the \code{formula}      passing \code{form}. In fact, for convenience, the formula
28      can be passed as the first argument (i.e. \code{x}).      can be passed as the first argument (i.e. \code{x}).
29    }    }
30    \item{formula, method}{    \item{form, method}{
31      the model is constructed (approximately) as      the model is constructed (approximately) as
32      \code{method(formula, tau = tau, data = list(x=x, y=y), ...)}.      \code{method(form, tau = tau, data = list(x=x, y=y), ...)}.
   
33      See the Examples section for common choices.      See the Examples section for common choices.
34    }    }
35    \item{\dots}{    \item{\dots}{
# Line 79  Line 78 
78    \code{\link[ggplot2]{stat_quantile}}    \code{\link[ggplot2]{stat_quantile}}
79  }  }
80  \examples{  \examples{
81    library("quantreg")
82    
83    set.seed(1)
84  xy <- data.frame(x = runif(100), y = rt(100, df = 5))  xy <- data.frame(x = runif(100), y = rt(100, df = 5))
85  xyplot(y ~ x, xy) +  xyplot(y ~ x, xy) +
86    layer(panel.quantile(x, y, tau = c(.05, .5, .95)))    layer(panel.quantile(x, y, tau = c(.95, .5, .05)))
87    
88  if (require("splines")) {  if (require("splines")) {
89    xyplot(y ~ x, xy) +    xyplot(y ~ x, xy) +
# Line 92  Line 94 
94  }  }
95    
96  xyplot(y ~ x, xy) +  xyplot(y ~ x, xy) +
97    layer(panel.quantile(x, y, tau = c(.1, .5, .9), superpose = TRUE))    layer(panel.quantile(x, y, tau = c(.5, .9, .1), superpose = TRUE))
   
98  update(trellis.last.object(),  update(trellis.last.object(),
99    key = simpleKey(paste(c(10,50,90), "\% quantile"),    auto.key = list(text = paste(c(50,90,10), "\% quantile"),
100                    points = FALSE, lines = TRUE))                    points = FALSE, lines = TRUE))
101    
102  ## seems not to work...  ## seems not to work...

Legend:
Removed from v.64  
changed lines
  Added in v.148

root@r-forge.r-project.org
ViewVC Help
Powered by ViewVC 1.0.0  
Thanks to:
Vienna University of Economics and Business Powered By FusionForge