knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "man/figures/README-", out.width = "100%" )
The goal of ezcox is to operate a batch of univariate or multivariate Cox models and return tidy result.
You can install the released version of ezcox from CRAN with:
install.packages("ezcox")
And the development version from GitHub with:
# install.packages("remotes") remotes::install_github("ShixiangWang/ezcox")
It is possible to install ezcox from Conda conda-forge
channel:
conda install r-ezcox --channel conda-forge
Visualization feature of ezcox needs the recent version of forestmodel, please run the following commands:
remotes::install_github("ShixiangWang/forestmodel")
This is a basic example which shows you how to get result from a batch of cox models.
library(ezcox) library(survival) # Build unvariable models ezcox(lung, covariates = c("age", "sex", "ph.ecog")) # Build multi-variable models # Control variable 'age' ezcox(lung, covariates = c("sex", "ph.ecog"), controls = "age")
lung$ph.ecog = factor(lung$ph.ecog) zz = ezcox(lung, covariates = c("sex", "ph.ecog"), controls = "age", return_models=TRUE) mds = get_models(zz) str(mds, max.level = 1) show_models(mds)
If you are using it in academic research, please cite the preprint arXiv:2110.14232 along with URL of this repo.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.