rp.logistic: Interactive display of logistic regression with a single...

View source: R/rp-logistic.r

rp.logisticR Documentation

Interactive display of logistic regression with a single covariate

Description

The function rp.logistic plots a binary or binomial response variable against a single covariates and creates a panel which controls the position of a logistic curve and allows a logistic regression to be fitted to the data and displayed on the plot.

Usage

   rp.logistic(x, y, xlab = NA, ylab = NA, panel.plot = TRUE, panel = TRUE,
               hscale = NA, vscale = hscale, alpha = 0, beta = 0, 
               display = c("jitter" = FALSE, "regression line" = FALSE,
               "fitted model" = FALSE))

Arguments

x

a vector of covariate values.

y

a vector of response values with two levels, or a two-column matrix whose first column is the number of ‘successes’ and the second column is the number of ‘failures’ at each covariate value.

xlab

a character variable used for the covariate axis label.

ylab

a character variable used for the response axis label.

panel.plot

a logical variable which determines whether the plot is placed inside the control panel.

panel

a logical variable which determines whether an interactive panel is created.

hscale, vscale

horizontal and vertical scaling factors for the size of the plots. It can be useful to adjust these for projection on a screen, for example. The default values are 1 on Unix platforms and 1.4 on Windows platforms.

alpha

the initial value of the intercept parameter.

beta

the initial value of the slope parameter.

display

the initial settings of the checkboxes which control whether the data are ‘jittered’ for visual effect and whether the movable and fitted regression lines are displayed.

Details

The control panel allows a logistic regression line to be drawn on the plot and the intercept and slope of the linear predictor altered interactively. The fitted logistic regression can also be displayed.

If y is a vector of responses with two values, these are treated as a factor which is then converted to the (0,1) scale by as.numeric.

The values of the response variable can be ‘jittered’.

Value

Nothing is returned.

References

rpanel: Simple interactive controls for R functions using the tcltk package. Journal of Statistical Software, 17, issue 9.

See Also

rp.regression

Examples

## Not run: 
  rp.logistic(river$Temperature, river$Low)

## End(Not run)

rpanel documentation built on Feb. 16, 2023, 10:37 p.m.

Related to rp.logistic in rpanel...