Learn R Programming

OVL.CI (version 0.1.1)

OVL.GPQ.mix: GPQ-Mix

Description

Computes a confidence interval for the OVL between two populations under Gaussian and two-component Gaussian mixture models, or both populations modeled as two-component Gaussian mixtures, using generalized inference.

Usage

OVL.GPQ.mix(x, y, alpha = 0.05, interv = c(0, 20), k = 1000, all_mix = FALSE)

Value

confidence interval.

Arguments

x

Numeric vector. Data from the first group. When all_mix = FALSE, this group is modeled as Gaussian.

y

Numeric vector. Data from the second group, modeled as a two-component Gaussian mixture.

alpha

confidence level.

interv

Numeric vector of length 2. Search interval for intersection points between the corresponding densities.

k

Number of simulated generalized pivotal quantities.

all_mix

Logical. If TRUE, both groups are modeled as two-component Gaussian mixtures. If FALSE, only y is modeled as a mixture and x is Gaussian.

Examples

Run this code
set.seed(1)
x <- ifelse(runif(100) < 0.5,
            rnorm(100, mean = 0, sd = 1),
            rnorm(100, mean = 2, sd = 1))
y <- ifelse(runif(100) < 0.5,
            rnorm(100, mean = 2.5, sd = 1),
            rnorm(100, mean = 2, sd = 1))
res <- OVL.GPQ.mix(x, y, all_mix = TRUE, interv = c(-10, 10))
res$IC1
res$IC2

Run the code above in your browser using DataLab