GetConfInt: Computing confidence intervals for the estimated counts and...

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

View source: R/deprecated.R

Description

This function computes the (asymptotic) Wald confidence intervals at a given significance level for the results generated by Ipfp and ObtainModelEstimates (provided that their option compute.cov was set to TRUE).

Usage

1
GetConfInt(list.est, alpha = 0.05)

Arguments

list.est

A list produced either by Ipfp or ObtainModelEstimates containing the estimated counts and probabilities as well as their associated standard deviations.

alpha

Significance level of the confidence interval corresponding to the 100(1 - α)% confidence level.

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 and z is the inverse of the cumulative distribution function of the standard normal distribution.

Value

A list of matrices containing the upper and lower bounds for the estimated counts and probabilities.

lower.x

Lower bounds of the confidence interval for list.est$x.hat.

upper.x

Upper bounds of the confidence interval for list.est$x.hat.

lower.p

lower bounds of the confidence interval for list.est$p.hat.

upper.p

upper bounds of the confidence interval for list.est$p.hat.

Warning

Note: this function is deprecated, instead use confint.mipfp.

Author(s)

Johan Barthelemy

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

References

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

See Also

Estimate, Ipfp and ObtainModelEstimates to generate the inputs for this function.

The S3 method confint.mipfp for object of class mipfp.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
# 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)
# calling the Ipfp function
res <- Ipfp(seed, target.list, target.data)
# addint the standart deviations to res (required by GetConfInt)
cov.res <- vcov(res, seed = seed, target.list = target.list, 
                target.data = target.data)
res$p.hat.se <- cov.res$p.hat.se
res$x.hat.se <- cov.res$x.hat.se
# computing and printing the confidence intervals
print(GetConfInt(res))

Example output

Loading required package: cmm
Loading required package: Rsolnp
Loading required package: numDeriv
$lower.x
         [,1]     [,2]
[1,] 36.66842 -1.81158
[2,] 33.18842 -2.33158

$upper.x
         [,1]     [,2]
[1,] 53.81158 15.33158
[2,] 50.33158 14.81158

$lower.p
          [,1]       [,2]
[1,] 0.3666842 -0.0181158
[2,] 0.3318842 -0.0233158

$upper.p
          [,1]      [,2]
[1,] 0.5381158 0.1533158
[2,] 0.5033158 0.1481158

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