Learn R Programming

allestimates: Effect Estimates from All Possible Models

Calculates effect estimates from models with all possible combinations of a list of variables specified by users. Effect estimates can be regression coefficients, odds ratios and hazard ratios depending on modeling methods. This approach can be used for assessing treatment effects in clinical trials or the effects of a risk factor in observational biomedical and epidemiological studies.

Installation

You can install the released version of allestimates from CRAN with:

install.packages("allestimates")

Example

Using diab_df data to assess the association between marital status Married and and Diabetes as an example. Several other factors might potentially influence the association (odds ratio estimates) between Married and Diabetes variables.

library(allestimates)
data(diab_df)
diab_df$Overweight = as.numeric(diab_df$BMI >= 25)
vlist <- c("Age", "Sex", "Education","Smoke", "BMI", "Income")
results <- all_speedglm(crude = "Diabetes ~ Married",  xlist = vlist, data = diab_df)
#> estimate: Odds Ratio or Rate Ratio
#> Crude model: Diabetes ~ Married

All those possible effect estimates (odds ratios in this case) are stored in an object results and can be used later for further analysis and generating various graphs.

all_plot(results)

From this all_plot graph, we can see that all estimated odds ratio values fell in the left-side two quarters, with either a positive or a negative association but p values in all possible models were greater than 0.05.

all_plot2(results)

all_plot2 graph shows effect estimates with a specific variable being included or not included in the model. This can be helpful in combination with biological background knowledge to understand potential confounding effects, uncertainly of the effect estimates, and inappropriate inclusion of some variables.

Note: Interaction terms and other derived variables can be listed. Those terms need to be generated first before running an allestimates function.

Copy Link

Version

Install

install.packages('allestimates')

Monthly Downloads

412

Version

0.2.3

License

GPL-2

Maintainer

Zhiqiang Wang

Last Published

March 26th, 2023

Functions in allestimates (0.2.3)

all_cox

Estimates all possible effect estimates using Cox Proportional Hazards regression models
all_lm

Estimates all possible effect estimates using lm
all_plot_aic

Draws scatter plot with all effect estimates against AIC
diab_df

Example data: Health outcomes of 2372 adults with and without diabetes
all_glm

Estimates all possible effect estimates using glm
allestimates

Effect estimates from models with all possible combinations of variables
all_plot

Plot all effect estimates against p values
all_plot_aic2

Draws multiple scatter plots of all effect estimates against AIC
all_plot2

Plots all effect estimates against p values with each specific variable in the models