Computing confidence intervals for population variance from a sample in R Is there a package available for R (on CRAN, github, r-forge, etc.) that computes CIs for the population variance, given a sample of data, 95% CI parameter, etc.?
The Rmisc package computes the CIs around the mean, but I'd also like the CIs around the variance.
I found a few papers and an online source that contains the R code necessary to do this, and I've already used that code to roll my own implementation. However, given how large and rich the R package ecosystem is, I'm heavily biased towards not rolling my own solution, particularly when it comes to computing statistics measures.
 A: The variance is a statistic indeed, but why rely on a package to answer that for you rather than your knowledge of statistics? For instance, you might be interested in parametric variance estimation in which you might assume (or test assumptions) of certain distributions in the data you estimate (parametric approach). You can also go for non-parametric variance estimation using the variance of the empirical distribution function (e.g. the sample variance) and just bootstrap the distribution of the statistic. There's no need for a package there, just use the sampling distribution of the sample variance.
Example of bootstrap variance confidence interval:
x <- rnorm(100)

## sample variance
var(x) 

## CI
quantile(replicate(10000, var(sample(x, replace=TRUE))), probs=c(0.025, 0.975)) 

A: You can do this with the lavaan package. Here's an example:
library(lavaan)
df <- as.data.frame(rnorm(100))
names(df) <- "x"
model <- 'x ~~ x'
fit <- sem(model, data=df, likelihood = "wishart" )
parameterEstimates(fit)

Which gives:
> parameterEstimates(fit)
   lhs op rhs   est    se     z pvalue ci.lower ci.upper
 1   x ~~   x 0.833 0.118 7.071      0    0.602    1.064

Lavaan is on CRAN.
You need 
likelihood = "wishart" 

To ensure that Lavaan calculates the variance by dividing by n-1, not n.
