success_stats: Compute stats for task success (completion) data

Description Usage Arguments Details Value See Also Examples

View source: R/success_stats-function.R

Description

Sauro and Lewis (2012) describe various approaches for estimating success rates and generating confidence intervals when you're working with smaller sample sizes. success_stats() automatically determines which of several estimator adjustments is best suited to the data, and it returns a tibble with the original and adjusted success rates (as a percentage); a field to indicate which adjustment method was used; and information about the confidence interval.

success_stats() and completion_stats() are synonyms.

Usage

1
2
3
4
5
6
7
8
9
success_stats(.x, ...)

completion_stats(.x, ...)

## S3 method for class 'numeric'
success_stats(.x, .n = NULL, ..., .alpha = 0.05)

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

Arguments

.x

A single numeric value, a vector of values, or a long-format data frame with a named column of numeric data (1s and/or 0s) corresponding to task success outcomes. See Details.

...

(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.

.n

If .x is a single numeric value, .n should be a single numeric value representing the total number of trials. See Details.

.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 long-format data frame, the (unquoted) name of a data frame column containing task success outcomes (as 1s and 0s, corresponding to successes and failures, respectively).

Details

Note that NAs are automatically dropped in all calculations.

Value

A tibble with success rate(s), confidence interval information, and other information. All percentage values in the output fall within the range of 0 and 100.

See Also

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

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#You can pass a vector of 1s and 0s to .x:

success_stats(c(1,1,1,1,0,0,1,1,0,1,0,1))

# If you want a summary for a single task, you can provide the number
# of successes and trials to .x and .n, respectively:

success_stats(.x = 15, .n = 20)


# You can pass a long-format data frame to .x and
# and specify the name of the appropriate column to .var:

.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)),
   "task_success"  = sample(0:1,20,replace=TRUE,prob = c(.3,.65)))

success_stats(.ux_data, task_success)

# If you have one or more grouping variables, pass them to the ... argument:

success_stats(.ux_data, task_success, group, task)

# .alpha defaults to 0.05. Change the value by
# naming the argument when you call the function:

success_stats(15,20, .alpha = 0.01)

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