{"id":32209496,"url":"https://github.com/nerler/jointai","last_synced_at":"2025-10-22T06:07:47.364Z","repository":{"id":46140973,"uuid":"72211890","full_name":"NErler/JointAI","owner":"NErler","description":"Joint Analysis and Imputation of generalized linear models and linear mixed models with missing values","archived":false,"fork":false,"pushed_at":"2025-08-31T13:37:28.000Z","size":366854,"stargazers_count":28,"open_issues_count":6,"forks_count":4,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-10-13T11:56:28.317Z","etag":null,"topics":["bayesian","generalized-linear-models","glm","glmm","imputation","imputations","jags","joint-analysis","linear-mixed-models","linear-regression-models","mcmc-sample","mcmc-sampling","missing-data","missing-values","rstats","survival"],"latest_commit_sha":null,"homepage":"https://nerler.github.io/JointAI","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/NErler.png","metadata":{"files":{"readme":"README.Rmd","changelog":"NEWS.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2016-10-28T13:55:32.000Z","updated_at":"2025-08-31T12:43:07.000Z","dependencies_parsed_at":"2022-07-30T16:08:48.400Z","dependency_job_id":"1b22ebe6-64e5-4963-9b57-bcaa1f18f5ff","html_url":"https://github.com/NErler/JointAI","commit_stats":{"total_commits":2212,"total_committers":5,"mean_commits":442.4,"dds":0.05334538878842676,"last_synced_commit":"210fad773ab340e3a7677d2846abafc0e8ced4ee"},"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"purl":"pkg:github/NErler/JointAI","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NErler%2FJointAI","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NErler%2FJointAI/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NErler%2FJointAI/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NErler%2FJointAI/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/NErler","download_url":"https://codeload.github.com/NErler/JointAI/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NErler%2FJointAI/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":280389556,"owners_count":26322558,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-22T02:00:06.515Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bayesian","generalized-linear-models","glm","glmm","imputation","imputations","jags","joint-analysis","linear-mixed-models","linear-regression-models","mcmc-sample","mcmc-sampling","missing-data","missing-values","rstats","survival"],"created_at":"2025-10-22T06:07:41.692Z","updated_at":"2025-10-22T06:07:47.354Z","avatar_url":"https://github.com/NErler.png","language":"R","readme":"---\noutput: github_document\n---\n\n\u003c!-- README.md is generated from README.Rmd. Please edit that file --\u003e\n\n```{r, echo = FALSE}\nknitr::opts_chunk$set(\n  collapse = TRUE,\n  comment = \"#\u003e\",\n  fig.path = \"man/figures/README-\",\n  fig.align = 'center'\n)\n```\n\n\n# JointAI: Joint Analysis and Imputation of Incomplete Data \u003cimg src=\"man/figures/logo.png\" align=\"right\" alt=\"\" width=\"160\" /\u003e\n\n\n\u003c!-- badges: start --\u003e\n[![CRAN_Status_Badge](https://www.r-pkg.org/badges/version-last-release/JointAI)](https://CRAN.R-project.org/package=JointAI)\n[![](https://cranlogs.r-pkg.org/badges/grand-total/JointAI)](https://CRAN.R-project.org/package=JointAI)\n[![Download counter](https://cranlogs.r-pkg.org/badges/JointAI)](https://cran.r-project.org/package=JointAI)\n[![codecov](https://codecov.io/gh/NErler/JointAI/branch/master/graph/badge.svg)](https://app.codecov.io/gh/NErler/JointAI)\n[![R build status](https://github.com/NErler/JointAI/workflows/R-CMD-check/badge.svg)](https://github.com/NErler/JointAI/actions)\n\u003c!-- badges: end --\u003e\n\n\n\nThe package **JointAI** provides functionality to perform joint analysis and\nimputation of a range of model types in the Bayesian framework. Implemented are\n(generalized) linear regression models and extensions thereof, models for\n(un-/ordered) categorical data, as well as multi-level (mixed) versions of these\nmodel types.\n\nMoreover, survival models and joint models for longitudinal and survival data\nare available. It is also possible to fit multiple models of mixed types\nsimultaneously. Missing values in (if present) will be imputed automatically.\n\n**JointAI** performs some preprocessing of the data and creates a\n[JAGS](https://mcmc-jags.sourceforge.io/) model, which will then automatically be\npassed to [JAGS](https://mcmc-jags.sourceforge.io/) with the help of the R\npackage [**rjags**](https://CRAN.R-project.org/package=rjags).\n\nBesides the main modelling functions, **JointAI** also provides a number of\nfunctions to summarize and visualize results and incomplete data.\n\n\n\n    \n## Installation\n\n**JointAI** can be installed from [CRAN](https://cran.r-project.org/):\n```{r CRAN-instalation, eval = FALSE}\ninstall.packages('JointAI')\n```\n\nAlternatively, you can install **JointAI** from GitHub:\n```{r gh-installation, eval = FALSE}\n# install.packages(\"remotes\")\nremotes::install_github(\"NErler/JointAI\")\n```\n\n\n## Main functions\n**JointAI** provides the following main functions:\n\n``` r\nlm_imp()                 # linear regression\nglm_imp()                # generalized linear regression\nclm_imp()                # cumulative logit model\nmlogit_imp()             # multinomial logit model\nlognorm_imp()            # log-normal regression\nbetareg_imp()            # beta regression\nlme_imp() / lmer_imp()   # linear mixed model\nglme_imp() / glmer_imp() # generalized linear mixed model\nclmm_imp()               # cumulative logit mixed model\nmlogitmm_imp()           # multinomial logit model\nlognormmm_imp()          # log-normal regression\nbetamm_imp()             # beta regression\nsurvreg_imp()            # parametric (Weibull) survival model\ncoxph_imp()              # proportional hazards survival model\nJM_imp()                 # joint model for longitudinal and survival data\n```\n\nThe functions use specification similar to that of well known standard functions\nlike `lm()` and `glm()` from base R, `nlme::lme()` (from the package\n[**nlme**](https://CRAN.R-project.org/package=nlme)) , `lme4::lmer()` or\n`lme4::glmer()` (from the package\n[**lme4**](https://CRAN.R-project.org/package=lme4)) and `survival::survreg()`\nand `survival::coxph()` (from the package\n[**survival**](https://CRAN.R-project.org/package=survival)).\n\n\nFunctions `summary()`, `coef()`, `traceplot()` and `densplot()` provide a\nsummary of the posterior distribution and its visualization.\n\n`GR_crit()` and `MC_error()` implement the Gelman-Rubin diagnostic for\nconvergence and the Monte Carlo error of the MCMC sample, respectively.\n\n**JointAI** also provides functions for exploration of the distribution of the\ndata and missing values, export of imputed values and prediction.\n\n\n## Minimal Example\n### Visualize the observed data and missing data pattern\n```{r, echo = FALSE}\npar(mar = c(2.5, 3, 2.5, 1), mgp = c(2, 0.8, 0))\n```\n\n```{r, fig.width = 8, fig.height = 4, message = FALSE, collapse=TRUE}\nlibrary(JointAI)\n\nplot_all(NHANES[c(1, 5:6, 8:12)], fill = '#D10E3B', border = '#460E1B', ncol = 4, breaks = 30)\n```\n\n\n```{r, fig.height = 5}\nmd_pattern(NHANES, color = c('#460E1B', '#D10E3B'))\n```\n\n### Fit a linear regression model with incomplete covariates\n\n```{r fit_lm1, message = F}\nlm1 \u003c- lm_imp(SBP ~ gender + age + WC + alc + educ + bili,\n              data = NHANES, n.iter = 500, progress.bar = 'none', seed = 2020)\n```\n\n### Visualize the MCMC sample\n```{r fig.width = 8, fig.height = 4, out.width = '100%', dpi = 300}\ntraceplot(lm1, col = c('#d4af37', '#460E1B', '#D10E3B'), ncol = 4)\n```\n\n```{r fig.width = 8, fig.height = 4, out.width = '100%', dpi = 300}\ndensplot(lm1, col = c('#d4af37', '#460E1B', '#D10E3B'), ncol = 4, lwd = 2)\n```\n\n### Summarize the Result\n```{r}\nsummary(lm1)\n```\n\n```{r}\ncoef(lm1)\n\nconfint(lm1)\n```\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnerler%2Fjointai","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnerler%2Fjointai","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnerler%2Fjointai/lists"}