Empirical likelihood is a nonparametric method of inference based on a data driven likelihood ratio function. Like the bootstrap and jackknife, empirical likelihood inference does not require us to specify a family of distributions for the data. Like parametric likelihood methods, empirical likelihood makes an automatic determination of the shape of confidence regions […] and has very favorable asymptotic power properties. It can be thought of as a bootstrap that does not resample and as a likelihood without parametric assumptions.
— Owen (2001)
Dropping the distributional assumption usually costs something. The sections below show how little is given up: each parametric test is paired with its empirical counterpart on the same data, under conditions ideal for the parametric test and with a reasonably large sample. The p values and confidence intervals come out close.
Starting with a normal sample, the parametric test is the natural choice.
library(LRTesteR)
library(statmod)
set.seed(1)
x <- rnorm(50)
gaussian_mu_test(x = x, mu = 0, alternative = "two.sided")
#> Log Likelihood Statistic: 0.74
#> p value: 0.39
#> Confidence Level: 95%
#> Confidence Interval: (-0.132, 0.333)The empirical test, which knows nothing about the normal distribution, lands in nearly the same place.
The agreement is not special to the normal distribution. Here the data are inverse gaussian.
set.seed(1)
x <- rinvgauss(50)
inverse_gaussian_mu_test(x = x, mu = 1, alternative = "two.sided")
#> Log Likelihood Statistic: 1.25
#> p value: 0.263
#> Confidence Level: 95%
#> Confidence Interval: (0.913, 1.513)The same empirical test is used again. Only the data changed.
Mu is a nuisance parameter here, and the empirical test profiles it out.
Moving to two groups, the pattern holds for the ANOVA style tests. Unlike the parametric one way test, the empirical version does not require nuisance parameters or sample sizes to be equal across groups.
set.seed(1)
x <- rnorm(100)
fctr <- c(rep(1, 50), rep(2, 50))
fctr <- factor(fctr, levels = c("1", "2"))
gaussian_mu_one_way_test(x = x, fctr = fctr, conf.level = .95)
#> Log Likelihood Statistic: 0.01
#> p value: 0.925
#> Confidence Level Of Set: 95%
#> Individual Confidence Level: 97.5%
#> Confidence Interval For Group 1: (-0.167, 0.368)
#> Confidence Interval For Group 2: (-0.194, 0.429)Again, swapping the distribution changes the parametric test but not the empirical one.
set.seed(1)
x <- rinvgauss(100)
fctr <- c(rep(1, 50), rep(2, 50))
fctr <- factor(fctr, levels = c("1", "2"))
inverse_gaussian_mu_one_way_test(x = x, fctr = fctr, conf.level = .95)
#> Log Likelihood Statistic: 3.65
#> p value: 0.056
#> Confidence Level Of Set: 95%
#> Individual Confidence Level: 97.5%
#> Confidence Interval For Group 1: (0.872, 1.559)
#> Confidence Interval For Group 2: (0.63, 1.105)Testing equality of variances across groups closes out the comparison.
set.seed(1)
x <- rnorm(100)
fctr <- c(rep(1, 50), rep(2, 50))
fctr <- factor(fctr, levels = c("1", "2"))
gaussian_variance_one_way_test(x = x, fctr = fctr, conf.level = .95)
#> Log Likelihood Statistic: 1.17
#> p value: 0.28
#> Confidence Level Of Set: 95%
#> Individual Confidence Level: 97.5%
#> Confidence Interval For Group 1: (0.446, 1.1)
#> Confidence Interval For Group 2: (0.606, 1.493)empirical_variance_one_way_test(x = x, fctr = fctr, conf.level = .95)
#> Log Likelihood Statistic: 1.14
#> p value: 0.285
#> Confidence Level Of Set: 95%
#> Individual Confidence Level: 97.5%
#> Confidence Interval For Group 1: (0.421, 1.095)
#> Confidence Interval For Group 2: (0.606, 1.365)Across all of these, the empirical tests track the parametric ones closely. What they buy is robustness: when the distributional assumption is wrong, or when no parametric test exists for the parameter of interest, the empirical version still applies.