ci_tnorm: Calculate confidence interval for truncated normal variable

Description Usage Arguments Examples

Description

Calculate confidence interval for truncated normal variable

Usage

1
2
ci_tnorm(meanEst, sd, limits, alpha, gridpts = 500, griddepth = 3,
  range = 100)

Arguments

meanEst

mean

sd

standard deviation

limits

Intervals object containing all limits

alpha

value specifying the interval coverage, which is (1-alpha)

gridpts, griddepth

parameters for grid search used in the confidence interval function of the package selectiveInference.

range

gives the range range*sd, in which the quantile values are searched

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
library(intervals)
# one restriction -- in this case equal to a call to \code{\link{msm::qtnorm}}
int1 <- Intervals(c(-3,1))
mean = -0.2
sd = 1
ci_tnorm(meanEst = mean, sd = sd, limits = int1, alpha = 0.05)

# two intervals -- 1-alpha coverage not possible
(int2 <- Intervals(matrix(c(-3,-2,-1,1), 
                          ncol = 2, byrow = TRUE)))
ci_tnorm(meanEst = mean, sd = sd, limits = int2, alpha = 0.05)

# two intervals -- 1-alpha coverage possible, but interval not symmetric
(int3 <- Intervals(matrix(c(-3,-2.5,-1.9,1), 
                          ncol = 2, byrow =  TRUE)))
ci_tnorm(meanEst = mean, sd = sd, limits = int3, alpha = 0.05)

davidruegamer/coinflibs documentation built on May 14, 2019, 10:33 a.m.