d_efficiencysimple: Simple d-efficiency calculation for a supplied model matrix

Description Usage Arguments Value Examples

Description

Calculates the d-efficiency of a supplied model matrix (det(M'M)^(1/ncol(ModelMatrix))) for a linear model

Usage

1
d_efficiencysimple(CurrentMatrix, returncov = FALSE)

Arguments

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

Value

The d-efficiency is returned based on a linear model

Examples

 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)
  }

taalbrecht/MultiEqOptimizer documentation built on May 31, 2019, 12:51 a.m.