overview {esci} | R Documentation |
Calculates descriptive statistics for a continuous variable
Description
This function calculates basic descriptive statistics for a numerical variable. It can calculate an overall summary, or broken down by the levels of a grouping variable. Inputs can be summary data, vectors, or a data frame.
Usage
overview(
data = NULL,
outcome_variable = NULL,
grouping_variable = NULL,
means = NULL,
sds = NULL,
ns = NULL,
grouping_variable_levels = NULL,
outcome_variable_name = "My Outcome Variable",
grouping_variable_name = NULL,
conf_level = 0.95,
assume_equal_variance = FALSE
)
Arguments
data |
|
outcome_variable |
|
grouping_variable |
|
means |
For summary data - A vector of 1 or more numerical means |
sds |
For summary data - A vector of standard deviations, same length as means |
ns |
For summary data - A vector of sample sizes, same length as means |
grouping_variable_levels |
For summary data - An optional vector of group labels, same length as means. If not passed, auto-generated. |
outcome_variable_name |
Optional friendly name for the outcome variable. Defaults to 'My Outcome Variable'. Ignored if a data-frame is passed, this argument is ignored. |
grouping_variable_name |
Optional friendly name for the grouping variable. If a data frame is passed, this argument is ignored. |
conf_level |
The confidence level for the confidence interval. Given in decimal form. Defaults to 0.95. |
assume_equal_variance |
Defaults to FALSE |
Details
If equal variance is not assumed, each group is treated independently. In
that case, the estimated mean, CI, and SE is from statpsych::ci.mean1()
,
and the estimated median, CI, and SE is from statpsych::ci.median1()
. If
equal variance is assumed, each group CI is calculated as with respect to all
group data, using statpsych::ci.lc.mean.bs()
and
statpsych::ci.lc.median.bs()
Value
Returns a table of descriptive statistics
-
overview
-
outcome_variable_name -
-
grouping_variable_name -
-
grouping_variable_level -
-
mean -
-
mean_LL -
-
mean_UL -
-
median -
-
median_LL -
-
median_UL -
-
sd -
-
min -
-
max -
-
q1 -
-
q3 -
-
n -
-
missing -
-
df -
-
mean_SE -
-
median_SE -
-
Examples
# example code
esci::overview(data_latimier_3groups, "Test%", "Group")