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.
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
)
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 -
for raw data, a data frame or tibble
for raw data, either a vector containing numerical data or the name of a data-frame column containing a factor
optional; for raw data either a vector containing a factor or the name of a data frame column containing a factor
For summary data - A vector of 1 or more numerical means
For summary data - A vector of standard deviations, same length as means
For summary data - A vector of sample sizes, same length as means
For summary data - An optional vector of group labels, same length as means. If not passed, auto-generated.
Optional friendly name for the outcome variable. Defaults to 'My Outcome Variable'. Ignored if a data-frame is passed, this argument is ignored.
Optional friendly name for the grouping variable. If a data frame is passed, this argument is ignored.
The confidence level for the confidence interval. Given in decimal form. Defaults to 0.95.
Defaults to FALSE
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()
# example code
esci::overview(data_latimier_3groups, "Test%", "Group")
Run the code above in your browser using DataLab