CompoundAuxVarest {GB2}R Documentation

Variance Estimation under the Compound GB2 Distribution Using Auxiliary Information

Description

Calculation of variance estimates of the parameters of the compound GB2 distribution and of the estimated compound GB2 indicators under a complex survey design (see package survey).

Usage

scoreU.cavgb2(fac, z, lambda) 
scorez.cavgb2(U,z)
varscore.cavgb2(SC, w=rep(1,dim(SC)[1]))
desvar.cavgb2(data=data, SC=SC, ids=NULL, probs=NULL, strata = NULL, variables = NULL,
fpc=NULL, nest = FALSE, check.strata = !nest, weights=NULL, pps=FALSE, 
variance=c("HT","YG"))
hess.cavgb2(U, P, z, w=rep(1, dim(z)[1]))
vepar.cavgb2(ml, Vsc, hess)
veind.cavgb2(group, vepar, shape1, scale, shape2, shape3, pl0, P, decomp="r")

Arguments

fac

numeric; a matrix of Gamma factors.

z

numeric; a matrix of auxiliary variables.

lambda

numeric; a matrix of parameters.

U

numeric; a matrix of scores U_{k,\ell} (output of the scoreU.cavgb2 function).

SC

numeric; scores, output of scorez.cavgb2.

w

numeric; vector of extrapolation weights. By default w is a vector of 1.

data

dataset containing the design information per unit

ids, probs, strata, variables, fpc, nest, check.strata, weights, pps, variance

parameters of svydesign.

P

numeric; matrix of mixture probabilities (output of pkl.cavgb2).

ml

numeric; estimated values of the vector of v's. Output of the ml.cavgb2 function (the second element in the list).

Vsc

numeric; 4 by 4 matrix. Variance of the scores SC, computed in varscore.cavgb2 or with the design information in desvar.cavgb2.

hess

numeric; Hessian (bread) for the sandwich variance estimate (output of hess.cavgb2).

group

numeric; a factor variable of the same length as the sample size giving the group membership in the special case when the auxiliary information defines group membership.

vepar

numeric; output of vepar.cavgb2.

shape1, scale, shape2, shape3

numeric; positive parameters of the GB2 distribution.

pl0

numeric; a vector of initial proportions defining the number of components and the weight of each component density in the decomposition. Sums to one.

decomp

string; specifying if the decomposition of the GB2 is done with respect to the right tail ("r") or the left tail ("l") of the distribution.

Details

The N \times L matrix of fitted mixture probabilities P=(p_{k,\ell}) depends on the N \times I matrix z of auxiliary variables. P has as many distinct rows as there are distinct rows in z. The N \times L matrix of gamma factors fac=F, output of fg.cgb2 depends on the vector of initial probabilities p_{0,\ell} only. The N \times (L-1) matrix of scores U is defined as

U(k,\ell)=p_{k,\ell} \left( \frac{F(k,\ell)}{\sum_{j=1}^L p_{k,j}\, F(k,j)} - 1\right).

The linearized scores are the columns of a N \times I(L-1) matrix

SC(k,\,I(\ell-1)+i)= U(k,\ell) \, z(k,i).

Function varscore.cavgb2 calculates the middle term of the sandwich variance estimator, that is the (I(L-1) \times I(L-1)) estimated variance-covariance matrix of the I(L-1) weighted sums of the columns of SC, without design information. desvar.cavgb2 calculates the design-based variance-covariance matrix of the I(L-1) weighted sums of the columns of SC, invoking svydesign and svytotal of package survey. hess.cavgb2 calculates the Hessian (I(L-1) \times I(L-1) matrix of second derivatives of the pseudo-log-likelihood with respect to the parameters). It should be negative definite. If not, the maximum likelihood estimates are spurious. vepar.cavgb2 calculates the sandwich variance estimate of the vectorized matrix of parameters lambda. veind.cavgb2 calculates estimates, std error, covariance and correlation matrices of the indicators under the compound GB2 with auxiliary variables in the particular case where the unique combinations of the auxiliary variables define a small number of groups. Group membership is specified by the vector group of length N.

Value

scoreU.cavgb2 returns a N \times (L-1) matrix of scores U. scorez.cavgb2 returns a N \times I(L-1) matrix whose columns are the linearized scores SC. varscore.cavgb2 returns the variance-covariance estimate of the weighted sums of scores SC, given by weighted cross products. desvar.cavgb2 returns a list of two elements. The first is the output of svytotal and the second is the design-based variance-covariance matrix of the weighted sums of the scores SC. hess.cavgb2 returns the matrix of second derivatives of the likelihood with respect to the parameters (bread for the sandwich variance estimate). vepar.cavgb2 returns a list of five elements - [["type"]] with value "parameter", [["estimate"]] estimated parameters, [["stderr"]] corresponding standard errors, [["Vcov"]] variance -covariance matrix and [["Vcor"]] - correlation matrix. veind.cavgb2 returns a list of five elements: [["type"]] with value "indicator", followed by a list with as many arguments as length(levels(group)). Each argument is itself a list with 5 arguments: [["group"]] group name, [["estimate"]] estimated indicators under the compound GB2, [["stderr"]] corresponding standard errors, [["Vcov"]] variance -covariance matrix and [["Vcor"]] - correlation matrix.

Author(s)

Monique Graf and Desislava Nedyalkova

References

Davison, A. (2003), Statistical Models. Cambridge University Press.

Freedman, D. A. (2006), On The So-Called "Huber Sandwich Estimator" and "Robust Standard Errors". The American Statistician, 60, 299–302.

Graf, M., Nedyalkova, D., Muennich, R., Seger, J. and Zins, S. (2011) AMELI Deliverable 2.1: Parametric Estimation of Income Distributions and Indicators of Poverty and Social Exclusion. Technical report, AMELI-Project.

Pfeffermann, D. and Sverchkov, M. Yu. (2003), Fitting Generalized Linear Models under Informative Sampling. In, Skinner, C.J. and Chambers, R.L. (eds.). Analysis of Survey Data, chapter 12, 175–195. Wiley, New York.

Examples

## Not run: 
# Example (following of example in CompoundAuxFit)

# Scores U 
U <- scoreU.cavgb2(facgl, z, lambdafitl)

# Scores multiplied by z
SC <- scorez.cavgb2(U,z)

# Naive variance estimate of sum of scores
(Vsc <- varscore.cavgb2(SC,w=pwa))

# Design based variance of sum of scores
(desv <- desvar.cavgb2(data=ns,SC=SC,id=~hid,strata=~region,weights=~pwa))

# Hessian
hess <- hess.cavgb2(U,pglfitl,z,w=pwa) 

# 1. Sandwich variance-covariance matrix estimate of parameters using Vsc:
Param1 <- vepar.cavgb2(fitcml,Vsc, hess)
Param1

# 2. Sandwich variance-covariance matrix estimate of parameters using 
# the design variance:
Param2 <- vepar.cavgb2(fitcml,desv$Vtheta, hess)
Param2 

# 3. Indicators and conditional variances : takes a long time!
(Indic <- veind.cavgb2(group,Param2 ,agl.fit,bgl.fit,pgl.fit,qgl.fit, 
                       pl0, pglfitl, decomp="l") )

## End(Not run)

[Package GB2 version 2.1.1 Index]