View source: R/c_power_table.r
c_power_table | R Documentation |
Estimate power for conflict effect using monte-carlo simulation, return table and plot
c_power_table( subjects, differences, c_nmst, nc_nmst, num_sims = 100, alpha = 0.05 )
subjects |
A vector for the numbers of subjects across simulated experiments |
differences |
A vector for the mean differences between conflict and no-conflict trials across simulations |
c_nmst |
A vector containing the parameters for an ex-gaussian distribution, c(n, mu, sigma, tau), where n is the number of trials. |
nc_nmst |
A vector containing the parameters for an ex-gaussian distribution, c(n, mu, sigma, tau), where n is the number of trials. |
num_sims |
A number, simulations to run |
alpha |
A number, alpha criterion |
This function is an extension to c_power_fast, that allows multiple estimates of power for a vector specifying numbers of subjects and mean differenes.
This function uses monte-carlo simulation to determine statistical power associated for detecting a conflict effect, and includes paramaters for number of subjects in the experiment, number of trials in each condition (conflict vs. no-conflict), and paramaters (mu,sigma,tau) for each reaction time distribution.
For every simulated experiment, a one sample t-test (two-tailed) is computed, and the p-value is saved. Power is the proportion of simulated experiments that return p-values less than the defined alpha criterion.
A list, $power_table contains a table with power estimates as a function of number of subjects and mean differences, $power_curve contains a graph (using ggplot2) showing power as a function of subjects and mean differences
test <- c_power_table(subjects = c(10,20,30), differences = c(10,20,30), c_nmst = c(50,732.4,80.7,157.5), nc_nmst = c(50,625.4,68.6,166.3), num_sims = 100, alpha = .05) test$power_table test$power_curve
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.