Learn R Programming

⚠️There's a newer version (1.0.2) of this package.Take me there.

confintr

The confintr package offers classic and/or bootstrap confidence intervals for the following parameters:

  • mean,

  • quantiles incl. median,

  • proportion,

  • variance and standard deviation,

  • IQR and MAD,

  • skewness and kurtosis,

  • R-squared and the non-centrality parameter of the F distribution,

  • Cramér's V and the non-centrality parameter of the chi-squared distribution,

  • the odds ratio of a 2x2 table,

  • Pearson-, Spearman-, Kendall correlation coefficients,

  • mean, quantile and median differences.

Both one- and two-sided intervals are supported.

Different types of bootstrap intervals are possible through argument boot_type, see vignette.

Installation

From CRAN:

install.packages("confintr")

Latest version from github:

# library(devtools)
install_github("mayer79/confintr")

Teaser

library(confintr)

# Mean
ci_mean(1:100)
ci_mean(1:100, type = "bootstrap")

# 95% value at risk
ci_quantile(rexp(1000), q = 0.95)

# IQR
ci_IQR(rexp(100), R = 999)

# Correlation
ci_cor(iris[1:2], method = "spearman", type = "bootstrap")

# Proportions
ci_proportion(10, n = 100, type = "Wilson")
ci_proportion(10, n = 100, type = "Clopper-Pearson")

# R-squared
fit <- lm(Sepal.Length ~ ., data = iris)
ci_rsquared(fit, probs = c(0.05, 1))

# Kurtosis
ci_kurtosis(1:100)

# Mean difference
ci_mean_diff(10:30, 1:15)
ci_mean_diff(10:30, 1:15, type = "bootstrap", R  = 999)

# Median difference
ci_median_diff(10:30, 1:15, R  = 999)

Copy Link

Version

Install

install.packages('confintr')

Monthly Downloads

10,553

Version

0.1.1

License

GPL (>= 2)

Issues

Pull Requests

Stars

Forks

Maintainer

Michael Mayer

Last Published

June 29th, 2020

Functions in confintr (0.1.1)

ci_median

Confidence Interval for the Population Median
cramersv

Cramer's V
ci_rsquared

Confidence Interval for the Population R-Squared
ci_sd

Confidence Interval for the Population Standard Deviation
ci_mean_diff

Confidence Interval for the Population Mean Difference
is.cint

Type Check
moments

Moments
oddsratio

Odds Ratio
ci_var

Confidence Interval for the Population Variance
ci_median_diff

Confidence Interval for the Population Median Difference of two Samples
ci_skewness

Confidence Interval for the Skewness
ci_oddsratio

Confidence Interval for the Odds Ratio
print.cint

Print a cint Object
ci_quantile

Confidence Interval for a Population Quantile
ci_quantile_diff

Confidence Interval for the Population Quantile Difference of two Samples
se

Standard errors
ci_proportion

Confidence Interval for a Population Proportion
ci_chisq_ncp

Confidence Interval for the Non-Centrality Parameter of the Chi-Squared Distribution
ci_mean

Confidence Interval for the Population Mean
ci_mad

Confidence Interval for the Median Absolute Deviation
ci_f_ncp

Confidence Interval for the Non-Centrality Parameter of the F Distribution
ci_IQR

Confidence Interval for the Interquartile Range
ci_kurtosis

Confidence Interval for the Kurtosis
ci_boot

Bootstrap Confidence Interval
ci_cramersv

Confidence Interval for the Population Cramer's V
ci_cor

Confidence Interval for Correlation Coefficients