
Summary Statistics of a Set of Independent Variables Paired Across Two Timepoints
Source:R/paired.R
paired.RdSummarize 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.
Arguments
- formula
an object of class
formulaof the formtime ~ var1 + .... See "Details" for more information.- data
an optional data frame, list or environment (or object coercible by
as.data.frameto a data frame) containing the variables in the model. If not found in data, the variables are taken fromenvironment(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 isna.paired("in.both"). Seena.pairedfor 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 ofpairedare controlled with these: test options of RHS variables and x variable summaries. Arguments forpaired.controlcan be passed topairedvia the...argument, but if a control object and...arguments are both supplied, the latter are used. Seepaired.controlfor more details.- ...
additional arguments to be passed to internal
pairedfunctions orpaired.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:
paired.t: a pairedt-test.mcnemar: McNemar's test.signed.rank: a signed rank test.signtest: a sign test.notest: no test is performed.