nps_moe_test: Calculate whether NPS score has significantly changed between...

View source: R/fct_helpers.R

nps_moe_testR Documentation

Calculate whether NPS score has significantly changed between 2 samples.

Description

A margin of error is calculated for each sample, from the number of promoters, neutrals (i.e. passives) and detractors. The standard error of their difference is estimated using the Pythagorean formula, and the absolute difference of the two samples is compared to this multiplied by the critical value (aka z*-value).

The return value is in (-1, 0, +1), according to whether a significant decrease is found, no significant change, or a significant increase, respectively. If the total for a sample is 0, then 0 is returned.

Formula is based on the one found in this [blog post] (https://www.genroe.com/blog/how-to-calculate-margin-of-error-and-other-stats- for-nps/5994).

Usage

nps_moe_test(p_0, n_0, d_0, p_1, n_1, d_1, z_val = 1.96)

Arguments

p_0

Number of Promoters in latest sample

n_0

Number of Neutrals in latest sample

d_0

Number of Detractors in latest sample

p_1

Number of Promoters in oldest sample

n_1

Number of Neutrals in oldest sample

d_1

Number of Detractors in oldest sample

z_val

Critical value multiplier; 1.96 by default for a 95 interval. See [this table] (http://www.ltcconline.net/greenl/courses/201/estimation/smallConfLevelTable.htm) for further values of z_val for common confidence intervals.

Value

A value in (-1, 0, +1); see notes above.

Examples

# Test with a 99% confidence interval
## Not run: 
nps_moe_test(123, 456, 789, 321, 654, 987, z_val = 2.58)

## End(Not run)

MarkMc1089/FIC documentation built on April 3, 2022, 6:05 p.m.