| Title: | Transparent and Assisted Linear Modeling Engine |
|---|---|
| Description: | A transparent, modular, and base-R implemented statistical engine for linear regression (OLS), analysis of variance (ANOVA), and logistic regression (Logit). Designed under the principle of "assisted simplicity", it features an integrated methodological "customs" (Aduana) that automatically audits mathematical assumptions (e.g., multicollinearity, heteroskedasticity, normality, and perfect separation) and outputs publication-ready, APA-formatted tables. It deliberately avoids hidden heuristics and external dependencies, ensuring computational transparency and reproducibility for applied research. |
| Authors: | Manuel Soto-Pérez [aut, cre] |
| Maintainer: | Manuel Soto-Pérez <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 1.0.0 |
| Built: | 2026-05-14 12:31:39 UTC |
| Source: | https://github.com/cran/OLSengine |
Estimates OLS regression, ANOVA/t-tests, or binary logistic regression models using pure base R matrix algebra. Automatically audits statistical assumptions through an integrated methodological customs layer and returns publication-ready APA-formatted tables. Designed for applied researchers and early-career academics who need a single, transparent workflow from estimation to reporting.
paper_engine( formula, data, model = "ols", robust = FALSE, non_parametric = FALSE, paired = FALSE, digits = 2 )paper_engine( formula, data, model = "ols", robust = FALSE, non_parametric = FALSE, paired = FALSE, digits = 2 )
formula |
A |
data |
A data frame containing all variables referenced in |
model |
A character string indicating the estimation engine.
One of |
robust |
Logical or |
non_parametric |
Logical or |
paired |
Logical. If |
digits |
Integer. Number of decimal places in output tables.
Default is |
An object of class basic_model, which is a list containing:
A list of formatted data frames with estimation results.
A list of raw diagnostic statistics (p-values, fit indices).
A character vector of methodological guidance messages from the customs layer.
A character string indicating the engine used ("ols", "anova", or "logit").
The cleaned data frame used for estimation (after listwise deletion).
# OLS example set.seed(42) df <- data.frame(y = rnorm(100), x1 = rnorm(100), x2 = rnorm(100)) result <- paper_engine(y ~ x1 + x2, data = df, model = "ols") print(result$tables) print(result$messages) # ANOVA example df2 <- data.frame(score = c(rnorm(30, 5), rnorm(30, 7)), group = rep(c("A", "B"), each = 30)) result2 <- paper_engine(score ~ group, data = df2, model = "anova") print(result2$tables) # Logit example df3 <- data.frame(y = rbinom(100, 1, 0.5), x = rnorm(100)) result3 <- paper_engine(y ~ x, data = df3, model = "logit") print(result3$tables)# OLS example set.seed(42) df <- data.frame(y = rnorm(100), x1 = rnorm(100), x2 = rnorm(100)) result <- paper_engine(y ~ x1 + x2, data = df, model = "ols") print(result$tables) print(result$messages) # ANOVA example df2 <- data.frame(score = c(rnorm(30, 5), rnorm(30, 7)), group = rep(c("A", "B"), each = 30)) result2 <- paper_engine(score ~ group, data = df2, model = "anova") print(result2$tables) # Logit example df3 <- data.frame(y = rbinom(100, 1, 0.5), x = rnorm(100)) result3 <- paper_engine(y ~ x, data = df3, model = "logit") print(result3$tables)
Produces minimalist APA-style plots from a basic_model
object returned by paper_engine. The plot type is selected
automatically based on the estimation method: a forest plot of coefficients
with 95% CI for OLS, a group means plot with 95% CI error bars for ANOVA,
and a logistic probability curve for logistic regression.
plot_engine(model_object, y_label = NULL, x_label = NULL)plot_engine(model_object, y_label = NULL, x_label = NULL)
model_object |
An object of class |
y_label |
A character string for the Y-axis label. If |
x_label |
A character string for the X-axis label. If |
A base R plot rendered in the active graphics device. The function
is called for its side effect (the plot) and returns NULL invisibly.
set.seed(42) df <- data.frame(y = rnorm(100), x1 = rnorm(100), x2 = rnorm(100)) result <- paper_engine(y ~ x1 + x2, data = df, model = "ols") plot_engine(result, y_label = "Outcome", x_label = "Predictors")set.seed(42) df <- data.frame(y = rnorm(100), x1 = rnorm(100), x2 = rnorm(100)) result <- paper_engine(y ~ x1 + x2, data = df, model = "ols") plot_engine(result, y_label = "Outcome", x_label = "Predictors")