An open API service indexing awesome lists of open source software.

https://github.com/shixiangwang/ezcox

Easily Process a Batch of Cox Models
https://github.com/shixiangwang/ezcox

batch-processing cox-model r-package

Last synced: about 1 month ago
JSON representation

Easily Process a Batch of Cox Models

Awesome Lists containing this project

README

        

---
output: github_document
---

```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
# ezcox: Easily Process a Batch of Cox Models

[![CRAN status](https://www.r-pkg.org/badges/version/ezcox)](https://CRAN.R-project.org/package=ezcox)
[![](https://cranlogs.r-pkg.org/badges/grand-total/ezcox?color=blue)](https://cran.r-project.org/package=ezcox)
[![Hits](https://hits.seeyoufarm.com/api/count/incr/badge.svg?url=https%3A%2F%2Fgithub.com%2FShixiangWang%2Fezcox&count_bg=%2379C83D&title_bg=%23555555&icon=fandom.svg&icon_color=%23E7E7E7&title=hits&edge_flat=false)](https://hits.seeyoufarm.com)
![R-CMD-check](https://github.com/ShixiangWang/ezcox/workflows/R-CMD-check/badge.svg)
[![Lifecycle: stable](https://img.shields.io/badge/lifecycle-stable-brightgreen.svg)](https://lifecycle.r-lib.org/articles/stages.html)

The goal of ezcox is to operate a batch of univariate or multivariate Cox models and return tidy result.

## :arrow_double_down: Installation

You can install the released version of ezcox from [CRAN](https://CRAN.R-project.org) with:

```r
install.packages("ezcox")
```

And the development version from [GitHub](https://github.com/) with:

```r
# install.packages("remotes")
remotes::install_github("ShixiangWang/ezcox")
```

It is possible to install **ezcox** from Conda `conda-forge` channel:

```r
conda install r-ezcox --channel conda-forge
```

Visualization feature of **ezcox** needs the recent version of **forestmodel**, please run the following commands:

```r
remotes::install_github("ShixiangWang/forestmodel")
```

## :beginner: Example

This is a basic example which shows you how to get result from a batch of cox models.

```{r example}
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")
```

```{r}
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)
```

## :star2: Vignettes

- [ezcox: Easily Process a Batch of Cox Models](https://CRAN.R-project.org/package=ezcox/vignettes/ezcox.html)
- [ezcox: Easily Show Cox Forestplot in One Command](https://CRAN.R-project.org/package=ezcox/vignettes/ezforest.html)
- [ezcox: Easy Group Cox Analysis and Visualization](https://CRAN.R-project.org/package=ezcox/vignettes/ezgroup.html)
- [ezcox: an R Package for Cox Model Batch Processing and Visualization - An Use Case](https://shixiangwang.github.io/ezcox-adv-usage/)

## :page_with_curl: Citation

If you are using it in academic research,
please cite the preprint [arXiv:2110.14232](https://arxiv.org/abs/2110.14232) along with URL of this repo.