The function allows the analyst to prepare an idealized data set which exactly matches selected point values, and incorporates uncertainty in these values in terms of sample size.
makeData(mu1, sd1, mu2 = NULL, sd2 = NULL, nPerGrp,
pcntOut = 0, sdOutMult = 2, rnd.seed = NULL, showPlot = TRUE)
the mean for the first (or only) population.
the standard deviation for the main part of the first population, excluding outliers.
the mean for the second population; NULL if only one population is involved.
the standard deviation for the main part of the second population; NULL if only one population is involved.
sample size per group; large sample size reflects a high degree of precision in the values for the means and standard deviations.
the percentage of outliers in each population.
the standard deviation of the outliers as a multiple of the standard deviation of the main part of the population.
a seed for the random number generator, used to obtain reproducible samples if required.
if TRUE, displays the results as a plot (see Details).
A list with two components:
A vector of simulated values for the first (or only) group.
A vector of simulated values for the second group or NULL.
The arguments to this function provide a framework to specify the hypothesised values of the parameters of the populations under study, while the sample size is chosen to reflect the confidence in the values specified.
The function produces idealized samples, ie. samples which exactly match the specified means and standard deviations. If showPlot = TRUE, the results are displayed as a plot:
Histograms: actual sample values; red dashed line: distribution of the outliers; blue dashed line: distribution of the non-outliers; black line: combined distribution.
These idealised samples are passed to BESTmcmc
, which generates a series of sets of credible values for the parameters, including the normality parameter, taking account of correlations among them.
The sets of credible parameter values which constitute the BESTmcmc
output are used by BESTpower
to simulate new data sets which might arise during a subsequent experiment.
Kruschke, J. K. 2013. Bayesian estimation supersedes the t test. Journal of Experimental Psychology: General 142(2):573-603. doi: 10.1037/a0029146
BESTpower
for examples.
# NOT RUN {
## See examples for BESTpower.
# }
Run the code above in your browser using DataLab