Description Usage Arguments Value Author(s) References Examples
Gradiant, with respect to beta, of the MR dispersion function. Used in minimization routine.
1 |
x |
n by p design matrix |
y |
n by 1 response vector |
center |
n by 1 vector denoting block (cluster) membership |
beta |
p by 1 vector |
Gradient of MR dispersion function evaluated at beta.
John Kloke kloke@biostat.wisc.edu
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.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | ### Internal function ###
## The function is currently defined as
function (x, y, center, beta)
{
p <- ncol(x)
a <- unique(center)
nc <- length(a)
Smat <- matrix(nrow = p, ncol = nc)
Dvec <- rep(0, nc)
beta <- as.matrix(beta)
for (j in 1:nc) {
x1 <- as.matrix(x[center == a[j], ])
y1 <- y[center == a[j]]
nj <- length(y1)
e <- y1 - x1 %*% beta
sj <- as.matrix(sqrt(12) * (rank(e, ties.method = "random")/(nj +
1) - 0.5))
Smat[, j] <- t(x1) %*% sj
}
apply(Smat, 1, sum)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.