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 129, Thu Apr 15 07:21:59 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 \code{\link{stat_quantile}}
9    function from \pkg{ggplot2}.    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}{
36      further arguments passed on to the model function (\code{method}),      further arguments passed on to the model function (\code{method}),
37      typically \code{\link[quantreg]{rq}}.      typically \code{\link{rq}}.
38    }    }
39    \item{tau}{    \item{tau}{
40      \var{p} values for the quantiles to estimate.      \var{p} values for the quantiles to estimate.
# Line 45  Line 44 
44    }    }
45    \item{ci, ci.type, level}{    \item{ci, ci.type, level}{
46      estimate a confidence interval at level \code{level} using the      estimate a confidence interval at level \code{level} using the
47      method \code{ci.type}; see \code{\link[quantreg]{predict.rq}}.      method \code{ci.type}; see \code{\link{predict.rq}}.
48    }    }
49    \item{n}{    \item{n}{
50      number of equi-spaced points on which to evaluate the function.      number of equi-spaced points on which to evaluate the function.
# Line 71  Line 70 
70  \author{  \author{
71    Felix Andrews \email{felix@nfrac.org}    Felix Andrews \email{felix@nfrac.org}
72    
73    Based on \code{\link[ggplot2]{stat_quantile}} by Hadley Wickham.    Based on \code{\link{stat_quantile}} by Hadley Wickham.
74  }  }
75  \seealso{  \seealso{
76    \code{\link[quantreg]{rq}},    \code{\link{rq}},
77    \code{\link{panel.smoother}},    \code{\link{panel.smoother}},
78    \code{\link[ggplot2]{stat_quantile}}    \code{\link{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    \dontshow{ .featured_example <- TRUE }
99  update(trellis.last.object(),  update(trellis.last.object(),
100    key = simpleKey(paste(c(10,50,90), "\% quantile"),    auto.key = list(text = paste(c(50,90,10), "\% quantile"),
101                    points = FALSE, lines = TRUE))                    points = FALSE, lines = TRUE))
102    
103  ## seems not to work...  ## seems not to work...

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

root@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