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

View source: R/LCMBounds.R

LCMBoundsR 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

LCMBounds(
  Lhat,
  weights,
  samplesizes,
  alpha.upper = 0.025,
  alpha.lower = alpha.upper,
  rand.samps = 20,
  opt.samps = 20,
  mass = 1,
  power.of.2 = TRUE
)

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.

rand.samps

A scalar which directs the alogrithm on how many random samples to try before beginning the optimizing stage.

opt.samps

A scalar which directs the alogrithm on how many optimizing steps to make.

mass

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

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)
LCMBounds(Lhat,weightsA,samplesizes)


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