Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

svyCreateContTable

Create an object summarizing continous variables for weighted dataset


Description

Create an object summarizing continous variables optionally stratifying by one or more startifying variables and performing statistical tests. Usually, svyCreateTableOne should be used as the universal frontend for both continuous and categorical data.

Usage

svyCreateContTable(
  vars,
  strata,
  data,
  test = TRUE,
  testNormal = svyTestNormal,
  argsNormal = list(method = "Wald"),
  testNonNormal = svyTestNonNormal,
  argsNonNormal = NULL,
  smd = TRUE,
  addOverall = FALSE
)

Arguments

vars

Variable(s) to be summarized given as a character vector.

strata

Stratifying (grouping) variable name(s) given as a character vector. If omitted, the overall results are returned.

data

A survey design object in which these variables exist. All variables (both vars and strata) must be in this survey design object. It is created with the svydesign function in the survey package.

test

If TRUE, as in the default and there are more than two groups, groupwise comparisons are performed. Both tests that assume normality and tests that do not are performed. Either one of the result can be obtained from the print method.

testNormal

A function used to perform the normal assumption based tests. The default is multiple degrees of freedom test using svyglm and regTermTest. This is equivalent of the svyttest when there are only two groups.

argsNormal

A named list of arguments passed to the function specified in testNormal.

testNonNormal

A function used to perform the nonparametric tests. The default is svyranktest.

argsNonNormal

A named list of arguments passed to the function specified in testNonNormal.

smd

If TRUE, as in the default and there are more than two groups, standardized mean differences for all pairwise comparisons are calculated.

addOverall

(optional, only used if strata are supplied) Adds an overall column to the table. Smd and p-value calculations are performed using only the stratifed clolumns.

Value

An object of class svyContTable.

Author(s)

Kazuki Yoshida, Alexander Bartel

See Also

Examples

## See the examples for svyCreateTableOne()

tableone

Create 'Table 1' to Describe Baseline Characteristics with or without Propensity Score Weights

v0.12.0
GPL-2
Authors
Kazuki Yoshida [cre, aut] (<https://orcid.org/0000-0002-2030-3549>), Alexander Bartel [ctb, aut] (<https://orcid.org/0000-0002-1280-6138>), Jonathan J Chipman [ctb], Justin Bohn [ctb], Lucy DAgostino McGowan [ctb], Malcolm Barrett [ctb], Rune Haubo B Christensen [ctb], gbouzill [ctb]
Initial release
2020-07-25

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.