problem_stats: Compute stats for problem occurrence data

Description Usage Arguments Value See Also Examples

View source: R/problem_stats-function.R

Description

problem_stats() provides information about problem occurrence data, including problem occurrence rates (as percentages) and (Adjusted-Wald binomial) confidence interval information (as percentages). You can optionally include one or more grouping variables to compute problem occurrence rates by groups, and modify the alpha level to adjust confidence intervals.

Usage

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

## S3 method for class 'numeric'
problem_stats(.x, .y, ..., .alpha = NULL)

## S3 method for class 'data.frame'
problem_stats(.x, .y, ..., .alpha = NULL)

Arguments

.x

You can pass an integer (>0) indicating the total number of users who encountered a problem, and provide the total number of users to .y (where the value of .y >= .x). Or you can pass a data frame containing similar data. See the examples below.

.y

If .x is an integer representing the total number of successes, .y should be an integer indicating the total number of trials. Or, if .x is a long-format data frame, provide the unquoted name of the column containing the success data (as 1s and 0s) to .y.

...

(Optional) If .x is a long-format data frame, you can pass the name of one or more grouping variables here as unquoted, comma-separated column names.

.alpha

(Optional) A positive number (where 0 < .alpha < 1) specifying the desired confidence level to be used. The argument must be named (i.e., .alpha=0.001) or else the function may yield unexpected results. If the argument is omitted, the default value is 0.05, or a 95% confidence level.

Value

A tibble with problem occurrence 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: ratings_stats(), success_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
problem_stats(5,8) # Five users encountered a problem, 8 did not.

# The alpha level defaults to .alpha=0.05.
# You can provide your own alpha level
# to .alpha by naming the argument
# when you call the function:

problem_stats(15,20, .alpha = 0.01)

# If you have a long-format data frame,
# where each row contains an individual's
# data, and at least one column includes
# values indicating problem occurrences
# as 1s (problem encountered) and 0s
# you can pass the data frame to .x and
# specify the name of the task column:

.uxdata <-
data.frame("user_id" = c(1,2,3,4,5,6,7,8,9,10,11,12),
"login_prob" = c(1,0,0,1,0,0,1,1,0,0,1,0),
"group"=c("A","B","A","A","B","A","B","A","B","B","A","B"),
"version"=c(2,1,1,2,1,2,2,1,2,1,1,2),
stringsAsFactors = FALSE)

problem_stats(.uxdata, login_prob, group, .alpha=0.1)

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