SCM

SCM Repository

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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 61 - (view) (download) (as text)

1 : felix 61 \name{panel.quantile}
2 :     \alias{panel.quantile}
3 :     \title{
4 :     Plot a quantile regression line with standard error bounds.
5 :     }
6 :     \description{
7 :     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}}
9 :     function from \pkg{ggplot2}.
10 :     }
11 :     \usage{
12 :     panel.quantile(x, y, formula = y ~ x, method = "rq", ...,
13 :     tau = 0.5, ci = FALSE, ci.type = "default", level = 0.95,
14 :     n = 100, col = plot.line$col, col.se = col,
15 :     lty = plot.line$lty, lwd = plot.line$lwd,
16 :     alpha = plot.line$alpha, alpha.se = 0.25, border = NA,
17 :     superpose = FALSE,
18 :     ## ignored: ##
19 :     subscripts, group.number, group.value,
20 :     type, col.line, col.symbol, fill,
21 :     pch, cex, font, fontface, fontfamily)
22 :     }
23 :     \arguments{
24 :     \item{x, y}{
25 :     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
27 :     passing \code{formula}.
28 :     }
29 :     \item{formula, method}{
30 :     the model is constructed (approximately) as
31 :     \code{method(formula, tau = tau, data = list(x=x, y=y), ...)}.
32 :    
33 :     See the Examples section for common choices.
34 :     }
35 :     \item{\dots}{
36 :     further arguments passed on to the model function (\code{method}),
37 :     typically \code{\link[quantreg]{rq}}.
38 :     }
39 :     \item{tau}{
40 :     \var{p} values for the quantiles to estimate.
41 :    
42 :     Note: only one value for \code{tau} can be specified if
43 :     estimating confidence intervals with \code{ci}.
44 :     }
45 :     \item{ci, ci.type, level}{
46 :     estimate a confidence interval at level \code{level} using the
47 :     method \code{ci.type}; see \code{\link[quantreg]{predict.rq}}.
48 :     }
49 :     \item{n}{
50 :     number of equi-spaced points on which to evaluate the function.
51 :     }
52 :     \item{col, col.se, lty, lwd, alpha, alpha.se, border}{
53 :     graphical parameters. \code{col} and \code{alpha} apply to the
54 :     line(s), while \code{col.se} and \code{alpha.se}
55 :     apply to the shaded \code{ci} region.
56 :     }
57 :     \item{superpose}{
58 :     if \code{TRUE}, plot each quantile line (\code{tau}) in a
59 :     different style (using \code{trellis.par.get("superpose.line")}).
60 :     }
61 :     \item{subscripts, group.number, group.value,
62 :     type, col.line, col.symbol, fill,
63 :     pch, cex, font, fontface, fontfamily}{
64 :     ignored.
65 :     }
66 :     }
67 :     \details{
68 :    
69 :     }
70 :     \author{
71 :     Felix Andrews \email{felix@nfrac.org}
72 :     }
73 :     \seealso{
74 :     \code{\link[quantreg]{rq}},
75 :     \code{\link{panel.smoother}},
76 :     \code{\link[ggplot2]{stat_quantile}}
77 :     }
78 :     \examples{
79 :     xy <- data.frame(x = runif(100), y = rt(100, df = 5))
80 :     xyplot(y ~ x, xy) +
81 :     layer(panel.quantile(x, y, tau = c(.05, .5, .95)))
82 :    
83 :     xyplot(y ~ x, xy) +
84 :     layer(panel.quantile(form = y ~ ns(x, 3), tau = 0.5))
85 :    
86 :     xyplot(y ~ x, xy) +
87 :     layer(panel.quantile(form = y ~ ns(x, 3), ci = TRUE))
88 :    
89 :     xyplot(y ~ x, xy) +
90 :     layer(panel.quantile(x, y, tau = c(.1, .5, .9), superpose = TRUE))
91 :    
92 :     update(trellis.last.object(),
93 :     key = simpleKey(paste(c(10,50,90), "\% quantile"),
94 :     points = FALSE, lines = TRUE))
95 :    
96 :     ## seems not to work...
97 :     #xyplot(y ~ x, xy) +
98 :     # layer(panel.quantile(form = y ~ qss(x, lambda=1), method = "rqss"))
99 :     }
100 :     \keyword{ dplot }

R-Forge@R-project.org
ViewVC Help
Powered by ViewVC 1.0.0  
Thanks to:
Vienna University of Economics and Business University of Wisconsin - Madison Powered By FusionForge