Learn R Programming

cliot (version 1.0.0)

calculate_ldl: LDL Calculated (Friedewald Equation)

Description

Calculates Low-Density Lipoprotein (LDL) cholesterol using the Friedewald equation. This formula estimates LDL based on total cholesterol, HDL cholesterol, and triglycerides. It is the standard method for reporting LDL when direct measurement is not performed, provided triglycerides are not significantly elevated.

Usage

calculate_ldl(total_cholesterol, hdl_cholesterol, triglycerides, units = "mg/dL")

Value

A list containing:

LDL_Cholesterol

The calculated LDL level.

Validity

A warning message if the triglyceride level exceeds the validation threshold.

Arguments

total_cholesterol

Numeric. Total Cholesterol level.

hdl_cholesterol

Numeric. High-Density Lipoprotein (HDL) Cholesterol level.

triglycerides

Numeric. Triglycerides level.

units

String. Units for all lipid inputs. Options: "mg/dL" (default) or "mmol/L".

Details

The formula used depends on the units:

  • mg/dL: LDL = Total Chol - HDL - (Triglycerides / 5)

  • mmol/L: LDL = Total Chol - HDL - (Triglycerides / 2.2)

The equation is generally considered invalid if triglycerides exceed 400 mg/dL (4.5 mmol/L).

References

Friedewald WT, Levy RI, Fredrickson DS. Estimation of the concentration of low-density lipoprotein cholesterol in plasma, without use of the preparative ultracentrifuge. Clin Chem. 1972;18(6):499-502.

Examples

Run this code

# Example 1: Standard Calculation (mg/dL)
# Total 200, HDL 50, Trigs 150
# LDL = 200 - 50 - (150/5) = 120
calculate_ldl(200, 50, 150)

# Example 2: High Triglycerides
# Total 250, HDL 40, Trigs 500
calculate_ldl(250, 40, 500)

Run the code above in your browser using DataLab