Description Usage Arguments Value Examples
Calculates the d-efficiency of a supplied model matrix (det(M'M)^(1/ncol(ModelMatrix))) for a linear model
1 | d_efficiencysimple(CurrentMatrix, returncov = FALSE)
|
CurrentMatrix |
Model matrix with attribute factors coded using contr.sum coding. Matrix must be standardized before passing to function if standardization is desired. |
returncov |
TRUE/FALSE - Value specifying whether to return the variance-covariance matrix. Defaults to FALSE |
The d-efficiency is returned based on a linear model
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | ##---- 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 (CurrentMatrix, det_ref)
{
det_calc <- det(t(CurrentMatrix) %*% CurrentMatrix)
if (det_calc < 0) {
det_calc <- 0
}
d_eff <- ((det_calc/det_ref)^(1/(ncol(CurrentMatrix))))
returnvect <- c(d_eff, det_calc)
names(returnvect) <- c("D efficiency", "Info Matrix Determinant")
return(returnvect)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.