interactive_logit: compstatslib interactive_logit() function

View source: R/logit_interactive.R

interactive_logitR Documentation

compstatslib interactive_logit() function

Description

Interactive visualization function that lets you point-and-click to add data points, while it automatically plots and updates a logistic regression curve and associated statistics.

Usage

interactive_regression(points, ...)

*Click on the plotting area to add points and see a corresponding regression
curve (hitting ESC will stop the simulation).*

Arguments

points

An optional dataframe of x and y points to plot and estimate the regression. If no points are provided, the user is free to click and create points on the plot area.

formula

A formula to use in estimating logit (e.g., y ~ x).

...

Further arguments passed to the plot_logit() function that produces the plot.

Value

A dataframe containing the points coordinates.

See Also

plot_regr

Examples

# Selecting coordinates on the plot area, storing them in 'pts'
pts <- interactive_logit()

# Replotting the points stored earlier in 'pts', allowing the user to
# continue the interactive regression
interactive_logit(pts)

# Providing coordinates beforehand
mydata <- data.frame(in = c(1, 4, 7, 10), out = c(0, 0, 1, 1))
interactive_regression(mydata, formula = out ~ in)


soumyaray/compstatslib documentation built on March 11, 2023, 8:39 p.m.