wald.test.jrfit: Do a Wald test based on a JR fit.

Description Usage Arguments Details Value Author(s) References See Also Examples

Description

Do a Wald test based on a JR fit.

Usage

1
wald.test.jrfit(fit, K, asymptotic = FALSE)

Arguments

fit

Output from jrfit.

K

A full row rank contrast matrix.

asymptotic

Should asymptotic (chi-sq) values be used or small sample (F).

Details

Test of K beta = 0.

Value

statistic

The test statistic

p.value

The p-value

asymptotic

logical indicating if asymptotic critical values were used

df

Which chi-sq or F degress of freedom were used

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.

See Also

jrfit

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
##---- 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 (fit, K, asymptotic = FALSE) 
{
    est <- K %*% fit$coef
    var.est <- K %*% fit$varhat %*% t(K)
    statistic <- t(est) %*% solve(var.est) %*% est
    q <- nrow(K)
    if (asymptotic) {
        p.value <- pchisq(statistic, q, lower.tail = FALSE)
        df <- q
    }
    else {
        statistic <- statistic/q
        p.value <- pf(statistic, q, fit$DF, lower.tail = FALSE)
        df <- c(q, fit$DF)
    }
    list(statistic = statistic, p.value = p.value, asymptotic = asymptotic, 
        df = df)
  }

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