Title: Convert Regression Between Base Function and 'rms' Package
Version: 1.0
Description: We perform linear, logistic, and cox regression using the base functions lm(), glm(), and coxph() in the R software and the 'survival' package. Likewise, we can use ols(), lrm() and cph() from the 'rms' package for the same functionality. Each of these two sets of commands has a different focus. In many cases, we need to use both sets of commands in the same situation, e.g. we need to filter the full subset model using AIC, and we need to build a visualization graph for the final model. 'base.rms' package can help you to switch between the two sets of commands easily.
License: GPL-3
Encoding: UTF-8
LazyData: true
RoxygenNote: 7.1.1
Imports: rms, survival, do, splines, stats
Suggests: knitr, rmarkdown
VignetteBuilder: knitr
NeedsCompilation: no
Packaged: 2020-07-27 13:36:47 UTC; asus
Author: Jing Zhang [aut, cre], Zhi Jin [aut]
Maintainer: Jing Zhang <zj391120@163.com>
Repository: CRAN
Date/Publication: 2020-08-01 11:10:08 UTC

Convert results of cox regression from coxph() to cph()

Description

Convert results of cox regression from coxph() in 'survival' package to cph() in 'rms' package.

Usage

coxph2cph(fit)

Arguments

fit

cox regression results of coxph()

Value

results of coxph()

Examples

library(survival)
fit <- coxph(Surv(mpg,vs)~am+gear+carb,data=mtcars)
coxph2cph(fit)

Convert results of cox regression from cph() to coxph()

Description

Convert results of cox regression from cph() in 'rms' package to coxph() in 'stats' package.

Usage

cph2coxph(fit)

Arguments

fit

cox regression results of cph()

Value

results of coxph()

Examples

library(rms)
fit <- cph(formula = Surv(mpg, vs) ~ am + gear + carb, data = mtcars)
cph2coxph(fit)

Convert results of lm() to ols()

Description

Convert results of lm() from 'stats' package to ols() from 'rms' package.

Usage

lm2ols(fit)

Arguments

fit

reults of lm()

Value

results of ols()

Examples

fit <- lm(mpg ~ disp,data=mtcars)
lm2ols(fit)

Convert results of logistic regression from glm() to lrm()

Description

Convert results of logistic regression from glm() in 'stats' package to lrm() in 'rms' package.

Usage

logit2lrm(fit)

Arguments

fit

logistic regression reults of glm()

Value

results of lrm()

Examples

fit <- glm(vs~mpg+cyl,data=mtcars, family = binomial(link = 'logit'))
logit2lrm(fit)

Convert results of logistic regression from lrm() to glm()

Description

Convert results of logistic regression from lrm() in 'rms' package to glm() in 'stats' package.

Usage

lrm2logit(fit)

Arguments

fit

logistic regression reults of lrm()

Value

results of glm()

Examples

library(rms)
fit <- lrm(vs ~ mpg + cyl, data = mtcars)
lrm2logit(fit)

Convert results of ols() to lm()

Description

Convert results of ols() from 'rms' package to lm() from 'stats' package.

Usage

ols2lm(fit)

Arguments

fit

reults of ols()

Value

results of lm()

Examples

library(rms)
fit <- ols(mpg ~ disp^2,data=mtcars)
ols2lm(fit)

mirror server hosted at Truenetwork, Russian Federation.