CI_NDM: A function that computes the the (1-alpha) confidence...

Description Usage Arguments Details Value Examples

View source: R/ci_comp.R

Description

A function that computes the the (1-alpha) confidence interval of sample mean by the method of nonparametric delta method

Usage

1
CI_NDM(y, alpha)

Arguments

y

samples

alpha

significance level

Details

For nonparametric delta method of mean value, hat(tau)^2=frac(1,n)sum((Y[i]-barY)^2,i==1,n) group('[',list(bar(Y)-frac(z[1-frac(alpha,2)] ),']')

Value

a (1-alpha) confidence interval by the method of nonparametric delta method

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
## Not run: 
set.seed(7524)
n=c(500,5000,50000)
int=matrix(0,ncol=2,nrow=3)
rownames(int)=paste("n=",n);colnames(int)=c("left","right")
for (i in 1:3){
 x=rnorm(n[i])
 y=x^2 #turn var into mean
 int[i,]=CI_NDM(y,0.05)}
int

## End(Not run)

XixuHu/SC19090 documentation built on Jan. 2, 2020, 8:40 p.m.