Learn R Programming

mechkar (version 1.14.6)

Table2: Print a formatted table with the Odds/Hazard ratios from a given model

Description

This function creates a table with the Odds/Hazard ratios (depending on the model type) with their confidence intervals and p-values.

Usage

Table2(mod, rv=NULL, level = 0.95, decimals = 3)

Arguments

mod

the model name

rv

(Optional) the text to be used for each of the variables to be used. If ommited, the original variable names will be used.

level

the confidence level to be used. Default=0.95

decimals

the number of decimals to be used. Default=3

Value

This function returns a data frame object with the table of the variables with the coeficients of the model and their p-value

Details

The Table2 function generates a summary table containing the exponent of the model coefficients and the respective confidence intervals and p-values.

Examples

Run this code
# NOT RUN {
df <- MASS::biopsy[,2:11]
mod <- glm(class ~ ., data=df ,family = "binomial")
vn <- c("Intercept","clump thickness","uniformity cell size","uniformity cell shape",
        "marginal adhesion","epithelial cell size","bare nuclei",
        "bland chromatin","normal nucleoli","mitoses")
rn <- data.frame(vars=vn,cats=rep("",10))

tab2 <- Table2(mod=mod,rv = vn)
# }

Run the code above in your browser using DataLab