sigmastar: Estimate of sigma(0).

Description Usage Arguments Author(s) References Examples

Description

An estimate of sigma(0) needed for an estimate of the standard error of the estimate of intercept.

Usage

1
sigmastar(ehat, block, p)

Arguments

ehat

n by 1 vector of residuals

block

n by 1 vector denoting block membership

p

number of regression parameters (rank of design matrix)

Author(s)

John Kloke <kloke@biostat.wisc.edu>

References

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.

Examples

 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
  }

kloke/jrfit documentation built on May 20, 2019, 12:34 p.m.