自学内容网 自学内容网

R语言复杂抽样调查数据统计描述和分析

gtsummary包中tbl_svysummary提供了统计描述;tableone包中的svyCreateTableOne提供了统计比较;原始描述和比较可以是有table1包。

#测试数据
library(survey)
setwd("F://")
data(Titanic)
sur_des<-survey::svydesign(~1, data = as.data.frame(Titanic), weights = ~Freq)
str(Titanic)

 

#1 使用gtsummary包
library(gtsummary)
tabl1<-tbl_svysummary(data=sur_des,by = Survived, percent = "row",
                      statistic=list(all_continuous() ~ "{median} ({p25}, {p75})", all_categorical() ~ "{n} ({p}%)"))

#2 使用tableone包
library(tableone)
tabl2 <- svyCreateTableOne(vars = c("Age","Sex"),
                          strata = "Survived", data = sur_des,
                          factorVars = c("Age","Sex"))

 

 借鉴既往已发表的SCI:

1、部分研究曾使用过svyCreateTableOne

【1】Rosenbloom JM, Burns SM, Kim E, August DA, Ortiz VE, Houle TT. Race/Ethnicity and Sex and Opioid Administration in the Emergency Room. Anesth Analg. 2019 May;128(5):1005-1012. doi: 10.1213/ANE.0000000000003517. PMID: 29863607; PMCID: PMC6611165.

Based on our a priori inclusion/exclusion criteria, a weighted sample of 553 patients representing a total of 2,622,926 patients was included, composed of 1,858,035 (70.8%) females and 1,535,794 (58.6%) Caucasian non-Hispanics. The average age was 33.3 (standard deviation = 11.4) years and 170,975 (6.5 %) cases were emergent. The sample included patients from all 4 geographical regions in the United States and 44.0% patients had private insurance (Table 1; Supplemental Digital Content 1, Table, http://links.lww.com/AA/C432). Overall, 61.4% of patients received opioids (Table 2).

【2】Inoue K, Seeman TE, Nianogo R, Okubo Y. The effect of poverty on the relationship between household education levels and obesity in U.S. children and adolescents: an observational study. Lancet Reg Health Am. 2023. 25: 100565.


原文地址:https://blog.csdn.net/weixin_49320263/article/details/143083919

免责声明:本站文章内容转载自网络资源,如本站内容侵犯了原著者的合法权益,可联系本站删除。更多内容请关注自学内容网(zxcms.com)!