Package: mlmodels 0.1.2

Alfonso Sanchez-Penalver

mlmodels: Maximum Likelihood Models and Tools for Estimation, Prediction, and Testing

Provides a collection of maximum likelihood estimators with a consistent S3 interface. Supported models include Gaussian (linear and log-normal), logit, probit, Poisson, negative binomial (NB1 and NB2), gamma, and beta regression. A distinctive feature is flexible modeling of the scale parameter (variance, dispersion, precision, or shape) alongside the location/mean parameters. The package offers unified predict() methods, multiple variance-covariance estimators (observed information, outer product of gradients, robust/Huber-White, cluster-robust, bootstrap, jackknife), and a full suite of hypothesis tests (Wald, likelihood ratio, information matrix, Vuong, overdispersion, and goodness-of-fit). It is fully compatible with 'marginaleffects' for post-estimation analysis. Methods implemented include Cameron and Trivedi (1990) <doi:10.1016/0304-4076(90)90014-K>, for Poisson overdispersion testing, Manjon and Martinez (2014) <doi:10.1177/1536867X1401400406>, for goodness-of-fit testing of count data models, Vuong (1989) <doi:10.2307/1912557>, for non-nested likelihood ratio testing, and White (1982) <doi:10.2307/1912526>, for information matrix tests.

Authors:Alfonso Sanchez-Penalver [aut, cre]

mlmodels_0.1.2.tar.gz
mlmodels_0.1.2.zip(r-4.7)mlmodels_0.1.2.zip(r-4.6)mlmodels_0.1.2.zip(r-4.5)
mlmodels_0.1.2.tgz(r-4.6-any)mlmodels_0.1.2.tgz(r-4.5-any)
mlmodels_0.1.2.tar.gz(r-4.7-any)mlmodels_0.1.2.tar.gz(r-4.6-any)
mlmodels_0.1.2.tgz(r-4.6-emscripten)
manual.pdf |manual.html
card.svg |card.png
mlmodels/json (API)
NEWS

# Install 'mlmodels' in R:
install.packages('mlmodels', repos = c('https://cranhaven.r-universe.dev', 'https://cloud.r-project.org'))

Bug tracker:https://github.com/alfisankipan/mlmodels/issues

Pkgdown/docs site:https://alfisankipan.github.io

Datasets:
  • docvis - U.S. Medical Expenditure Panel Survey
  • mroz - University of Michigan Panel Study of Income Dynamics
  • pw401k - 401(k) Participation Rates
  • smoke - 1979 National Health Interview Survey

On CRAN:

Conda:

archivedpackagesr-universe

4.24 score 5 stars 502 downloads 20 exports 27 dependencies

Last updated from:0f008d096a (on package/mlmodels). Checks:9 OK. Indexed: no.

TargetResultTimeFilesSyslog
linux-devel-x86_64OK291
source / vignettesOK239
linux-release-x86_64OK286
macos-release-arm64OK180
macos-oldrel-arm64OK259
windows-develOK328
windows-releaseOK383
windows-oldrelOK311
wasm-releaseOK126

Exports:%||%find_variables.mlmodelget_modeldata.mlmodelGOFtestgradientObshessianObsIMtestloglikeObslrtestml_betaml_gammaml_lmml_logitml_negbinml_poissonml_probitOVDtestsevuongtestwaldtest

Dependencies:backportscheckmateclidata.tabledigestFormulagenericsgluehardhatinsightlatticelifecyclemagrittrmarginaleffectsMASSmatrixcalcmaxLikmiscToolspillarpkgconfigrlangsandwichsparsevctrstibbleutf8vctrszoo

Diagnostic Tools in mlmodels

Rendered frommlmodels-diagnostics.Rmdusingknitr::rmarkdownon Jun 12 2026.

Last update: 2026-06-12
Started: 2026-06-12

Fractional Response Outcomes

Rendered frommlmodels-fractional.Rmdusingknitr::rmarkdownon Jun 12 2026.

Last update: 2026-06-12
Started: 2026-06-12

Gamma versus Lognormal

Rendered frommlmodels-gamma-lognormal.Rmdusingknitr::rmarkdownon Jun 12 2026.

Last update: 2026-06-12
Started: 2026-06-12

Introduction to Count Data

Rendered frommlmodels-countintro.Rmdusingknitr::rmarkdownon Jun 12 2026.

Last update: 2026-06-12
Started: 2026-06-12

Maximum Likelihood Models in R

Rendered frommlmodels-basics.Rmdusingknitr::rmarkdownon Jun 12 2026.

Last update: 2026-06-12
Started: 2026-06-12

Predictions with mlmodels

Rendered frommlmodels-predictions.Rmdusingknitr::rmarkdownon Jun 12 2026.

Last update: 2026-06-12
Started: 2026-06-12

Variance-Covariance Estimation in mlmodels

Rendered frommlmodels-variance.Rmdusingknitr::rmarkdownon Jun 12 2026.

Last update: 2026-06-12
Started: 2026-06-12

Readme and manuals

Help Manual

Help pageTopics
Extract AIC from mlmodel objectsAIC.mlmodel AIC.summary.mlmodel
Extract BIC from mlmodel objectsBIC.mlmodel BIC.summary.mlmodel
Extract Model Coefficientscoef.mlmodel
Confidence Intervals for mlmodel Coefficientsconfint.mlmodel
U.S. Medical Expenditure Panel Surveydocvis
Extract the predictors used in the model (for insight/marginaleffects compatibility)find_predictors.mlmodel
Extract the variables used in the model (for insight/marginaleffects compatibility)find_variables.mlmodel
Extract Fitted Values from mlmodelfitted.mlmodel fitted.values.mlmodel
Extract value formula from mlmodel objectsformula.mlmodel
Extract data used to fit the model (for insight/marginaleffects compatibility)get_data.mlmodel get_modeldata.mlmodel
Goodness-of-Fit Test for Count ModelsGOFtest GOFtest.mlmodel
Gradient (Score) by ObservationgradientObs gradientObs.mlmodel
Hessian by ObservationhessianObs hessianObs.mlmodel
Information Matrix Test for Model MisspecificationIMtest IMtest.mlmodel
Extract Log-Likelihood from mlmodel objectslogLik.mlmodel logLik.summary.mlmodel
Log-Likelihood by ObservationloglikeObs loglikeObs.mlmodel
Likelihood Ratio Test for Nested mlmodel Objectslrtest lrtest.mlmodel
Fit Beta Model by Maximum Likelihoodml_beta
Fit Gamma Model by Maximum Likelihoodml_gamma
Fit linear model by Maximum Likelihoodml_lm
Fit Binary Logit Model by Maximum Likelihoodml_logit
Fit negative binomial models by Maximum Likelihoodml_negbin
Fit Poisson model by Maximum Likelihoodml_poisson
Fit Binary Probit Model by Maximum Likelihoodml_probit
University of Michigan Panel Study of Income Dynamics (PSID)mroz
Extract the Number of Observations from an mlmodelnobs.mlmodel
Null default operator%||% null-default
Overdispersion Tests for Count ModelsOVDtest
Predictions for mlmodel modelspredict.mlmodel predict.ml_beta predict.ml_gamma predict.ml_lm predict.ml_logit predict.ml_negbin predict.ml_poisson predict.ml_probit
401(k) Participation Ratespw401k
Extract Model Residualsresiduals.mlmodel
Extract Standard Errors from mlmodel Objectsse se.mlmodel
1979 National Health Interview Surveysmoke
Summary for mlmodel objectssummary.mlmodel summary.ml_beta summary.ml_gamma summary.ml_lm summary.ml_logit summary.ml_negbin summary.ml_poisson summary.ml_probit
Update an mlmodel Callupdate.mlmodel update.ml_poisson
Variance-Covariance Matrix for mlmodel Objectsvcov.mlmodel
Vuong's Test for Non-Nested Modelsvuongtest vuongtest.mlmodel
Wald Test for Linear Restrictionswaldtest waldtest.mlmodel