Description Usage Arguments Author(s) References Examples
An estimate of sigma(0) needed for an estimate of the standard error of the estimate of intercept.
1 | sigmastar(ehat, block, p)
|
ehat |
n by 1 vector of residuals |
block |
n by 1 vector denoting block membership |
p |
number of regression parameters (rank of design matrix) |
John Kloke <kloke@biostat.wisc.edu>
Kloke, J.D., McKean, J.W., Rashid, M. (2009), Rank-based estimation and associated inferences for linear models with cluster correlated errors, Journal of the American Statistical Association, 104, 384-390.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | ## The function is currently defined as
function (ehat, block, p)
{
ublock <- unique(block)
m <- length(ublock)
nvec <- vector(m, mode = "numeric")
signe <- sign(ehat)
total <- 0
for (k in 1:m) {
signek <- signe[block == ublock[k]]
nvec[k] <- length(signek)
for (i in 1:(nvec[k] - 1)) {
for (j in (i + 1):nvec[k]) {
total <- total + signek[i] * signek[j]
}
}
}
M <- sum(choose(nvec, 2)) - p
rhos <- total/M
nstar <- sum(nvec * (nvec - 1))/sum(nvec)
1 + nstar * rhos
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.