-
Notifications
You must be signed in to change notification settings - Fork 2
/
ezgroup.Rmd
40 lines (33 loc) · 846 Bytes
/
ezgroup.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
---
title: "ezcox: Easy Group Cox Analysis and Visualization"
author: "Shixiang Wang \\
SYSUCC"
date: "`r Sys.Date()`"
output:
prettydoc::html_pretty:
toc: true
theme: cayman
highlight: github
pdf_document:
toc: true
vignette: >
%\VignetteIndexEntry{ezcox: Easy Group Cox Analysis and Visualization}
%\VignetteEngine{knitr::rmarkdown}
%\VignetteEncoding{UTF-8}
---
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>"
)
```
```{r setup}
library(ezcox)
```
```{r, fig.width=7, fig.height=5}
library(survival)
lung$ph.ecog <- factor(lung$ph.ecog)
ezcox_group(lung, grp_var = "sex", covariate = "ph.ecog")
ezcox_group(lung, grp_var = "sex", covariate = "ph.ecog", controls = "age")
ezcox_group(lung, grp_var = "sex", covariate = "ph.ecog", controls = "age", add_all = TRUE)
```