nicepolr: Lisa's Proportional Odds Logistic Regression Table Reporting...

Description Usage Arguments

View source: R/nicepolr.R

Description

This function creates a nice looking table of regression results for a polr (MASS) model. Input either a polr object or dataframe, outcome variable, vector of covariates, method, 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
nicepolr(fit = NA, df = NA, method = "logistic", covs = NA,
  out = NA, regtype = "multi", exp = NA, estname = NA,
  refcat = FALSE, labels = NA, type2 = FALSE, type3 = FALSE,
  est.dec = 2, ci.dec = 2, pval.dec = 3, color = "#EEEEEE",
  kable = TRUE, htmlTable = FALSE, title = "", footer = TRUE)

Arguments

fit

polr model object [fit or method/covs/out are REQUIRED].

df

Dataframe [fit or df/method/covs/out].

method

Character. Model type in quotes ("logisitc", "probit", "loglog", "cloglog", "cauchit"). Default is "logistic".

covs

Character. Vector of covariates to include in model [fit or df/method/covs/out are REQUIRED].

out

Character. Outcome for regression model [fit or df/method/covs/out are REQUIRED].

regtype

Logical. Should the covariates be run separately ("uni") or together in a multiple regression model ("multi"). Deafult is "multi".

exp

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

estname

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

refcat

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

labels

Character. Vector of labels for covariates. Default is NA (use variable names).

type2

Logical. If TRUE, type II p-values will be added to the table. Default is FALSE.

type3

Logical, If TRUE, type III p-values will be added to the table. 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. Default is TRUE.


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