Description Usage Arguments Author(s) References Examples
Computes the approximate type estimator for standard errors as descibed in Section 8.6.4 of Kloke and McKean (2014). This is the default method.
1 | varcov2(eitbg, center, scores, v12inv, Dmat, p, delta, hparm)
|
eitbg |
|
center |
|
scores |
|
v12inv |
|
Dmat |
|
p |
|
delta |
|
hparm |
Joseph W. McKean
Kloke and McKean (2014), Nonparametrics Using R, Boca Raton: Chapman-Hall.
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 32 | ##---- Should be DIRECTLY executable !! ----
##-- ==> Define data, use random,
##-- or do help(data=index) for the standard data sets.
## The function is currently defined as
function (eitbg, center, scores, v12inv, Dmat, p, delta, hparm)
{
numc <- max(center)
n <- length(eitbg)
u <- (1:n)/(n + 1)
sc <- getScores(scores, u)
rs <- sc[rank(eitbg, ties.method = "first")]
brrp <- matrix(rep(0, n * n), ncol = n)
tauhat <- gettauF0(eitbg, p, scores, delta, hparm)
veeinv <- v12inv %*% v12inv
part1 <- t(Dmat) %*% veeinv %*% Dmat
i1 <- 1
i2 <- 1
for (i in 1:numc) {
rsc <- rs[center == i]
ni <- length(rsc)
rscbar <- mean(rsc)
rsc <- rsc - rscbar
rrp <- rsc %*% t(rsc)
i2 <- i1 + ni - 1
brrp[i1:i2, i1:i2] <- rrp
i1 <- i1 + ni
}
mid <- t(Dmat) %*% v12inv %*% brrp %*% v12inv %*% Dmat
varcov2 <- (tauhat^2) * solve(part1) %*% mid %*% solve(part1)
return(varcov2)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.