Learn R Programming

SimDesign (version 0.3)

ECR: Compute the empirical coverage rate for Type I errors and Power

Description

Computes the detection rate for determining empirical Type I error and power rates using information from the confidence intervals. Note that using 1 - ECR(CIs, population) will provide the empirical detection rate.

Usage

ECR(CIs, population)

Arguments

CIs
a matrix of confidence interval values for a given population value, where the first column indicates the lower confidence interval and the second column the upper confidence interval
population
a numeric scalar indicating the fixed population value

Examples

Run this code
CIs <- matrix(NA, 100, 2)
for(i in 1:100){
   dat <- rnorm(100)
   CIs[i,] <- t.test(dat)$conf.int
}

ECR(CIs, 0)

Run the code above in your browser using DataLab