Learn R Programming

lsm (version 0.2.1.5)

plot.lsm: Graphics Method for lsm Objects

Description

Obtains graphics from a fitted lsm object.

Usage

# S3 method for lsm
plot(
  x,
  type = c("scatter", "probability", "Logit", "odds"),
  title = NULL,
  xlab = NULL,
  ylab = NULL,
  color = "red",
  size = 1.5,
  shape = 19,
  ...
)

Value

Un objeto ggplot. following components:

Arguments

x

The LSM model object.

type

The type of plot to draw. Options are "scatter" for a scatter plot, "probability" for a probability plot, "Logit" for a plot related to logistic regression, and "odds" for a plot related to odds.

title

The title of the plot.

xlab

The label for the x-axis.

ylab

The label for the y-axis.

color

The color of the dots in the plot.

size

The size of the dots in the plot.

shape

The shape oof the dots in the plot.

...

Additional graphical arguments to be passed to ggplot.

Author

Jorge Villalba Acevedo [cre, aut], (Universidad Tecnológica de Bolívar, Cartagena-Colombia).

Details

Gráfico de regresión logística

The saturated model is characterized by the assumptions 1 and 2 presented in section 2.3 by Llinas (2006, ISSN:2389-8976).

References

[1] LLinás, H. J. (2006). Precisiones en la teoría de los modelos logísticos. Revista Colombiana de Estadística, 29(2), 239–265. https://revistas.unal.edu.co/index.php/estad/article/view/29310

[2] Hosmer, D.W., Lemeshow, S. and Sturdivant, R.X. (2013). Applied Logistic Regression, 3rd ed., New York: Wiley.

[3] Chambers, J. M. and Hastie, T. J. (1992). Statistical Models in S. Wadsworth & Brooks/Cole.

Examples

Run this code
#library(lsm)

#1. AGE and Coronary Heart Disease (CHD) Status of 100 subjects:

# library(lsm)
# library(tidyverse)
# datos <- lsm::chdage
# attach(datos)
# modelo <- lsm(CHD ~ AGE, data=datos)
# plot(modelo, type = "scatter")
# plot(modelo, type = "scatter", title  = "Villalba-llinas lsm")
# plot(modelo, type = "probability", xlab = "Elainys")
# plot(modelo, type = "Logit", color = "blue")
# plot(modelo, type = "odds", size = 3)

Run the code above in your browser using DataLab