confint.mipfp: Computing confidence intervals for the mipfp estimates

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/s3_mipfp.R

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

1
2
## S3 method for class '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).

Details

The confidence interval of the estimates X.hat, at significance level α is given by

X.hat +/- z(1-α/2) * σ.hat

where σ.hat is the standart deviations of X.hat, z and α = 1 - level is the inverse of the cumulative distribution function of the standard normal distribution.

Value

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

Author(s)

Johan Barthelemy.

Maintainer: Johan Barthelemy johan@uow.edu.au.

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
# 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))

Example output

Loading required package: cmm
Loading required package: Rsolnp
Loading required package: numDeriv
        2.5%    97.5%
1.1 36.66842 53.81158
2.1 33.18842 50.33158
1.2 -1.81158 15.33158
2.2 -2.33158 14.81158

mipfp documentation built on May 2, 2019, 6:01 a.m.