本文将详细解析tbl_svysummary所使用的统计方法,并通过步骤进行详细说明。 一、引言 在社会科学、公共卫生、市场研究等领域,我们经常需要处理来自复杂抽样设计的数据。这些数据的分析不能简单地使用常规的描述性统计方法,因为它们需要考虑到样本权重、集群效应、分层结构等因素。R语言的survey包为此提供了一系列强大的工具...
一、tbl_svysummary函数的基本原理 1.1 tbl_svysummary函数的作用 tbl_svysummary函数主要用于对调查数据进行汇总和统计分析。它可以对数据集中的各个变量进行描述性统计,如均值、标准差、中位数等。它还可以进行基于样本设计的推断统计分析,如置信区间估计、假设检验等。 1.2 tbl_svysummary函数的实现原理 tbl_svysumm...
0.917370028585327,0.897412512251031,1.06634082743438,0.94432371066466,0.526887241987567,0.526887241987567,0.546578869586901,0.283198307048893,0.494322145606406)),row.names=c(NA,10L),class="data.frame")dat_svy<-dat_dput|>srvyr::as_survey_design
Other tbl_summary tools:add_n.tbl_summary(),add_overall(),add_p.tbl_summary(),add_q(),add_stat_label(),bold_italicize_labels_levels,inline_text.tbl_summary(),inline_text.tbl_survfit(),modify,tbl_merge(),tbl_summary() Other tbl_svysummary tools:add_n.tbl_summary(),add_overall(),...
tbl_summary函数通过接收一个数据框(data frame)和一些参数来生成一个表格,这个表格包含了数据集中每个变量的统计摘要。它可以处理数值型、分类变量,并且可以添加 p 值、置信区间等统计信息。 相关优势 自动化:快速生成统计摘要表格。 定制化:可以自定义表格的样式和内容。
在tbl_svysummary函数中,常用的统计方法包括: 1.描述性统计:计算表格中的频数、比例、均值、标准差、最小值、最大值等基本统计量。 2.列统计:对表格中的某一列进行统计分析,如计算均值、标准差、最小值、最大值等。 3.行统计:对表格中的某一行进行统计分析,如计算总和、平均值等。 4.交叉表:计算两个分类...
Like `tbl_summary()`, `tbl_svysummary()` accepts the `by=` argument and works with the `add_p()` and `add_overall()` functions. It is not possible to pass custom functions to the `statistic=` argument of `tbl_svysummary()`. You must use one of the [pre-defined summary ...
svy_apiclus1|>tbl_svysummary(# stratify summary statistics by the "both" columnby=both,# summarize a subset of the columnsinclude=c(api00,api99,both),# adding labels to tablelabel=list(api00="API in 2000",api99="API in 1999"))|>add_p()|># comparing values by "both" columnadd_...
方案 在一个新的 R 会话中使用 search() 可以查看默认加载的包。 search() #> [1] ".GlobalEnv...
tbl_summary() Basic code trial %>% select(trt,age,grade,response))%>% tbl_summary() Basic table tbl_svysummary() for survey objects Same functionality as tbl_summary(), but takes a survey object as input, and accounts for survey weights and design. More info at: http://www.danield...