rashidtau: Estimate of tau for MR.

Description Usage Arguments Author(s) References Examples

Description

Estimate of tau for MR.

Usage

1
rashidtau(resd, p, delta = 0.8)

Arguments

resd
p
delta

Author(s)

John Kloke kloke@biostat.wisc.edu

References

Rashid, M.M., McKean, J.W., Kloke, J.D. (2011). R Estimates and Associated Inferences for Mixed Models with Covariates in a Multi-Center Clinical Trial. Statistics in Biopharmaceutical Research.

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 (resd, p, delta = 0.8) 
{
    n = length(resd)
    rd = sort(matrix(abs(outer(resd, resd, "-")), ncol = 1))
    tn = quantile(rd, delta)/sqrt(n)
    gtn = 0
    for (i in 1:n^2) {
        if (rd[i] <= tn) {
            gtn = gtn + 1
        }
        else {
            break
        }
    }
    gtn = gtn/n^2
    rashidtau = 1/((sqrt(3)/tn) * gtn * sqrt((n - p - 1)/n))
    rashidtau
  }

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