mipfp (version 3.2.1)

confint.mipfp: Computing confidence intervals for the mipfp estimates

Description

This function computes the (asymptotic) Wald confidence intervals at a given significance level for the estimates of an mipfp object generated by Estimate.

Usage

# S3 method for mipfp
confint(object, parm, level = 0.95, prop = FALSE, ...)

Arguments

object

The mipfp object containing the estimates.

parm

A specification of which estimates are to be given confidence intervals, either a vector of numbers or a vector of names. If missing, all estimates are considered.

level

The confidence level required.

prop

A boolean indicating if the results should be using counts (FALSE) or proportion (TRUE). Default is FALSE.

Further arguments passed to or from other methods (for instance vcov.mipfp).

Value

A matrix containing the upper and lower bounds for the estimated counts/probabilities (depending on the value of the prop argument).

Details

The confidence interval of the estimates \(\hat{X}\), at significance level \(\alpha\) is given by $$\hat{X} \pm z \left( 1-\frac{\alpha}{2} \right) * \hat{\sigma}$$ where \(\hat{\sigma}\) is the standart deviations of \(\hat{X}\), \(z\) and \(\alpha = 1 - level\) is the inverse of the cumulative distribution function of the standard normal distribution.

References

Smithson, M. (2002). Confidence intervals. Sage Publications.

See Also

confint for the default method to compute confidence intervals for model parameters. Estimate, Ipfp and ObtainModelEstimates to generate the mipfp objects for this function.

Examples

Run this code
# NOT RUN {
# true contingency (2-way) table
true.table <- array(c(43, 44, 9, 4), dim = c(2, 2))
# generation of sample, i.e. the seed to be updated
seed <- ceiling(true.table / 10)
# desired targets (margins)
target.row <- apply(true.table, 2, sum)
target.col <- apply(true.table, 1, sum)
# storing the margins in a list
target.data <- list(target.col, target.row)
# list of dimensions of each marginal constrain
target.list <- list(1, 2)
# using ipfp
res <- Estimate(seed, target.list, target.data)
# computing and printing the confidence intervals
print(confint(res))
# }

Run the code above in your browser using DataCamp Workspace