Description Usage Arguments Details Value See Also Examples
View source: R/ratings_vs_bench-function.R
ratings_vs_bench()
tests a sample mean of continuous data (e.g., ratings) against a given benchmark using a one-sample t-test.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | ratings_vs_bench(.x, ...)
## S3 method for class 'numeric'
ratings_vs_bench(
.x,
.sd,
.n,
.m,
...,
.alt = c("greater", "less", "twotailed"),
.alpha = 0.05
)
## S3 method for class 'data.frame'
ratings_vs_bench(.x, .var, .m, ..., .alt = "greater", .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 corresponding to ratings or another continuous metric. See Details. |
... |
(Optional) If |
.sd |
If |
.n |
If |
.m |
The test (benchmark) mean. |
.alt |
(Optional) For test alternatives, one of |
.alpha |
(Optional) A positive number (where 0 < |
.var |
If |
ratings_vs_bench
assumes that you want to test the hypothesis that the observed outcome exceeds the benchmark, and therefore, defaults to a one-tailed test. This means that setting .alpha = 0.05
(the default) produces a 90% confidence interval.
If .x
is a single numeric value representing the sample mean, provide the sample standard deviation and sample size to .sd
and .n
, respectively.
If .x
is a numeric vector of ratings values, you should only specify the test (benchmark) mean.
If .x
is a data frame, .var
should be the unquoted name of the column containing the ratings values.
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.
You can choose from among the test alternatives c("greater","less","twotailed")
by providing one of the options to the .alt
argument: e.g., .alt = "twotailed"
. Defaults to "greater" for a one-sided test.
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
.
Note that NAs
are automatically dropped in all calculations.
A tibble with data summaries and test results
Other benchmark comparison stats:
success_vs_bench()
,
time_vs_bench()
1 2 3 4 5 6 7 8 9 10 11 12 | # Comparing a sample ratings mean of 79 (sd = 20) from 160 users
# against a benchmark mean of 75
ratings_vs_bench(.x=79,.sd=20,.n=160,.m=75)
# Comparing values from a data frame against a benchmark of 70.
.ux_data <-
data.frame(
"id" = rep(seq(1,10,1),2),
"task" = c(rep(1,10),rep(2,10)),
"ratings" = runif(20,0,100))
ratings_vs_bench(.ux_data, ratings, .m=70, task)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.