ucr.model.tab: Description of analysis models.

View source: R/ucr_model_tab.r

ucr.model.tabR Documentation

Description of analysis models.

Description

Creates a table to summarize one or several analysis models.

Usage

ucr.model.tab(
  model,
  x.names = NULL,
  data,
  model.name,
  rm.intercept = "(Intercept)",
  allow.missing.coef = F,
  allow.duplicated.coef = F,
  factor.sep = "",
  link.fcn = exp,
  num.scale = NULL,
  include.ref = T,
  or.hr = "OR",
  include.p = T,
  n = NULL,
  max.ucl = 100
)

Arguments

model

The model object, or a list of model objects. The following classes are recognized: glm, stripped.glm, lrm, cph, mipo, glmerMod, matrix.

x.names

Names of variables to be included in the table. Variable names (in data frame), not coefficient names.

data

A data frame, typically the one that the model was built on. Used to extract coefficient names.

model.name

The name of the model. Used as column heading.

rm.intercept

A string specifying the name of the intercept term, which will be removed from the tables. If one wants to keep the intercept, the parameter should be set to NULL.

allow.missing.coef

Logical telling whether missing (absent) coefficients are allowed. If so, the corresponding table entry will be empty. O/W, the program will stop with an error.

allow.duplicated.coef

Logical telling whether duplicated coefficient names are allowed in the model. Occasionally, this can be handy, e.g. for penalized terms in a Cox model.

factor.sep

Separation between factor names and levels. Empty string for classical R models (glm etc.), but '=' for rms models, corresponding to typical coefficient names like genderMale or gender=Male.

link.fcn

A link function, e.g. the exponential function for logistic regression.

num.scale

A list to specify the scale for numerical variables. The list may contain one element for each numerical variable, named as the variable itself. These elements are themselves lists with the values "type" and (optionally) "digits" and "unit". Allowed values for the "type" field:

  • "sd": By standard deviation.

  • "iqr": By IQR.

  • A numerical value, such as 10.

If the "unit" field is provided, then this unit will be reported in the table. A typical result in the "Level" column could be "By IQR: 1.4 mmol/L". (In this example, digits = 1).

include.ref

A logical specifying whether reference levels should be included in the table.

or.hr

A string providing a name for the estimete, e.g. "OR" for odds ratios.

include.p

Logical specifying whether P-values are to be reported.

n

Number of individuals. Will be reported if non-NULL.

max.ucl

Confidence intervals are omitted (replaced by a bar) if the upper limit exeeds this value.

Value

The return value is an S3 object of class ucr.model.tab.

Author(s)

Lars Lindhagen


renlund/ucR documentation built on March 25, 2023, 10:10 a.m.