rms_estimate_with_int: Function to get estimates, on original or ratio scale, for a...

Description Usage Arguments Value See Also Examples

View source: R/rms_estimate_with_int.R

Description

This will often be used in conjunction with lapply or purrr::pmap. For an example, see chunk death_inhosp_plot in this Rnw file (function here is called estimate.with.interaction.rms).

Usage

1
rms_estimate_with_int(rmsObjName, estVar, estVals, intVar, intAdjust, getRatios)

Arguments

rmsObjName

Character string; name of model fit object of class rms

estVar

Character string; name of variable for which we want estimate/CI

estVals

Vector of length 2; comparison wanted for main variable. Default = datadist() defaults.

intVar

Character string; name of interacting variable

intAdjust

Character or numeric value; value to adjust intVar to. Default = datadist() default.

getRatios

Indicator for whether to calculate ratios (exp(XB)) vs estimates on XB scale. Defaults to TRUE if get(rmsObjName) is from cph() or lrm().

Value

data.frame containing reference, comparison, effect, lower and upper confidence limits, variable name and indicator for whether row contains reference:reference comparison.

See Also

ols, lrm, cph, Gls, summary.rms, map, pmap.

Examples

1
2
3
4
5
6
7
8
9
## Fit logistic regression using lrm()
mymod <- lrm(Species ~ Sepal.Length * Sepal.Width, data = iris)

## Set datadist
dd.iris <- datadist(iris)
options(datadist = 'dd.iris')

## Continuous covariate, comparing all quantiles to median by default
rms_estimate_with_int('mymod', estVar = 'Sepal.Length', intVar = 'Sepal.Width')

jenniferthompson/JTHelpers documentation built on May 19, 2019, 4:04 a.m.