Learn R Programming

mipfp (version 3.2.3)

coef.mipfp: Extract the coefficients of the estimates from an object of class mipfp

Description

This method extracts the coefficients of estimates of an mipfp object.

Usage

# S3 method for mipfp
coef(object, prop = FALSE, ...)

Value

Coefficients of the estimates extracted from the mipfp object object.

Arguments

object

An object of class mipfp

prop

If this Boolean is set to TRUE then the method will return the estimated probabilities. Otherwise, it will return the estimated counts. Default is False.

...

Not used.

Author

Johan Barthelemy.

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

References

Chambers, J. M. and Hastie, T. J. (1992) Statistical Models in S. Wadsworth & Brooks/Cole.

See Also

Examples

Run this code
# loading the data
data(spnamur, package = "mipfp")
# subsetting the data frame, keeping only the first 3 variables
spnamur.sub <- subset(spnamur, select = Household.type:Prof.status)
# true table
true.table <- table(spnamur.sub)
# extracting the margins
tgt.v1        <- apply(true.table, 1, sum)
tgt.v1.v2     <- apply(true.table, c(1,2), sum)
tgt.v2.v3     <- apply(true.table, c(2,3), sum)
tgt.list.dims <- list(1, c(1,2), c(2,3))
tgt.data      <- list(tgt.v1, tgt.v1.v2, tgt.v2.v3)
# creating the seed, a 10 pct sample of spnamur
seed.df <- spnamur.sub[sample(nrow(spnamur), round(0.10*nrow(spnamur))), ]
seed.table <- table(seed.df)
# estimating a table using ipfp
r.ipfp <- Estimate(seed=seed.table, target.list=tgt.list.dims, 
                   target.data = tgt.data)
# exctracting and printing the coefficient of the estimates
print(coef(r.ipfp))

Run the code above in your browser using DataLab