modeldiag

R-CMD-check CRAN status

The goal of modeldiag is to provide comprehensive diagnostic checks for statistical models including linear models, generalized linear models, and survival models.

Installation

You can install the development version of modeldiag from GitHub with:

# install.packages("devtools")
devtools::install_github("Teniola17/modeldiag")

Example

This is a basic example which shows you how to diagnose a linear model:

library(modeldiag)

# Fit a linear model
model <- lm(mpg ~ wt + hp + disp, data = mtcars)

# Run diagnostics
diagnostics <- diagnose_model(model)

# View summary
summary(diagnostics)

# Plot diagnostics
plot(diagnostics)

Supported Models

The package currently supports:

Features

Diagnostic Tests

Each model type has specific diagnostic tests:

Linear Models

Logistic Regression

Poisson Regression

Cox Models

Visualization

The plot() method provides model-specific diagnostic plots:

Getting Help

If you encounter a bug, please file an issue with a minimal reproducible example on GitHub.# modeldiag