nicegee: Lisa's GEE Regression Table Reporting Function

Description Usage Arguments

View source: R/nicegee.R

Description

This function creates a nice looking table of regression results for a geeglm model. Input either a geeglm object or dataframe, outcome variable, vector of covariates, id/cluster variable, correlation structure, model family, and type of analysis (univariate or multiple regression). The function returns a dataframe of formatted regression results and prints the results table using kable or htmlTable.

Usage

1
2
3
4
5
6
nicegee(fit = NA, df = NA, family = NA, covs = NA, out = NA,
  id = NA, corstr = "exch", regtype = "multi", exp = NA,
  estname = NA, intercept = FALSE, refcat = FALSE, labels = NA,
  overallp = FALSE, est.dec = 2, ci.dec = 2, pval.dec = 3,
  color = "#EEEEEE", kable = TRUE, htmlTable = FALSE, title = "",
  footer = TRUE)

Arguments

fit

geeglm model object [fit or family/covs/out/id/corstr are REQUIRED].

df

Dataframe [fit or family/covs/out/id/corstr REQUIRED].

family

Character. Model family name in quotes ("guassian", "binomial", "poisson") [fit or family/covs/out/id/corstr are REQUIRED].

covs

Character. Vector of covariates to include in model [fit or family/covs/out/id/corstr are REQUIRED].

out

Character. Outcome for regression model [fit or family/covs/out/id/corstr are REQUIRED].

id

Character. Name of ID/cluster variable [fit or family/covs/out/id/corstr are REQUIRED].

corstr

Character. Name of correlation structure. Default is "exch".

regtype

Logical. Should the covariates be run separately ("uni") or together in a multiple regression model ("multi") [fit or family/covs/out/id/corstr are REQUIRED].

exp

Logical. Option to exponentiate coefficients and CI's. Default is NA (estimates exponentiated for binomial and poisson models by default).

estname

Character. Label for regression estimate. Default is NA (program will choose a reasonable name depending on model type).

intercept

Logical. If TRUE the intercept will be included in the table (muliple regression only). Default is FALSE.

refcat

Logical. If TRUE the table will create a separate line for the reference category. Default is FALSE.

labels

Character vector. Covariate labels in same order as covs. Default is NA (variable names are used).

overallp

Logical. If TRUE, a likelihood ratio test pvalue will be calculated for each variable (via anova, Chisq test). Default is FALSE.

est.dec

Numeric. Number of decimal places for estimates. Default is 2.

ci.dec

Numeric. Number of decimal places for 95 percent confidence interval. Default is 2.

pval.dec

Numeric. Number of decimal places for pvalues. Must be an integer from 1 to 4. Default is 3.

color

Character. Color to use for htmlTable striping. Default is "#EEEEEE" (light grey). Use "white" for no striping.

kable

Logical. If TRUE, table will be formatted using the kable packge. Default is TRUE.

htmlTable

Logical. If TRUE, the table will be printed using htmlTable. Default is FALSE.

title

Character. Optional title above table. Default is "".

footer

Logical. If TRUE, table will include a footnote with model details, nobs, R2. Default is TRUE.


lisaerein/nicereg documentation built on July 4, 2020, 9:04 p.m.