简体   繁体   English

表 1 r function

[英]Table1 r function

I'm using the r function table1() to get descriptive statistics by group我正在使用 r function table1()按组获取描述性统计信息

table1(~ factor(sex) + age + factor(ulcer) + thickness | status, data=melanoma2)

see example here这里的例子

for categorical variables, I want the percentage with two digits after the decimal: x.xx% and add for continuous variables the N,Q1,Q3 Is that possible?对于分类变量,我想要小数点后两位数的百分比:x.xx% 并为连续变量添加 N、Q1、Q3 这可能吗?

Thanks in advance!提前致谢!

This is the answer for question 2: "How to add for continuous variables the N,Q1,Q3 Is that possible?"这是问题 2 的答案:“如何为连续变量添加 N、Q1、Q3 这可能吗?”

You could add render.continuous.. to your code:您可以将render.continuous..添加到您的代码中:

table1(~ factor(sex) + age + factor(ulcer) + thickness | status, 
       data=melanoma2, render.continuous=c(.="N", .="Q1", .="Q3",.="Mean", .="SD", .="Median [Min, Max]"))

在此处输入图像描述

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM