CPS_AK_est: Gives the variance of the AK estimators from the A,K...

Description Usage Arguments Value Examples

View source: R/AK3.R

Description

Gives the variance of the AK estimators from the A,K coefficients and the variance covariance matrix of the month in sample estimates

Usage

1
2
3
4
5
6
7
8
9
CPS_AK_est(
  Y,
  month = "m",
  mis = "hrmis",
  y = "employmentstatus",
  W = W.multi.ak(months = dimnames(Y)[[month]], groups = dimnames(Y)[[mis]], S = c(2:4,
    6:8), S_1 = c(1:3, 5:7), ak = list(u = c(a = CPS_A_u(), k = CPS_K_u()), e = c(a =
    CPS_A_e(), k = CPS_K_e()), n = c(a = 0, k = 0)))
)

Arguments

Y

A named array of dimension nmonth x 3 x 8. mistotals[m,e,g] is the month in sample direct estimate for month m, month in sample rotation group g, and variable e. dimnames(y)[[month]] must necessarily be equal to dimnames(W)["ak"] ("u","e","n" by default)

W

(optional) if already computed, the array W of coefficients W[ak,y2,m2,y1,mis1,m1] such that AK estimate for coefficients ak, month m2 and employment status y2 is sum(W[ak,y2,m2,,,])*Y[,,]) where mistotals[y1,mis1,m1] is direct estimate on mis mis1 for emp stat y1 at month m1.

ak:

an ak coefficients vector or a list of ak coefficients.

Value

The variance of the AK estimators from the A,K coefficients and the variance covariance matrix .

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
library(dataCPS)
period=200501:200512
list.tables<-lapply(data(list=paste0("cps",period),package="dataCPS"),get);
names(list.tables)<-period
Y<-WSrg(list.tables,weight="pwsswgt",list.y="pemlr",rg="hrmis")
dimnames(Y);
Y<-plyr::aaply(Y,1:2,function(x){c(n=sum(x[c(1,6:8)]),u=sum(x[4:5]),e=sum(x[2:3]))})
names(dimnames(Y))[3]<-"y";
dimnames(Y)
month="m";
mis="hrmis";
y="y";
CPS_AK_est(Y,y=y,mis=mis) 

DanielBonnery/CompositeRegressionEstimation documentation built on June 17, 2020, 12:16 p.m.