predict-methods: Methods for Function 'predict'

Description Usage Arguments Details Value Methods See Also Examples

Description

Calculate small area predictions and their variances

Usage

1
2
3
4
5
6
7
predict(object, ...)

## S4 method for signature 'sadObj'
predict(object)

## S4 method for signature 'saeObj'
predict(object)

Arguments

object

a model object for which prediction is desired.

...

Arguments to be passed to methods.

Details

Based on the structure of the saeObj given, predict decides, which predictor to use:
If a smallAreaMeans-data.frame covering all fixed effects is given, the exhaustive estimator \hat{\tilde{Y}}_{G, synth} is calculated.
If a smallAreaMeans-data.frame not covering all fixed effects is given, the partially exhaustive estimator \hat{\tilde{Y}}_{G, greg} is calculated.
If no smallAreaMeans-data.frame but s1 is given, the three-phase estimator \hat{\tilde{Y}}_{G, g3reg} is calculated.
If neither smallAreaMeans nor s1 are given, the non-exhaustive estimator \hat{\tilde{Y}}_{G, psynth} is calculated.
If a clustering variable is given, the cluster sampling design equivalents of the above estimators are used.

Value

a data frame containing predictions and variances for each small area, attr(..., 'references') gives information on the literature used, attr(...$prediction, 'reference') and attr(...$variance, 'reference') specify these.

Methods

signature(object = saeObj)

Calculate predictions and variances according to the auxilliary information given, see Details above.

signature(object = sadObj)

Calculate design-based predictions and variances.

See Also

demo('maSAE')

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
library('maSAE')
## ## design-based estimation
## load data
data('s2')
## create object
saeO  <- saObj(data = s2, f = y ~ NULL | g)
## design-based estimation for all small areas given by g
predict(saeO)

## ## model-assisted estimation
## load s1 data
data('s1'); str(s1)
## add sample indicators to s2
s2$s1 <- s2$s2 <- TRUE
## add sample indicators to s1
s1$s1 <- TRUE
s1$s2 <- FALSE
## prepare s1 data
eval(parse(text=(paste('s1$', setdiff(names(s2), names(s1)), ' <- NA' , sep = ''))))
## union s1 and s2 data
s12 <- rbind(s1, s2)
## create object
saeO <- saObj(data = s12, f = y ~x1 + x2 + x3 | g, s2 = 's2')
## small area estimation
p <- predict(saeO)
## print p and view its attributes set by predict()
p; 
str(p)
cat(sep = '\n', attr(p, 'references')[2])
attributes(p$prediction)
attributes(p$variance)

maSAE documentation built on May 29, 2017, 9:28 p.m.