panel.fit {carEx}R Documentation

Panel function for predicted values and SE bands

Description

Panel function to display predicted values and SE bands using xyplot in in lattice and layer or glayer in latticeExtra

Usage

panel.fit(x, y, fit, lower, upper, subscripts, ..., type, group.number,
  alpha, col, col.line, col.symbol, border = F, font, fontface)

Arguments

x, y

these are place holders for the arguments that are automatically passed to panel functions from xyplot through layer or glayer. Their values are not used by panel.fit

fit

fitted values defined as an argument named fit in the call to xyplot and usually passed to panel.fit through layer or glayer

lower, upper

lower and upper limits of error bands, passed in the same way as fit

subscripts

logical, passed xyplot

...

specify any additional arguments to prevent them from being silently passed from xyplot to panel.fit

group.number

passed silently from xyplot

alpha

transparency of the bands, in the interval [0,1]. Provide a value or it will be passed silently from xyplot

col

color, may be specified, otherwise passed from xyplot

col.line

line color, if group.number isn't specified.

col.symbol

color when using groups,may be specified, otherwise passed from xyplot

border

if TRUE draw borders on bands. Default is FALSE

font

may be specified, otherwise passed from xyplot

fontface

may be specified, otherwise passed from xyplot

type

currently not used.

Details

With layer and glayer in latticeExtra, panel.fit can be used to generate fitted values and confidence or prediction bands that have render correctly whether a plot uses groups or not.

If a data frame, data, is used to fit a model and contains variables for fitted values and standard error for estimation or prediction, a typical use of panel.fit has the following form: library(latticeExtra) xyplot( y ~ x, data, groups = g, fit = data$yhat, lower = with(data, yhat - 2*se), upper = with(data, yhat + 2*se), subscripts = T) + glayer(panel.fit(...))

Value

The panel.fit,is invoked for its graphical effect.

Author(s)

Georges Monette <georges@yorku.ca>

Examples

## Not run: 
  
  ###
  ### Exploring possible discontinuity in value of post-secondary education
  ###
 	 

## End(Not run)
## Not run: 
trellis.focus()
panel.identify(labels = rownames(data),rot=-15,col = col.symbol, etc.)
trellis.unfocus()

## End(Not run)

[Package carEx version 0.2-0 Index]