randomize | R Documentation |
For a hypothesis test involving two proportions, create a vector of simulated statistics by using randomization.
randomize(failA, successA, totalA, failB, successB, totalB, numRepetitions)
failA |
The number of observed "failures" in "Group A". Must be a positive, whole number; if not, it will be rounded to the nearest whole number. |
successA |
The number of observed "successes" in "Group A". Must be a positive, whole number; if not, it will be rounded to the nearest whole number. |
totalA |
The sample size of "Group A". Must be a positive, whole number; if not, it will be rounded to the nearest whole number. |
failB |
The number of observed "failures" in "Group B". Must be a positive, whole number; if not, it will be rounded to the nearest whole number. |
successB |
The number of observed "successes" in "Group B". Must be a positive, whole number; if not, it will be rounded to the nearest whole number. |
totalB |
The sample size of "Group B". Must be a positive, whole number; if not, it will be rounded to the nearest whole number. |
numRepetitions |
The number of times to repeat the simulation process. Must be a positive, whole number; if not, it will be rounded to the nearest whole number. |
A vector of simulated statistics under the null hypothesis. The vector
will be the same length as numRepetitions
.
# Group A has 402 failures, 198 successes, 600 in total. Group B has 120 failures, 80 successes, 200 in total. Run a randomization 1000 times to see the simulated differences in sample proportions (simulated statistics). randomize(failA = 402, successA = 198, totalA = 600, failB = 120, successB = 80, totalB = 200, numRepetitions = 1000)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.