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

paired

Summary Statistics of a Set of Independent Variables Paired Across Two Timepoints


Description

Summarize one or more variables (x) by a paired time variable (y). Variables on the right side of the formula, i.e. independent variables, are summarized by the two time points on the left of the formula. Optionally, an appropriate test is performed to test the distribution of the independent variables across the time points.

Usage

paired(
  formula,
  data,
  id,
  na.action,
  subset = NULL,
  strata,
  control = NULL,
  ...
)

Arguments

formula

an object of class formula of the form time ~ var1 + .... See "Details" for more information.

data

an optional data frame, list or environment (or object coercible by as.data.frame to a data frame) containing the variables in the model. If not found in data, the variables are taken from environment(formula), typically the environment from which the function is called.

id

The vector giving IDs to match up data for the same subject across two timepoints.

na.action

a function which indicates what should happen when the data contain NAs. The default is na.paired("in.both"). See na.paired for more details

subset

an optional vector specifying a subset of observations (rows of data) to be used in the results. Works as vector of logicals or an index.

strata

a vector of strata to separate summaries by an additional group.

control

control parameters to handle optional settings within paired. Two aspects of paired are controlled with these: test options of RHS variables and x variable summaries. Arguments for paired.control can be passed to paired via the ... argument, but if a control object and ... arguments are both supplied, the latter are used. See paired.control for more details.

...

additional arguments to be passed to internal paired functions or paired.control.

Details

Do note that this function piggybacks off of tableby quite heavily, so there is no summary.paired function (for instance).

These tests are accepted:

Value

An object with class c("paired", "tableby", "arsenal_table")

Author(s)

Jason Sinnwell, Beth Atkinson, Ryan Lennon, and Ethan Heinzen

See Also


arsenal

An Arsenal of 'R' Functions for Large-Scale Statistical Summaries

v3.6.2
GPL (>= 2)
Authors
Ethan Heinzen [aut, cre], Jason Sinnwell [aut], Elizabeth Atkinson [aut], Tina Gunderson [aut], Gregory Dougherty [aut], Patrick Votruba [ctb], Ryan Lennon [ctb], Andrew Hanson [ctb], Krista Goergen [ctb], Emily Lundt [ctb], Brendan Broderick [ctb], Maddie McCullough [art]
Initial release
2021-02-16

We don't support your browser anymore

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