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 61, Mon Dec 21 03:52:43 2009 UTC revision 83, Tue Jan 12 04:40:38 2010 UTC
# Line 9  Line 9 
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}.      passing \code{form}. In fact, for convenience, the formula
28        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    
34      See the Examples section for common choices.      See the Examples section for common choices.
35    }    }
# Line 65  Line 66 
66    }    }
67  }  }
68  \details{  \details{
69      It is recommended to look at \code{vignette("rq",package="quantreg")}.
70  }  }
71  \author{  \author{
72    Felix Andrews \email{felix@nfrac.org}    Felix Andrews \email{felix@nfrac.org}
73    
74      Based on \code{\link[ggplot2]{stat_quantile}} by Hadley Wickham.
75  }  }
76  \seealso{  \seealso{
77    \code{\link[quantreg]{rq}},    \code{\link[quantreg]{rq}},
# Line 76  Line 79 
79    \code{\link[ggplot2]{stat_quantile}}    \code{\link[ggplot2]{stat_quantile}}
80  }  }
81  \examples{  \examples{
82    library("quantreg")
83    
84    set.seed(1)
85  xy <- data.frame(x = runif(100), y = rt(100, df = 5))  xy <- data.frame(x = runif(100), y = rt(100, df = 5))
86  xyplot(y ~ x, xy) +  xyplot(y ~ x, xy) +
87    layer(panel.quantile(x, y, tau = c(.05, .5, .95)))    layer(panel.quantile(x, y, tau = c(.95, .5, .05)))
88    
89    if (require("splines")) {
90  xyplot(y ~ x, xy) +  xyplot(y ~ x, xy) +
91    layer(panel.quantile(form = y ~ ns(x, 3), tau = 0.5))      layer(panel.quantile(y ~ ns(x, 3), tau = 0.9))
92    
93  xyplot(y ~ x, xy) +  xyplot(y ~ x, xy) +
94    layer(panel.quantile(form = y ~ ns(x, 3), ci = TRUE))      layer(panel.quantile(y ~ ns(x, 3), tau = 0.9, ci = TRUE))
95    }
96    
97  xyplot(y ~ x, xy) +  xyplot(y ~ x, xy) +
98    layer(panel.quantile(x, y, tau = c(.1, .5, .9), superpose = TRUE))    layer(panel.quantile(x, y, tau = c(.5, .9, .1), superpose = TRUE))
99    
100  update(trellis.last.object(),  update(trellis.last.object(),
101    key = simpleKey(paste(c(10,50,90), "\% quantile"),    auto.key = list(text = paste(c(50,90,10), "\% quantile"),
102                    points = FALSE, lines = TRUE))                    points = FALSE, lines = TRUE))
103    
104  ## seems not to work...  ## seems not to work...
105  #xyplot(y ~ x, xy) +  #xyplot(y ~ x, xy) +
106  #  layer(panel.quantile(form = y ~ qss(x, lambda=1), method = "rqss"))  #  layer(panel.quantile(y ~ qss(x, lambda=1), method = "rqss"))
107  }  }
108  \keyword{ dplot }  \keyword{ dplot }

Legend:
Removed from v.61  
changed lines
  Added in v.83

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