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

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

View source: R/s3_mipfp.R

Description

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

Usage

1
2
## S3 method for class 'mipfp'
coef(object, prop = FALSE, ...)

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.

Value

Coefficients of the estimates extracted from the mipfp object object.

Author(s)

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

coef.

Examples

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

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