test_means_between: Test two means against each other for a "between-subjects"...

Description Usage Arguments Details Value See Also Examples

View source: R/test_means_between-function.R

Description

test_means_between() compares two sample means obtained from two different groups of users and performs a two-sided statistical test to determine if the means differ from each other.

test_means_between, ab_test_between, and test_times_between are synonyms.

Usage

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

ab_test_between(.x, ...)

## S3 method for class 'numeric'
test_means_between(.x, .sd, .n, .x2, .sd2, .n2, ..., .alpha = 0.05)

## S3 method for class 'data.frame'
test_means_between(.x, .var1, .var2, ..., .alpha = 0.05)

Arguments

.x

A single numeric value (i.e., the mean from sample 1) or a data frame with named columns of numeric data corresponding to the variables being tested. See Details.

...

(Optional) If .x is a long-format data frame with a separate unique column of data for each sample, 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.

.sd

If .x is a single numeric value representing the mean of the variable for sample 1, .sd should be a single numeric value representing the standard deviation of the variable for sample 1. See Details.

.n

If .x is a single numeric value representing the mean of the variable for sample 1, .sd should be a single numeric value representing the total number of users in sample 1. See Details.

.x2

If .x is a single numeric value representing the mean of the variable for sample 1,.x2 should be a single numeric value representing the mean from sample 2.

.sd2

If .x is a single numeric value representing the mean of the variable for sample 1, .sd2 should be a single numeric value representing the standard deviation of the variable for sample 2. See Details.

.n2

If .x is a single numeric value representing the mean of the variable for sample 1, .sd should be a single numeric value representing the total number of users in sample 2. 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.

.var1

If .x is a long-format data frame, the (unquoted) name of a data frame column containing the values representing the first sample.

.var2

If .x is a long-format data frame, the (unquoted) name of a data frame column containing the values representing the second sample.

Details

Note that NAs are automatically dropped in all calculations.

Value

A tibble with the results of a test of two means, with confidence interval information, and other information.

See Also

Other tests comparing means: test_means_within()

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
# When you already have summary stats:

test_means_between(.x = 45,.sd = 9.2,.n = 18,.x2 = 48, .sd2 = 8.5, .n2 = 17, .alpha = 0.01)


# If you have a data frame with a separate column of observations
# for each sample:

.ux_data<-
  data.frame("sample1_ratings" = runif(20,20,50),
             "sample2_ratings" = c(runif(15,20,50),rep(NA,times=5)))

test_means_between(.x = .ux_data, .var1 = sample1_ratings, .var2 = sample2_ratings, .alpha = 0.10)

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