knitr::opts_chunk$set(collapse = TRUE,
  comment = "#>",
  fig.path = "README-"
)
options(tibble.print_min = 5, tibble.print_max = 5)

CRAN_Status_Badge

Welcome to the lsm package!

When the values of the outcome variable Y are either 0 or 1, the function \code{lsm()} calculates the estimation of the log likelihood in the saturated model. This model is characterized by Llinas (2006, ISSN:2389-8976) in section 2.3 through the assumptions 1 and 2. If \code{Y} is dichotomous and the data are grouped in J populations, it is recommended to use the function \code{lsm()} because it works very well for all \code{K}.

Details

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

References

[1] Humberto Jesus Llinas. (2006). Accuracies in the theory of the logistic models. Revista Colombiana De Estadistica,29(2), 242-244.

[2] Hosmer, D. (2013). Wiley Series in Probability and Statistics Ser. : Applied Logistic Regression (3). New York: John Wiley & Sons, Incorporated.

Author(s)

Humberto Llinas Solano [aut], Universidad del Norte, Barranquilla-Colombia \ Omar Fabregas Cera [aut], Universidad del Norte, Barranquilla-Colombia \ Jorge Villalba Acevedo [cre, aut], Universidad Tecnológica de Bolívar, Cartagena-Colombia.

Installation

library(devtools)
install_github("jlvia1191/lsm")

Installation

library(devtools)
install_github("jlvia1191/lsm")

De forma alternativa

install.packages("devtools")
library(devtools)
devtools::install_github("jlvia1191/lsm")

Example Usage

Hosmer, D. (2013) page 3: Age and coranary Heart Disease (CHD) Status of 20 subjects:

library(lsm)

  AGE <- c(20,23,24,25,25,26,26,28,28,29,30,30,30,30,30,30,30,32,33,33)
  CHD <- c(0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0)

  data <- data.frame (CHD,  AGE )
  lsm(CHD ~ AGE , family=binomial, data)

  ## For more ease, use the following notation.

  lsm(y~., data)

# Other case.

y <- c(0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1)
 x1 <- c(2, 2, 2, 2, 2, 5, 5, 5, 5, 6, 6, 6, 8, 8, 11, 11, 11, 1)
 x2 <- c(3, 3, 3, 3, 3, 6, 6, 6, 6, 8, 8, 8, 9, 9, 12,  12, 12, 12)
 x3 <- c(1, 1, 1, 1, 1, 9, 9, 9, 9, 10, 10, 10, 4, 4, 2, 2, 2, 2)

 data <- data.frame (y, x1, x2, x3 )
 ELAINYS <- lsm(y ~ x1 + x2 + x3  , family=binomial, data)
 summary(ELAINYS)
 confint(ELAINYS)
@


jlvia1191/lsm documentation built on Jan. 18, 2020, 9:16 a.m.