AIP_HDLVrnc: Calculate the variance of AIP when HDL changes.

View source: R/AIPerrorVariance.R

AIP_HDLVrncR Documentation

Calculate the variance of AIP when HDL changes.

Description

This function calculates the variance of the Atherogenic Index of Plasma (AIP) using two methods: Error Propagation (first and second order) and Bootstrap when the HDL distribution changes. It uses a data frame where each column contains a different set of HDL values of increasing variance as the column index increases.

Usage

AIP_HDLVrnc(dfHDL, TG, SI = TRUE, bootStrpReps = 2000)

Arguments

dfHDL

A data frame where each column contains a different set of HDL values of increasing variance as the column index increases.

TG

A vector or data frame column containing the triglyceride (TG) values to be used for the calculation of the variance of the Atherogenic Index of Plasma (AIP).

SI

Boolean (default=TRUE). AIP is by definition calculated using SI units for TG and HDL (mmol/L). If mg/dl units are provided instead, SI must be set to FALSE.

bootStrpReps

(Default=2000) Number of bootstrap iterations for bootstrap variance calculation.

Value

It returns a list with the first order Error Propagation variance (ErrPropVrnc), the second order Error Propagation variance (ErrPropVrnc2Ord) and the bootstrap variance (BootVrnc). Each list element is a vector of length equal to the number of columns of the HDL data frame supplied as argument (dfHDL) and each vector value corresponds to the respective variance of the corresponding data frame columns.

Examples

## Not run: 
dfHDL = CV_Range(sampleB$HDL,0,100,maxRandIter = 1000, plot=FALSE)
AIP_HDLVrnc=AIP_HDLVrnc(dfHDL,sampleA$TG, bootStrpReps=2000)

## End(Not run)

LDLcalc documentation built on May 31, 2022, 5:07 p.m.