Description Usage Arguments Details Value See Also Examples
View source: R/success_stats-function.R
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.
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)
|
.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 |
.n |
If |
.alpha |
(Optional) A positive number (where 0 < |
.var |
If |
.x
is the only required argument if you are passing a vector of 1s and 0s, representing successes and failures, respectively. e.g., .x = c(1,1,1,1,1,0,1)
If .x
is a single numeric value representing the total number of successes, .n
should be a single numeric value representing the total number of trials (where the value of .y
>= the value of .x
). e.g., .x = 23, .y = 25
If .x
is a data frame, .var
should be the unquoted name of the column containing the success data (as 1s and 0s).
You can modify the alpha level to adjust confidence intervals by including .alpha
as a named argument and providing a numeric value: e.g., .aplha = 0.001
.
If you're passing a data frame to .x
, you can optionally pass one or more grouping variables as unquoted, comma-separated column names (without naming the ...
argument) to compute stats by groups.
Note that NAs
are automatically dropped in all calculations.
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.
Other descriptive stats for UX measures:
problem_stats()
,
ratings_stats()
,
time_stats()
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.