Package: lsm 0.2.1.4

Jorge Villalba
lsm: Estimation of the log Likelihood of the Saturated Model
When the values of the outcome variable Y are either 0 or 1, the function 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. The function LogLik() works (almost perfectly) when the number of independent variables K is high, but for small K it calculates wrong values in some cases. For this reason, when Y is dichotomous and the data are grouped in J populations, it is recommended to use the function lsm() because it works very well for all K.
Authors:
lsm_0.2.1.4.tar.gz
lsm_0.2.1.4.tar.gz(r-4.5-noble)lsm_0.2.1.4.tar.gz(r-4.4-noble)
lsm_0.2.1.4.tgz(r-4.4-emscripten)lsm_0.2.1.4.tgz(r-4.3-emscripten)
lsm.pdf |lsm.html✨
lsm/json (API)
# Install 'lsm' in R: |
install.packages('lsm', repos = 'https://cloud.r-project.org') |
This package does not link to any Github/Gitlab/R-forge repository. No issue tracker or development information is available.
Last updated 10 months agofrom:2401bb9f81. Checks:3 OK. Indexed: yes.
Target | Result | Latest binary |
---|---|---|
Doc / Vignettes | OK | Mar 06 2025 |
R-4.5-linux | OK | Mar 06 2025 |
R-4.4-linux | OK | Mar 06 2025 |
Exports:lsm
Dependencies:clicolorspacedplyrfansifarvergenericsggplot2gluegtableisobandlabelinglatticelifecyclemagrittrMASSMatrixmgcvmunsellnlmepillarpkgconfigR6RColorBrewerrlangscalestibbletidyselectutf8vctrsviridisLitewithr
Citation
To cite lsm in publications please use:
Jorge L. Villalba, Humberto J. Llinas, Omar J. Fabregas (2024). lsm: Estimation of the log Likelihood of the Saturated Model R package version 0.2.1.4. URL https://CRAN.R-project.org/package=lsm
Corresponding BibTeX entry:
@Manual{lsm-package, title = {{lsm}: Estimation of the log Likelihood of the Saturated Model}, author = {Jorge L. Villalba and Humberto J. Llinas and Omar J. Fabregas}, year = {2024}, note = {R package version 0.2.1.4}, url = {https://CRAN.R-project.org/package=lsm}, }
Readme and manuals
lsm()lsm()
Welcome to the lsm package!lsm
When the values of the outcome variable Y are either 0 or 1, the function 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 is dichotomous and the data are grouped in J populations, it is recommended to use the function because it works very well for all .
Details
The saturated model is characterized by the assumptions 1 and 2 presented in section 2.3 by Llinas (2006, ISSN:2389-8976).
Installation
install.packages("lsm")
library(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(1, 0, 1, 0, 1, 1, 1, 1, 0, 0, 1, 1)
x1 <- c(2, 2, 2, 5, 5, 5, 5, 8, 8, 11, 11, 11)
data <- data.frame (y, x1)
ELAINYS <-lsm(y ~ x1, family=binomial, data)
summary(ELAINYS)
Other case.
y <- as.factor(c(1, 0, 1, 0, 1, 1, 1, 1, 0, 0, 1, 1))
x1 <- as.factor(c(2, 2, 2, 5, 5, 5, 5, 8, 8, 11, 11, 11))
data <- data.frame (y, x1)
ELAINYS1 <-lsm(y ~ x1, family=binomial, data)
confint(ELAINYS1)
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.
[3] Chambers, J. M. and Hastie, T. J. (1992) Statistical Models in S. Wadsworth & Brooks/Cole.
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.
If you found any ERRORS or have SUGGESTIONS, please report them to my email. Thanks.
Help Manual
Help page | Topics |
---|---|
Coronary Heart Disease Study | chdage |
Confidence Intervals for 'lsm' Objects | confint.lsm |
icu | icu |
lowbwt | lowbwt |
Estimation of the log Likelihood of the Saturated Model | lsm |
Graphics Method for 'lsm' Objects | plot.lsm |
Predictions and Confidence intervals | predict.lsm |
pros | pros |
Summarizing Method for 'lsm' Objects | summary.lsm |
survey | survey |
uis | uis |