Quantcast
Channel: r software hub
Viewing all articles
Browse latest Browse all 1015

How to export Regression results from R to MS Word

$
0
0

By Klodian Dhana

table2hrs

In this post I will present a simple way how to export your regression results (or output) from R into Microsoft Word. Previously, I have written a tutorial how to create Table 1 with study characteristics and to export into Microsoft Word. These posts are especially useful for researchers who prepare their manuscript for publication in peer-reviewed journals.

Get the results from Cox Regression Analysis

As an example to illustrate this post, I will compute a survival analysis. Survival analysis is statistical methods for analyzing data where the outcome variable is the time until the occurrence of an event. The event can be a occurrence of a disease or death, etc. In R we compute the survival analysis with the survival package. The function for Cox regression analysis is coxph(). I will use the veteran data which come with survival package.

## Load survival package
library(survival)

# Load veteran data
data(veteran)

# Show first 6 rows
head(veteran)
trt celltype time status karno diagtime age prior
1 1 squamous 72 1 60 7 69 0
2 1 squamous 411 1 70 5 64 10
3 1 squamous 228 1 60 3 38 0
4 1 squamous 126 1 60 9 63 10
5 1 squamous 118 1 70 ...read more

Source:: r-bloggers.com


Viewing all articles
Browse latest Browse all 1015

Trending Articles