![]() So we see that 10,000 letters doesn't really achieve 80% power (of any sort) to detect these response rates. Sum(significant&significant)/repetitions # power for interaction terms you can also generate such data less elegantly by using ?runif, e.g., ifelse(runif(1)0)/repetitions # any effect power.to get the number of successes out of 10 Bernoulli trials with probability p, the code would be rbinom(n=10, size=1, prob=p), (you will probably want to assign the result to a variable for storage) In R, the primary way to generate binary data with a given probability of 'success' is ?rbinom To get a better approximation, we can increase $B$, although this will also make the simulation take longer. The proportion found over $B$ iterations allows us to approximate the true $p$. ![]() Whether you will find significance on a particular iteration can be understood as the outcome of a Bernoulli trial with probability $p$ (where $p$ is the power). to determine a-priori power, search over possible $N$'s to find the value that yields your desired power.repeat many ($B$) times & use the % 'significant' as an estimate of (post-hoc) power at that $N$.store whether the results are 'significant' according to your chosen alpha.run the analysis you intend to conduct over those faux data.generate N data from that possible world. ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |