Learn R Programming

BEST (version 0.5.3)

makeData: Population parameter specification for a power analysis

Description

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.

Usage

makeData(mu1, sd1, mu2 = NULL, sd2 = NULL, nPerGrp,
	pcntOut = 0, sdOutMult = 2, rnd.seed = NULL, showPlot = TRUE)

Arguments

mu1

the mean for the first (or only) population.

sd1

the standard deviation for the main part of the first population, excluding outliers.

mu2

the mean for the second population; NULL if only one population is involved.

sd2

the standard deviation for the main part of the second population; NULL if only one population is involved.

nPerGrp

sample size per group; large sample size reflects a high degree of precision in the values for the means and standard deviations.

pcntOut

the percentage of outliers in each population.

sdOutMult

the standard deviation of the outliers as a multiple of the standard deviation of the main part of the population.

rnd.seed

a seed for the random number generator, used to obtain reproducible samples if required.

showPlot

if TRUE, displays the results as a plot (see Details).

Value

A list with two components:

y1

A vector of simulated values for the first (or only) group.

y2

A vector of simulated values for the second group or NULL.

Details

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.

References

Kruschke, J. K. 2013. Bayesian estimation supersedes the t test. Journal of Experimental Psychology: General 142(2):573-603. doi: 10.1037/a0029146

See Also

BESTpower for examples.

Examples

Run this code
# NOT RUN {
## See examples for BESTpower.
# }

Run the code above in your browser using DataLab