knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  dpi = 300,
  fig.path = "man/figures/README-",
  out.width = "100%"
)

melt melt website

Project Status: Active - The project has reached a stable, usable state and is being actively developed. R-CMD-check pkgcheck Codecov test coverage CRAN status runiverse ropensci review

Overview

melt provides a unified framework for data analysis with empirical likelihood methods. A collection of functions is available to perform multiple empirical likelihood tests and construct confidence intervals for various models in 'R'. melt offers an easy-to-use interface and flexibility in specifying hypotheses and calibration methods, extending the framework to simultaneous inferences. The core computational routines are implemented with the 'Eigen' 'C++' library and 'RcppEigen' interface, with 'OpenMP' for parallel computation. Details of the testing procedures are provided in Kim, MacEachern, and Peruggia (2023). The package has a companion paper by Kim, MacEachern, and Peruggia (2024). This work was supported by the U.S. National Science Foundation under Grants No. SES-1921523 and DMS-2015552.

Installation

You can install the latest stable release of melt from CRAN.

install.packages("melt")

You can install the development version of melt from GitHub or R-universe.

# install.packages("pak")
pak::pak("ropensci/melt")
install.packages("melt", repos = "https://ropensci.r-universe.dev")

Main functions

melt provides an intuitive API for performing the most common data analysis tasks:

Usage

library(melt)
set.seed(971112)

## Test for the mean
data("precip")
(fit <- el_mean(precip, par = 30))


## Adjusted empirical likelihood calibration
elt(fit, rhs = 30, calibrate = "ael")


## Bootstrap calibration
elt(fit, rhs = 30, calibrate = "boot")


## F calibration
elt(fit, rhs = 30, calibrate = "f")


## Linear model
data("mtcars")
fit_lm <- el_lm(mpg ~ disp + hp + wt + qsec, data = mtcars)
summary(fit_lm)
cr <- confreg(fit_lm, parm = c("disp", "hp"), npoints = 200)
plot(cr)
data("clothianidin")
fit2_lm <- el_lm(clo ~ -1 + trt, data = clothianidin)
summary(fit2_lm)
confint(fit2_lm)


## Generalized linear model
data("thiamethoxam")
fit_glm <- el_glm(visit ~ log(mass) + fruit + foliage + var + trt,
  family = quasipoisson(link = "log"), data = thiamethoxam,
  control = el_control(maxit = 100, tol = 1e-08, nthreads = 4)
)
summary(fit_glm)


## Test of no treatment effect
contrast <- c(
  "trtNaked - trtFungicide", "trtFungicide - trtLow", "trtLow - trtHigh"
)
elt(fit2_lm, lhs = contrast)


## Multiple testing
contrast2 <- rbind(
  c(0, 0, 0, 0, 0, 1, 0, 0),
  c(0, 0, 0, 0, 0, 0, 1, 0),
  c(0, 0, 0, 0, 0, 0, 0, 1)
)
elmt(fit_glm, lhs = contrast2)

Please note that this package is released with a Contributor Code of Conduct. By contributing to this project, you agree to abide by its terms.



markean/bayesELcpp documentation built on May 20, 2024, 1:05 p.m.