LCMBounds2: Finds an exact confindence interval for a linear combination...

View source: R/LCMBounds2.R

LCMBounds2R Documentation

Finds an exact confindence interval for a linear combination of multinomial probabilities

Description

Finds an exact confindence interval for a linear combination of multinomial probabilities

Usage

LCMBounds2(
  Lhat,
  weights,
  samplesizes,
  alpha.upper = 0.025,
  alpha.lower = alpha.upper,
  num.iters = 10,
  power.of.2 = TRUE,
  parallel = FALSE,
  seed = NULL
)

Arguments

Lhat

Observed value of a linear combination of multinomial probabilities that needs a confidence interval (a scalar).

weights

A list of numeric vectors that correspond to the multinomial probabilities.

samplesizes

A numeric vector of length K, each entry in the vector cooresponds to the sample sizes for the K multinomial experiements.

alpha.upper

The amount of probability outside the upper limit of the confidence interval (this produces a (1-alpha.upper-alpha.lower)% CI).

alpha.lower

The amount of probability outside the lower limit of the confidence interval.

num.iters

A scalar which directs the alogrithm on how many random starting locations the optimizer should attempt. Higher is better, but more costly computationally.

power.of.2

A logical tuning parameter. It is not recommended to change it from the default.

Examples

Lhat <- 7.8
weightsA <- list(c(0,1,1),c(2,0,3),c(5,3,0))
samplesizes <- c(20,20,20)
LCMBounds2(Lhat,weightsA,samplesizes)


WarrRich/LCMBounds documentation built on June 29, 2023, 1:29 p.m.