fullSummary | R Documentation |
Compute a complete set of summary statistics for continuous variables
fullSummary(
data,
value = value,
domain = domain,
test = test,
arm = arm,
visit = visit,
ci = FALSE,
pvalue = FALSE,
pvalue.digits = 4,
approx = "t",
alpha = 0.05,
geometric = FALSE,
zeros = NULL
)
data |
A data.frame containing numeric values and columns for visit and arm, and optionally containing columns for domain and test. |
value , domain , test , arm , visit |
Unquoted names of columns in |
ci |
Whether to report the 95
mean. Defaults to |
pvalue |
Whether to report the p-value for the mean being different from zero. Almost always, this will be purely descriptive because comparison to baseline is not the point of a clinical trial. |
pvalue.digits |
The number of decimal places at which to round and format
p-values. Defaults to |
geometric |
Whether to report the geometric rather than arithmetic mean (and
confidence interval). Defaults to |
zeros |
If geometric means are required but the data contain 0s, the user
needs to tell the function what to do: either |
Note
that if 'domain' and 'test' do not exist, they will be set to empty strings.
If you want a table of all baseline values, not split by arm, you need
to filter down to the correct visit and replace arm with a single value
before calling this function. Also NOTE THAT you need to ensure BEFOREHAND that
missing values are properly included (possibly via dplyr::complete
).
The confidence interval is fixed (currently) at 95
approximation.
A data frame.
In a sane world, you'd add another line to the pipeline and remove Mean and SD. Also, I ought to write kable and formattable methods. Earlier versions (prior to 2019-05-22) used strings as all arguments but the first. However, dplyr is getting noiser about that, so I switched. I've added computation of intervals and p-values: I don't like it, but keep getting asked and it's better to build it in so that it can be properly tested, rather than do it on the fly and risk making mistakes.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.