time_stats: Compute stats for time data

Description Usage Arguments Details Value See Also Examples

View source: R/time_stats-function.R

Description

Following Sauro and Lewis (2012), time_stats() takes the sample size into account when computing stats on time data.

Usage

1
2
3
4
5
6
7
time_stats(.x, ...)

## S3 method for class 'numeric'
time_stats(.x, ..., .alpha = 0.05)

## S3 method for class 'data.frame'
time_stats(.x, .var, ..., .alpha = 0.05)

Arguments

.x

A vector or long-format data frame with a named column of numeric values corresponding to task or response times.

...

(Optional) If .x is a long-format data frame, you can pass the name of one or more grouping variables as unquoted, comma-separated column names (without naming the ... argument) to compute stats by groups.

.alpha

(Optional) A positive number (where 0 < .alpha < 1) specifying the significance level to be used. Defaults to .alpha = 0.05. To set a different significance level, the argument must be named (i.e., .alpha=0.001) or else the function may yield unexpected results.

.var

If x is a data frame, the unquoted name of column containing the values to use in the computations.

Details

time_stats() returns several point estimates, including means, geometric means (better when sample size <= 25), and medians (better for larger sample sizes). It also returns confidence interval information based on log-transformed values (for small samples) or raw (untransformed) data (for larger samples).

Note that NAs are automatically dropped in all calculations.

Value

A tibble with one or more means, confidence interval information, and other information.

See Also

Other descriptive stats for UX measures: problem_stats(), ratings_stats(), success_stats()

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
time_stats(c(40, 36, 53, 56, 110, 48, 34, 44, 30, 40, 80))

.ux_data <-
data.frame(
 "id" = rep(seq(1,10,1),2),
 "group" = rep(c("A","B"),10),
 "task" = c(rep(1,10),rep(2,10)),
 "time"  = runif(20,200,1000)
)

time_stats(.ux_data, .var=time, task, .alpha = 0.001)

darrellpenta/uxstats documentation built on Jan. 18, 2022, 8:06 p.m.