innerval: Interval boundaries

Description Usage Arguments Value Author(s) See Also Examples

View source: R/rmbmat2.R

Description

This function computes the boundaries of an interval which is symmetric around the median and includes a given percentage of the data. If that's impossible due to ties the interval is chosen to minimize the squared difference between the desired percentage and the actual percentage of the observations included.

Usage

1
innerval(x, p = 0.95, data.points = TRUE)

Arguments

x

A data vector.

p

The percentage of observations inside the interval.

data.points

Whether to return the most extreme data points within the interval or the interval boundaries.

Value

A vector with the lower and upper boundaries of the interval.

Author(s)

Alexander Pilhoefer

See Also

quantile

Examples

1
2
3
4
5
6
7
8
9
x1 <- rnorm(200)
innerval(x1)
quantile(x1, c(0.025, 0.975))


x2 <- rexp(200)
innerval(x2, data.points = FALSE)
innerval(x2)
quantile(x2, c(0.025, 0.975))

extracat documentation built on July 17, 2018, 5:05 p.m.

Related to innerval in extracat...