fun.comparepower | R Documentation |
Compare power of various one- and two-sample tests via simulation.
fun.comparepower( samp1sz = 10, samp2sz = NA, dist = "rnorm", ndim = 1, distb = NULL, level = 0.05, hypoth = 0, nsamp = 1000, alternative = "two.sided", altvalue = NULL, flip = F )
samp1sz |
the size of the first sample. |
samp2sz |
the size of the second sample. Defaults to NA, triggering one-sample tests. |
dist |
vector of names of random number generators, determinating distributions to be compared. Defaults to just normal. |
ndim |
Dimension of distributions to be compared. Defaults to one. |
distb |
vector of names of random number generators for second sample. Defaults to distribution for the first sample. |
level |
level of tests. |
hypoth |
vector null hypothesis values. For uniform on [0,1] this should be taken as .5. |
nsamp |
Number of Monte Carlo samples. |
alternative |
alternative, of the form aceptable by t.test, z.test, binom.test, and wilcox.test. Defaults to "two.sided". Can be a vector. |
altvalue |
vector of alternative hypothesis values. Defaults to null value for calculation of actual test level. |
flip |
logical indicator to allow asymetric distributions to be flipped. |
Tests are given by fun.onesampletests or fun.twosampletests, as appropriate.
A five-dimensional array of test levels (if altevalue equals hypoth) or power otherwise. Dimensions are test, distribution, alternative, alternative value, and first dimension sample size.
fun.comparepower(10,15,nsamp=100)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.