https://github.com/shah-in-boots/rmdl
A Causality-Informed Modeling Appraoch
https://github.com/shah-in-boots/rmdl
epidemiology modeling r r-package rstats statistics
Last synced: 24 days ago
JSON representation
A Causality-Informed Modeling Appraoch
- Host: GitHub
- URL: https://github.com/shah-in-boots/rmdl
- Owner: shah-in-boots
- License: other
- Created: 2020-11-25T02:20:22.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2024-08-25T00:36:58.000Z (almost 2 years ago)
- Last Synced: 2025-12-09T11:46:21.961Z (7 months ago)
- Topics: epidemiology, modeling, r, r-package, rstats, statistics
- Language: R
- Homepage: https://shah-in-boots.github.io/rmdl/
- Size: 10.2 MB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 12
-
Metadata Files:
- Readme: README.Rmd
- Changelog: NEWS.md
- License: LICENSE
Awesome Lists containing this project
README
---
output: github_document
---
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
# rmdl
[](https://lifecycle.r-lib.org/articles/stages.html#experimental)
[](https://CRAN.R-project.org/package=rmdl)
[](https://cran.r-project.org/package=rmdl)
[](https://github.com/shah-in-boots/rmdl/actions/workflows/R-CMD-check.yaml)
[](https://github.com/shah-in-boots/rmdl/actions/workflows/pkgdown.yaml)
[](https://github.com/shah-in-boots/rmdl/actions/workflows/test-coverage.yaml)
[](https://app.codecov.io/gh/shah-in-boots/rmdl?branch=main)
[](https://github.com/shah-in-boots/rmdl/graphs/commit-activity)
## Installation
This package can be downloaded from CRAN or from [Github](https://github.com/shah-in-boots/rmdl) as below
```{r, eval = FALSE}
# CRAN installation
install.packages("rmdl")
# Or remote/developmental version
remotes::install_github("shah-in-boots/rmdl")
```
## Introduction
The package `{rmdl}` was intended as a way to handle causal- and epidemiology-based modeling by the following principles:
1. Role determination of variables
2. Generativity in formula creation
3. Multiple model management
## Usage
The package is simple to use.
The `mtcars` dataset will serve as the example, and we will use linear regressions as the primary test.
This toy example shows that we will be building six models in parallel, with the key exposure being the __wt__ term, and the two outcomes being __mpg__ and __hp__.
```{r}
library(rmdl)
f <- fmls(mpg + hp ~ .x(wt) + disp + cyl + am, pattern = "parallel")
m <- fit(f, .fn = lm, data = mtcars, raw = FALSE)
mt <- model_table(mileage = m)
print(mt)
```
## Classes
There are several important extended classes that this package introduces, however they are primarily used for internal validation and for shortcuts to allow more effective communication.
- `fmls` are a *version* of the base `R` formula object, but contain additional information and have extra features
- `tm` are atomic elements used to describe individual variables, and departs from how terms are generally treated in the `{stats}` package
- `mdl` and `mdl_tbl` exist primarily as *tidy* versions of class regression modeling
## Advanced Usage
The [`{rmdl}`](https://cran.r-project.org/package=rmdl) package is intended to be flexible, extensible, and easy-to-use (albeit opinionated).
Please see the vignettes for additional information.