nps_moe_test | R Documentation |
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).
nps_moe_test(p_0, n_0, d_0, p_1, n_1, d_1, z_val = 1.96)
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. |
A value in (-1, 0, +1); see notes above.
# Test with a 99% confidence interval ## Not run: nps_moe_test(123, 456, 789, 321, 654, 987, z_val = 2.58) ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.