compute_df: Compute the degree of freedom for Inverse Wishart...

View source: R/degree.R

compute_dfR Documentation

Compute the degree of freedom for Inverse Wishart distribution

Description

Compute the degree of freedom for Inverse Wishart distribution

Usage

compute_df(est, se, add_1 = FALSE, maxdf = Inf)

Arguments

est

a variance-covariance matrix of estimation (i.e. OMEGA² or SIGMA²)

se

a matrix of the standard errors of each element of 'est'

add_1

add +1 to the computation of degree of freedom. See details.

maxdf

censor the computed value. Typically the number of subjects/observations in the original analysis.

Details

The function uses a formula "courtesy of Mats Karlsson", found in Robert J. Bauer's "NONMEM Tutorial Part II" (CPT:Pharmacometrics Syst Pharmacol (2019), 8, 538–556 ; Supplementary Materials S1 - Part C). If the dimension of the matrix is > 1, the lowest degree of freedom is selected. The degree of freedom value cannot be lower than the dimension of the matrix. The degree of freedom value should not be higher than the number of individual in the original data for an "OMEGA matrix", or the number of observation for a "SIGMA matrix".

Value

a single integer value

Examples

est_om <- matrix(c(0.2, 0.01, 0.01, 0.1), ncol = 2)
se_om <- matrix(c(0.02, 0.005, 0.005, 0.03), ncol = 2)
compute_df(est = est_om, se = se_om)

FelicienLL/uncrtnty documentation built on Oct. 26, 2023, 12:50 p.m.