eblupFH: EBLUPs based on a Fay-Herriot model.

Description Usage Arguments Details Value References See Also Examples

View source: R/eblupFH.R

Description

This function gives the EBLUP (or EB predictor under normality) based on a Fay-Herriot model. Fitting method can be chosen between ML, REML and FH methods.

Usage

1
2
eblupFH(formula, vardir, method = "REML", MAXITER = 100, PRECISION = 0.0001, 
        B = 0, data)

Arguments

formula

an object of class formula (or one that can be coerced to that class): a symbolic description of the model to be fitted. The variables included in formula must have a length equal to the number of domains D. Details of model specification are given under Details.

vardir

vector containing the D sampling variances of direct estimators for each domain. The values must be sorted as the variables in formula.

method

type of fitting method, to be chosen between "ML", "REML" or "FH" methods.

MAXITER

maximum number of iterations allowed in the Fisher-scoring algorithm. Default is 100 iterations.

PRECISION

convergence tolerance limit for the Fisher-scoring algorithm. Default value is 0.0001.

B

number of bootstrap replicates to calculate the goodness-of-fit measures proposed by Marhuenda et al. (2014). Default value is 0 indicating that these measures are not calculated.

data

optional data frame containing the variables named in formula and vardir. By default the variables are taken from the environment from which eblupFH is called.

Details

A typical model has the form response ~ terms where response is the (numeric) response vector and terms is a series of terms which specifies a linear predictor for response. A terms specification of the form first + second indicates all the terms in first together with all the terms in second with duplicates removed.

A formula has an implied intercept term. To remove this use either y ~ x - 1 or y ~ 0 + x. See formula for more details of allowed formulae.

Value

The function returns a list with the following objects:

eblup

vector with the values of the estimators for the domains.

fit

a list containing the following objects:

  • method: type of fitting method applied ("REML", "ML"or "FH").

  • convergence: a logical value equal to TRUE if Fisher-scoring algorithm converges in less than MAXITER iterations.

  • iterations: number of iterations performed by the Fisher-scoring algorithm.

  • estcoef: a data frame with the estimated model coefficients in the first column (beta), their asymptotic standard errors in the second column (std.error), the t statistics in the third column (tvalue) and the p-values of the significance of each coefficient in last column (pvalue).

  • refvar: estimated random effects variance.

  • goodness: vector containing several goodness-of-fit measures: loglikehood, AIC, BIC, KIC and the measures proposed by Marhuenda et al. (2014): AICc, AICb1, AICb2, KICc, KICb1, KICb2. B must be must be greater than 0 to obtain these last measures.

In case that formula or vardir contain NA values a message is printed and no action is done.

References

- Fay, R.E. and Herriot, R.A. (1979). Estimation of income from small places: An application of James-Stein procedures to census data. Journal of the American Statistical Association 74, 269-277.

- Marhuenda, Y., Morales, D. and Pardo, M.C. (2014). Information criteria for Fay-Herriot model selection. Computational Statistics and Data Analysis 70, 268-280.

- Rao, J.N.K. (2003). Small Area Estimation. Wiley, London.

See Also

mseFH

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
# Load data set  
data(milk)   
attach(milk)

# Fit FH model using REML method with indicators of 4 Major Areas as 
# explanatory variables.
resultREML <- eblupFH(yi ~ as.factor(MajorArea), SD^2)
resultREML

#Fit FH model using FH method
resultFH <- eblupFH(yi ~ as.factor(MajorArea), SD^2, method="FH")
resultFH

detach(milk)

Example output

Loading required package: nlme
Loading required package: MASS
$eblup
        [,1]
1  1.0219703
2  1.0476018
3  1.0679513
4  0.7608170
5  0.8461574
6  0.9743727
7  1.0584523
8  1.0977762
9  1.2215449
10 1.1951455
11 0.7852155
12 1.2139456
13 1.2096593
14 0.9834967
15 1.1864247
16 1.1556982
17 1.2263411
18 1.2856486
19 1.2363247
20 1.2349600
21 1.0903019
22 1.1923057
23 1.1216470
24 1.2230296
25 1.1938054
26 0.7627195
27 0.7649550
28 0.7338443
29 0.7699294
30 0.6134418
31 0.7695558
32 0.7958250
33 0.7723187
34 0.6102302
35 0.7001782
36 0.7592787
37 0.5298867
38 0.7434466
39 0.7548996
40 0.7701918
41 0.7481164
42 0.8040773
43 0.6810870

$fit
$fit$method
[1] "REML"

$fit$convergence
[1] TRUE

$fit$iterations
[1] 4

$fit$estcoef
                            beta  std.error    tvalue       pvalue
(Intercept)            0.9681890 0.06936208 13.958476 2.793443e-44
as.factor(MajorArea)2  0.1327801 0.10300072  1.289119 1.973569e-01
as.factor(MajorArea)3  0.2269462 0.09232981  2.457995 1.397151e-02
as.factor(MajorArea)4 -0.2413011 0.08161707 -2.956503 3.111496e-03

$fit$refvar
[1] 0.01855022

$fit$goodness
   loglike        AIC        BIC        KIC       AICc      AICb1      AICb2 
 12.677478 -15.354956  -6.548956 -10.354956         NA         NA         NA 
      KICc      KICb1      KICb2 nBootstrap 
        NA         NA         NA   0.000000 


$eblup
        [,1]
1  1.0179759
2  1.0449639
3  1.0644808
4  0.7706920
5  0.8525124
6  0.9738262
7  1.0508569
8  1.0961652
9  1.2105053
10 1.1856404
11 0.7975687
12 1.2021499
13 1.2004587
14 0.9889713
15 1.1867450
16 1.1579920
17 1.2242232
18 1.2786804
19 1.2335659
20 1.2318601
21 1.0959551
22 1.1922126
23 1.1259973
24 1.2206948
25 1.1936875
26 0.7602435
27 0.7623581
28 0.7322880
29 0.7674591
30 0.6173102
31 0.7649969
32 0.7893148
33 0.7693760
34 0.6128615
35 0.7009616
36 0.7568908
37 0.5371932
38 0.7418816
39 0.7532513
40 0.7675187
41 0.7470595
42 0.7993630
43 0.6831609

$fit
$fit$method
[1] "FH"

$fit$convergence
[1] TRUE

$fit$iterations
[1] 3

$fit$estcoef
                            beta  std.error    tvalue       pvalue
(Intercept)            0.9679012 0.06695896 14.455139 2.326581e-47
as.factor(MajorArea)2  0.1294502 0.09980334  1.297053 1.946131e-01
as.factor(MajorArea)3  0.2267910 0.08941191  2.536474 1.119750e-02
as.factor(MajorArea)4 -0.2421518 0.07877987 -3.073778 2.113670e-03

$fit$refvar
[1] 0.01642027

$fit$goodness
   loglike        AIC        BIC        KIC       AICc      AICb1      AICb2 
  12.76205  -15.52410   -6.71810  -10.52410         NA         NA         NA 
      KICc      KICb1      KICb2 nBootstrap 
        NA         NA         NA    0.00000 

sae documentation built on March 26, 2020, 7:52 p.m.