Simulates null distribution and returns simulation-based p-value.
1 | SimulateProportion(n, x, p, alternative, reps)
|
n |
sample size. If comparing two proportions, enter each sample size as a vector. (e.g. c(10,15)) |
x |
number of "successes". If comparing two proportions, enter each sample size as a vector. (e.g. c(5,10)) |
p |
Hypothesized value for 1-proportion. Leave blank for two proportions(assumed to be 0). |
alternative |
Specify alternative hypothesis as either "less", "greater", or "two.sided" |
reps |
Number of simulations to perform |
Returns a histogram of the simulated null distribution. The red line indicates the observed statistic. The simulation-based p-value is also returned. Andrew Sage
##—- Should be DIRECTLY executable !! —- ##– ==> Define data, use random, ##– or do help(data=index) for the standard data sets.
## The function is currently defined as function (x) ~kwd1 ~kwd2
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.