R/statpsych1.R
sim.ci.stdmean2.Rd
Performs a computer simulation of confidence interval performance for two types of standardized mean differences in a 2-group design (see ci.stdmean2). Sample data for each group can be generated from five different population distributions. All distributions are scaled to have standard deviations of 1.0 in group 1.
sim.ci.stdmean2(alpha, n1, n2, sd.ratio, dist1, dist2, d, rep)
alpha level for 1-alpha confidence
sample size for group 1
sample size for group 2
ratio of population standard deviations (sd2/sd1)
type of distribution for group 1 (1, 2, 3, 4, or 5)
type of distribution for group 2 (1, 2, 3, 4, or 5)
1 = Gaussian (skewness = 0 and excess kurtosis = 0)
2 = platykurtic (skewness = 0 and excess kurtosis = -1.2)
3 = leptokurtic (skewness = 0 and excess kurtosis = 6)
4 = moderate skew (skewness = 1 and excess kurtosis = 1.5)
5 = large skew (skewness = 2 and excess kurtosis = 6)
population standardized mean difference
number of Monte Carlo samples
Returns a 1-row matrix. The columns are:
Coverage - Probability of confidence interval including population std mean difference
Lower Error - Probability of lower limit greater than population std mean difference
Upper Error - Probability of upper limit less than population std mean difference
Ave CI Width - Average confidence interval width
sim.ci.stdmean2(.05, 20, 20, 1.5, 3, 4, .75, 5000)
#> Coverage Lower Error Upper Error Ave CI Width Ave Est
#> Unweighted Standardizer 0.9146 0.0612 0.0242 1.344542 0.7984367
#> Group 1 Standardizer 0.9452 0.0362 0.0186 1.817961 0.8031941
# Should return (within sampling error):
# Coverage Lower Error Upper Error Ave CI Width Ave Est
# Unweighted Standardizer 0.9058 0.0610 0.0332 1.342560 0.7838679
# Group 1 Standardizer 0.9450 0.0322 0.0228 1.827583 0.7862640