### Determine Best-Fit Slope for Log(y) vs. x Regression Source: https://cran.r-project.org/web/packages/NonCompart/refman/NonCompart.html Sequentially fits log(y) against x, starting from the last point and moving backward, to find the slope with the highest adjusted R-squared. Handles ties in R-squared by selecting the longer slope. Requires x and y vectors and optionally administration mode, tolerance, and an exclusion delta value. ```R BestSlope(Theoph[Theoph$Subject==1, "Time"], Theoph[Theoph$Subject==1, "conc"]) ``` ```R BestSlope(Indometh[Indometh$Subject==1, "time"], Indometh[Indometh$Subject==1, "conc"], adm="Bolus") ``` -------------------------------- ### gIntAUC Source: https://cran.r-project.org/web/packages/NonCompart/refman/NonCompart.html Calculates interval AUC of general form, useful for pharmacodynamic data. It computes a partial AUC between specified start and end times. ```APIDOC ## Calculate interval AUC of general form ### Description It calculates interval AUC of general form. This is useful for pharmacodynamic data. ### Usage ```R gIntAUC(x, y, t1, t2, Outer = "NEAREST") ``` ### Arguments `x` | vector values of independent variable, usually time ---|--- `y` | vector values of dependent variable, usually concentration `t1` | start time for AUC `t2` | end time for AUC `Outer` | indicates how to do the out of x range point ### Details This calculates an interval (partial) AUC (from t1 to t2) with the given series of x and y. If t1 and/or t2 cannot be found within x vector, it interpolates. If t1 and/or t2 are out of x range, it uses the nearest value. For concentration data, use `IntAUC`. ### Value return interval AUC value (scalar) ### Author(s) Kyun-Seop Bae ### See Also `gAUC`, `gInterpol`, `tblAUC` ### Examples ```R gIntAUC(Theoph[Theoph$Subject==1, "Time"], Theoph[Theoph$Subject==1, "conc"], t1=0.5, t2=11) ``` ``` -------------------------------- ### sNCA with Time Unit Conversion Source: https://cran.r-project.org/web/packages/NonCompart/refman/NonCompart.html Demonstrates how to handle different time units (hours and minutes) when performing NCA with sNCA. ```R sNCA(x, y, dose=320, concUnit="mg/L", timeUnit="hr") sNCA(x*60, y, dose=320, concUnit="mg/L", timeUnit="min") ``` -------------------------------- ### sNCA with Various Unit and Dose Specifications Source: https://cran.r-project.org/web/packages/NonCompart/refman/NonCompart.html Illustrates different ways to specify dose and units in sNCA, including using molecular weight and handling missing dose values. ```R sNCA(x, y/MW, dose=320/MW, doseUnit="mmol", concUnit="mmol/L", timeUnit="h", MW=MW) sNCA(x, y/MW, doseUnit="mmol", concUnit="mmol/L", timeUnit="h", MW=MW) sNCA(x, y/MW, dose=as.numeric(NA), doseUnit="mmol", concUnit="mmol/L", timeUnit="h", MW=MW) ``` -------------------------------- ### UnitUrine Function Source: https://cran.r-project.org/web/packages/NonCompart/refman/NonCompart.html Returns a conversion factor for amount calculation from urine concentration and volume, facilitating unit standardization for urine data analysis. ```APIDOC ## UnitUrine Function ### Description You can get a conversion factor for the multiplication: conc * vol * factor = amount in the given unit. ### Usage ```R UnitUrine(conU = "ng/mL", volU = "mL", amtU = "mg", MW = 0) ``` ### Arguments `conU` | concentration unit `volU` | volume unit `amtU` | amount unit `MW` | molecular weight ### Value `Factor` | conversion factor for multiplication with the unit in name ### Author(s) Kyun-Seop Bae ### Examples ```R UnitUrine() UnitUrine("ng/mL", "mL", "mg") UnitUrine("ug/L", "mL", "mg") UnitUrine("ug/L", "L", "mg") UnitUrine("ng/mL", "mL", "g") UnitUrine("ng/mL", "mL", "mol", MW=500) UnitUrine("ng/mL", "mL", "mmol", MW=500) UnitUrine("ng/mL", "mL", "umol", MW=500) ``` ``` -------------------------------- ### sNCA with Unit Conversion (MW) Source: https://cran.r-project.org/web/packages/NonCompart/refman/NonCompart.html Performs NCA with unit conversions using molecular weight (MW). Demonstrates converting concentration and dose units. ```R MW = 180.164 # Molecular weight of theophylline sNCA(x, y/MW, dose=320, doseUnit="mg", concUnit="mmol/L", timeUnit="h") sNCA(x, y/MW, dose=320, doseUnit="mg", concUnit="mmol/L", timeUnit="h", MW=MW) sNCA(x, y, dose=320/MW, doseUnit="mmol", concUnit="mg/L", timeUnit="h", MW=MW) sNCA(x, y/MW, dose=320/MW, doseUnit="mmol", concUnit="mmol/L", timeUnit="h", MW=MW) ``` -------------------------------- ### Unit Function Source: https://cran.r-project.org/web/packages/NonCompart/refman/NonCompart.html Displays CDISC PP output units and their multiplication factors. It can be used to standardize units for NonCompart analysis. ```APIDOC ## Unit Function ### Description It displays CDISC PP output units and multiplication factor for them. ### Usage ```R Unit(code = "", timeUnit = "h", concUnit = "ng/mL", doseUnit = "mg", MW = 0) ``` ### Arguments `code` | vector of PPTESTCD `timeUnit` | unit of time `concUnit` | unit of concentration `doseUnit` | unit of dose `MW` | molecular weight of drug ### Value `row names` | PPTESTCD `Unit` | unit `Factor` | internal mulitplication factor ### Author(s) Kyun-Seop Bae ### Examples ```R Unit(concUnit="ug/L", doseUnit="mg") Unit(concUnit="ng/L", doseUnit="mg") Unit(concUnit="umol/L", doseUnit="mmol") Unit(concUnit="nmol/L", doseUnit="mmol") Unit(concUnit="mmol/L", doseUnit="mg", MW=500) Unit(concUnit="umol/L", doseUnit="mg", MW=500) Unit(concUnit="nmol/L", doseUnit="mg", MW=500) Unit(concUnit="nmol/mL", doseUnit="mg", MW=500) Unit(concUnit="ug/L", doseUnit="mmol", MW=500) Unit(concUnit="ug/L", doseUnit="mol", MW=500) Unit(concUnit="ng/L", doseUnit="mmol", MW=500) Unit(concUnit="ng/mL", doseUnit="mmol", MW=500) Unit(concUnit="nmol/L", doseUnit="mg") Unit(concUnit="ug/L", doseUnit="mmol") ``` ``` -------------------------------- ### R - UnitUrine Function for Urine Conversion Factor Source: https://cran.r-project.org/web/packages/NonCompart/refman/NonCompart.html Employ the `UnitUrine` function to obtain a conversion factor for calculating amount from urine concentration and volume. This is useful for the equation: conc * vol * factor = amount. ```r UnitUrine(conU = "ng/mL", volU = "mL", amtU = "mg", MW = 0) ``` ```r UnitUrine() UnitUrine("ng/mL", "mL", "mg") UnitUrine("ug/L", "mL", "mg") UnitUrine("ug/L", "L", "mg") UnitUrine("ng/mL", "mL", "g") UnitUrine("ng/mL", "mL", "mol", MW=500) UnitUrine("ng/mL", "mL", "mmol", MW=500) UnitUrine("ng/mL", "mL", "umol", MW=500) ``` -------------------------------- ### Calculate AUC and AUMC using Linear or Log methods Source: https://cran.r-project.org/web/packages/NonCompart/refman/NonCompart.html Calculates cumulative AUC and AUMC using either the linear trapezoidal method or the linear-up and log-down method. Requires vectors for the independent (x) and dependent (y) variables. ```R AUC(Theoph[Theoph$Subject==1, "Time"], Theoph[Theoph$Subject==1, "conc"]) ``` ```R AUC(Theoph[Theoph$Subject==1, "Time"], Theoph[Theoph$Subject==1, "conc"], down="Log") ``` -------------------------------- ### Calculate AUC and AUMC using Linear-Up Log-Down Method Source: https://cran.r-project.org/web/packages/NonCompart/refman/NonCompart.html Calculates AUC and AUMC using the linear-up log-down method. This function is useful for pharmacokinetic studies where these parameters are derived from time-concentration data. ```R LogAUC(Theoph[Theoph$Subject==1, "Time"], Theoph[Theoph$Subject==1, "conc"]) ``` ```R AUC(Theoph[Theoph$Subject==1, "Time"], Theoph[Theoph$Subject==1, "conc"], down="Log") ``` -------------------------------- ### R - Unit Function for CDISC Units Source: https://cran.r-project.org/web/packages/NonCompart/refman/NonCompart.html Use the `Unit` function to display CDISC standard units and their multiplication factors for NCA results. Specify time, concentration, and dose units, along with molecular weight if applicable. ```r Unit(code = "", timeUnit = "h", concUnit = "ng/mL", doseUnit = "mg", MW = 0) ``` ```r Unit(concUnit="ug/L", doseUnit="mg") Unit(concUnit="ng/L", doseUnit="mg") Unit(concUnit="umol/L", doseUnit="mmol") Unit(concUnit="nmol/L", doseUnit="mmol") Unit(concUnit="mmol/L", doseUnit="mg", MW=500) Unit(concUnit="umol/L", doseUnit="mg", MW=500) Unit(concUnit="nmol/L", doseUnit="mg", MW=500) Unit(concUnit="nmol/mL", doseUnit="mg", MW=500) Unit(concUnit="ug/L", doseUnit="mmol", MW=500) Unit(concUnit="ug/L", doseUnit="mol", MW=500) Unit(concUnit="ng/L", doseUnit="mmol", MW=500) Unit(concUnit="ng/mL", doseUnit="mmol", MW=500) Unit(concUnit="nmol/L", doseUnit="mg") Unit(concUnit="ug/L", doseUnit="mmol") ``` -------------------------------- ### DetSlope Source: https://cran.r-project.org/web/packages/NonCompart/refman/NonCompart.html Manually determines the slope for the log(y) and x regression. This function is useful when the automatic 'BestSlope' function does not yield satisfactory results for the terminal slope. ```APIDOC ## DetSlope(x, y, SubTitle="", sel.1=0, sel.2=0) ### Description You choose a slope for terminal half-life. ### Arguments `x` | vector values of x-axis, usually time `y` | vector values of y-axis, usually concentration `SubTitle` | subtitle to be shown on the plot `sel.1` | default index of the first element to use `sel.2` | default index of the last element to use ### Details Sometimes `BestSlope` cannot find terminal slope satisfactorily. Then you can use this function to choose manually. It returns the same format result with `BestSlope` with an attribute indicating used points. ### Value `R2` | R-squared `R2ADJ` | adjusted R-squared `LAMZNPT` | number of points used for the slope `LAMZ` | negative of the slope, lambda_z `b0` | intercept of the regression line `CORRXY` | correlation of log(y) and x `LAMZLL` | earliest x for lambda_z `LAMZUL` | last x for lambda_z `CLSTP` | predicted y value at the last point, predicted concentration for the last time point ### Examples ```R DetSlope(Theoph[Theoph$Subject==1, "Time"], Theoph[Theoph$Subject==1, "conc"]) DetSlope(Indometh[Indometh$Subject==2, "time"], Indometh[Indometh$Subject==2, "conc"]) ``` ``` -------------------------------- ### Calculate AUC and AUMC using Linear Trapezoidal Method Source: https://cran.r-project.org/web/packages/NonCompart/refman/NonCompart.html Calculates the Area Under the Curve (AUC) and Area Under the First Moment Curve (AUMC) using the linear trapezoidal method. This function is typically used for pharmacokinetic data analysis. ```R LinAUC(Theoph[Theoph$Subject==1, "Time"], Theoph[Theoph$Subject==1, "conc"]) AUC(Theoph[Theoph$Subject==1, "Time"], Theoph[Theoph$Subject==1, "conc"]) # compare the last line ``` -------------------------------- ### LogAUC Source: https://cran.r-project.org/web/packages/NonCompart/refman/NonCompart.html Calculates Area Under the Curve (AUC) and Area Under the first Moment Curve (AUMC) using the linear-up log-down method. This function is useful for pharmacokinetic analysis. ```APIDOC ## LogAUC ### Description It calculates AUC and AUMC using the linear-up log-down method. ### Usage ```R LogAUC(x, y) ``` ### Arguments `x` | vector values of the independent variable, usually time `y` | vector values of the dependent variable, usually concentration ### Details This function returns AUC and AUMC by the linear-up log-down method. ### Value `AUC` | area under the curve `AUMC` | area under the first moment curve ### Author(s) Kyun-Seop Bae ### References 1. Gabrielsson J, Weiner D. Pharmacokinetic and Pharmacodynamic Data Analysis - Concepts and Applications. 5th ed. 2016. 2. Shargel L, Yu A. Applied Biopharmaceutics and Pharmacokinetics. 7th ed. 2015. 3. Rowland M, Tozer TN. Clinical Pharmacokinetics and Pharmacodynamics - Concepts and Applications. 4th ed. 2011. 4. Gibaldi M, Perrier D. Pharmacokinetics. 2nd ed. revised and expanded. 1982. ### See Also `LinAUC`,`AUC` ### Examples ```R LogAUC(Theoph[Theoph$Subject==1, "Time"], Theoph[Theoph$Subject==1, "conc"]) # Compare the last line with the above AUC(Theoph[Theoph$Subject==1, "Time"], Theoph[Theoph$Subject==1, "conc"], down="Log") ``` ``` -------------------------------- ### Perform Non-Compartmental Analysis (NCA) and return a table Source: https://cran.r-project.org/web/packages/NonCompart/refman/NonCompart.html Use `tblNCA` for comprehensive NCA calculations on concentration-time data. This function can handle various administration modes and dose units, and allows for interval AUC calculations. ```R tblNCA(concData, key = "Subject", colTime = "Time", colConc = "conc", dose = 0, adm = "Extravascular", dur = 0, doseUnit = "mg", timeUnit = "h", concUnit = "ug/L", down = "Linear", R2ADJ = 0, MW = 0, SS = FALSE, iAUC = "", excludeDelta = 1, UsePoints = NULL) ``` -------------------------------- ### Slope Source: https://cran.r-project.org/web/packages/NonCompart/refman/NonCompart.html Calculates the slope of the regression line for log(y) versus x. This function is typically used internally by other functions like `BestSlope` and is not usually called directly by users. ```APIDOC ## Slope ### Description It calculates the slope with linear regression of log(y) ~ x ### Usage ```R Slope(x, y) ``` ### Arguments `x` | vector values of the independent variable, usually time `y` | vector values of the dependent variable, usually concentration ### Details With time-concentration curve, you frequently need to estimate slope in log(concentration) ~ time. This function is usually called by `BestSlope` function, and you seldom need to call this function directly. ### Value `R2` | R-squared `R2ADJ` | adjusted R-squared `LAMZNPT` | number of points used for slope `LAMZ` | negative of the slope, lambda_z `b0` | intercept of the regression line `CORRXY` | correlation of log(y) and x `LAMZLL` | earliest x for lambda_z `LAMZUL` | last x for lambda_z ### Author(s) Kyun-Seop Bae ### See Also `BestSlope` ### Examples ```R Slope(Indometh[Indometh$Subject==1, "time"], Indometh[Indometh$Subject==1, "conc"]) ``` ``` -------------------------------- ### Interpolate Y Value with NonCompart Source: https://cran.r-project.org/web/packages/NonCompart/refman/NonCompart.html Interpolates a y-value for a new x-value that is not present in the original x vector. Useful for estimating concentrations at specific time points. Can use linear or logarithmic interpolation. ```R x = 10:1 + 0.1 y = -2*x + 40.2 Interpol(x, y, 1.5) Interpol(x, y, 1.5, down="Log") ``` -------------------------------- ### Calculate Interval Area Under the Curve (AUC) Source: https://cran.r-project.org/web/packages/NonCompart/refman/NonCompart.html IntAUC calculates a partial AUC between specified time points (t1 and t2). If t1 or t2 are not found in the x vector, it interpolates based on the 'down' option (Linear or Log). ```R Res = sNCA(Theoph[Theoph$Subject==1, "Time"], Theoph[Theoph$Subject==1, "conc"], dose=320, concUnit="mg/L") IntAUC(Theoph[Theoph$Subject==1, "Time"], Theoph[Theoph$Subject==1, "conc"], t1=0.5, t2=11, Res) ``` -------------------------------- ### gInterpol Source: https://cran.r-project.org/web/packages/NonCompart/refman/NonCompart.html Interpolates y values for a general y value when a corresponding x value (xnew) does not exist within the x vector. This function is typically called by `gIntAUC`. ```APIDOC ## gInterpol ### Description It interpolates y value when a corresponding x value (xnew) does not exist within x vector ### Usage ``` gInterpol(x, y, xnew, Outer="NEAREST") ``` ### Arguments `x` | vector values of x-axis, usually time ---|--- `y` | vector values of y-axis, usually concentration `xnew` | new x point to be interpolated, usually new time point `Outer` | indicates how to do the out of x range point ### Details This function interpolate y value, if xnew is not in x vector. If xnew is in the x vector, it just returns the given x and y vector. This function usually is called by `gIntAUC` function. Returned vector is sorted in the order of increasing x values. ### Value new x and y vector containing xnew and ynew point ### Author(s) Kyun-Seop Bae ### See Also `gIntAUC` ### Examples ```R x = 1:10 + 0.1 y = -2*x + 40.2 gInterpol(x, y, 1.5) gInterpol(x, y, 0.5) # Out of range, Left gInterpol(x, y, 11) # Out of range, Right ``` ``` -------------------------------- ### Manually Determine Regression Slope Source: https://cran.r-project.org/web/packages/NonCompart/refman/NonCompart.html Use DetSlope when the BestSlope function does not satisfactorily determine the terminal slope. It returns results in the same format as BestSlope, with an attribute indicating the points used. ```R DetSlope(Theoph[Theoph$Subject==1, "Time"], Theoph[Theoph$Subject==1, "conc"]) DetSlope(Indometh[Indometh$Subject==2, "time"], Indometh[Indometh$Subject==2, "conc"]) ``` -------------------------------- ### Perform NCA for Multiple Subjects using tblNCA Source: https://cran.r-project.org/web/packages/NonCompart/refman/NonCompart.html Use tblNCA to perform noncompartmental analysis for multiple subjects. Specify key columns, time, concentration, dose, administration type, and units. Optional parameters like dose duration and R-squared adjustment can be included. ```R tblNCA(Theoph, key="Subject", colTime="Time", colConc="conc", dose=320, adm="Extravascular", doseUnit="mg", concUnit="mg/L") ``` ```R tblNCA(Indometh, key="Subject", colTime="time", colConc="conc", dose=25, adm="Infusion", dur=0.5, doseUnit="mg", concUnit="mg/L", R2ADJ=0.9) ``` -------------------------------- ### Interval AUC Calculation in R Source: https://cran.r-project.org/web/packages/NonCompart/refman/NonCompart.html Use gIntAUC to calculate a partial AUC between specified time points (t1 and t2). It handles cases where t1 or t2 are outside the range of the provided x values by using the nearest point. ```r gIntAUC(x, y, t1, t2, Outer = "NEAREST") ``` ```r gIntAUC(Theoph[Theoph$Subject==1, "Time"], Theoph[Theoph$Subject==1, "conc"], t1=0.5, t2=11) ``` -------------------------------- ### sNCA with Interval AUC Source: https://cran.r-project.org/web/packages/NonCompart/refman/NonCompart.html Performs NCA and calculates Area Under the Curve (AUC) for specified time intervals. The iAUC parameter takes a data frame defining the intervals. ```R iAUC = data.frame(Name=c("AUC[0-12h]","AUC[0-24h]"), Start=c(0,0), End=c(12,24)) sNCA(x, y, dose=320, doseUnit="mg", concUnit="mg/L", timeUnit="h", iAUC=iAUC) ``` -------------------------------- ### Non-Compartmental Analysis with tblNCA (Intravenous Bolus) Source: https://cran.r-project.org/web/packages/NonCompart/refman/NonCompart.html Performs non-compartmental analysis for intravenous bolus administration. Requires specifying the dataset, a key subject identifier, dose, and concentration units. ```R tblNCA(Theoph, key="Subject", dose=320, concUnit="mg/L") ``` -------------------------------- ### IntAUC Source: https://cran.r-project.org/web/packages/NonCompart/refman/NonCompart.html Calculates the interval AUC (Area Under the Curve) between two specified time points (t1 and t2). This function can interpolate values if t1 or t2 are not present in the provided data. ```APIDOC ## IntAUC(x, y, t1, t2, Res, down = "Linear") ### Description It calculates interval AUC ### Arguments `x` | vector values of independent variable, usually time `y` | vector values of dependent variable, usually concentration `t1` | start time for AUC `t2` | end time for AUC `Res` | result from `sNCA` function `down` | either of `"Linear"` or `"Log"` to indicate the way to calculate AUC ### Details This calculates an interval (partial) AUC (from t1 to t2) with the given series of x and y. If t1 and/or t2 cannot be found within x vector, it interpolates according to the `down` option. ### Value return interval AUC value (scalar) ### References 1. Gabrielsson J, Weiner D. Pharmacokinetic and Pharmacodynamic Data Analysis - Concepts and Applications. 5th ed. 2016. 2. Shargel L, Yu A. Applied Biopharmaceutics and Pharmacokinetics. 7th ed. 2015. 3. Rowland M, Tozer TN. Clinical Pharmacokinetics and Pharmacodynamics - Concepts and Applications. 4th ed. 2011. 4. Gibaldi M, Perrier D. Pharmacokinetics. 2nd ed. revised and expanded. 1982. ### Examples ```R Res = sNCA(Theoph[Theoph$Subject==1,"Time"], Theoph[Theoph$Subject==1, "conc"], dose=320, concUnit="mg/L") IntAUC(Theoph[Theoph$Subject==1, "Time"], Theoph[Theoph$Subject==1, "conc"], t1=0.5, t2=11, Res) ``` ``` -------------------------------- ### Simplest Noncompartmental Analysis (NCA) Source: https://cran.r-project.org/web/packages/NonCompart/refman/NonCompart.html The primary function for performing noncompartmental analysis. It calculates various pharmacokinetic parameters based on time and concentration data. Supports different administration modes and AUC calculation methods. ```R sNCA(x, y, dose = 0, adm = "Extravascular", dur = 0, doseUnit = "mg", timeUnit = "h", concUnit = "ug/L", iAUC = "", down = "Linear", R2ADJ = 0.7, MW = 0, SS = FALSE, Keystring="", excludeDelta = 1, UsePoints = NULL) ``` -------------------------------- ### Calculate AUCs and return a table Source: https://cran.r-project.org/web/packages/NonCompart/refman/NonCompart.html Use `tblAUC` to compute multiple AUC values and present them in a tabular format. It is suitable for analyzing data with multiple subjects and can calculate interval AUCs. ```R tblAUC(Theoph, key="Subject", colX="Time", colY="conc") ``` ```R iAUC = data.frame(Name=c("AUC[0-12h]","AUC[0-24h]"), Start=c(0,0), End=c(12,24)) tblAUC(Indometh, key="Subject", colX="time", colY="conc", iAUC=iAUC) ``` -------------------------------- ### Non-Compartmental Analysis with tblNCA (Infusion) Source: https://cran.r-project.org/web/packages/NonCompart/refman/NonCompart.html Performs non-compartmental analysis for infusion administration. Requires specifying the dataset, key subject identifier, dose, administration type, duration, and concentration units. ```R tblNCA(Indometh, key="Subject", colTime="time", colConc="conc", dose=25, adm="Infusion", dur=0.5, concUnit="mg/L") ``` -------------------------------- ### tblAUC Source: https://cran.r-project.org/web/packages/NonCompart/refman/NonCompart.html Calculates multiple AUCs and returns a result table. This function is useful for generating tabular outputs of AUC values across different subjects. ```APIDOC ## tblAUC ### Description Do multiple AUCs and returns a result table. See `gAUC` for more detail i.e. `iAUC` ### Usage ```R tblAUC(Data, key = "Subject", colX = "Time", colY = "Y", iAUC = "", Ymax = "Emax", XofYmax = "TEmax", AUCname = "AUEClast", Outer = "NEAREST") ``` ### Arguments `Data` | data table name `key` | column names of Data to be shown in the output table `colX` | column name for x axis `colY` | column name for y axis `iAUC` | a data.frame to calculate interval AUCs `Ymax` | usually Cmax or Emax `XofYmax` | usually Tmax or TEmax `AUCname` | usually AUClast or AUEClast `Outer` | indicates how to do the out of x range point ### Details Tabular output of AUC with many subjects. This calculates only Cmax(Emax), Tmax(TEmax), AUCs ### Value Basically same with `gAUC` ### Author(s) Kyun-Seop Bae ### See Also `help`, `gAUC` ### Examples ```R tblAUC(Theoph, key="Subject", colX="Time", colY="conc") iAUC = data.frame(Name=c("AUC[0-12h]","AUC[0-24h]"), Start=c(0,0), End=c(12,24)) tblAUC(Indometh, key="Subject", colX="time", colY="conc", iAUC=iAUC) ``` ``` -------------------------------- ### Calculate Regression Slope for Log-Transformed Data Source: https://cran.r-project.org/web/packages/NonCompart/refman/NonCompart.html Calculates the slope of the regression line for log(y) versus x. This function is typically used internally by `BestSlope` to estimate elimination rates from concentration-time data. ```R Slope(Indometh[Indometh$Subject==1, "time"], Indometh[Indometh$Subject==1, "conc"]) ``` -------------------------------- ### Basic sNCA Call Source: https://cran.r-project.org/web/packages/NonCompart/refman/NonCompart.html Performs a basic non-compartmental analysis for a single subject. Requires time and concentration data. Dose is optional. ```R # For one subject x = Theoph[Theoph$Subject=="1","Time"] y = Theoph[Theoph$Subject=="1","conc"] sNCA(x, y, dose=320, doseUnit="mg", concUnit="mg/L", timeUnit="h") sNCA(x, y, dose=320, concUnit="mg/L") ``` -------------------------------- ### Perform NCA for a Single Subject using sNCA Source: https://cran.r-project.org/web/packages/NonCompart/refman/NonCompart.html Use sNCA to perform noncompartmental analysis for a single subject. Provide time, concentration, dose, and units. You can also specify custom intervals for AUC calculation using the iAUC parameter. ```R iAUC = data.frame(Name=c("AUC[0-12h]","AUC[0-24h]"), Start=c(0,0), End=c(12,24)) ; iAUC x = Theoph[Theoph$Subject=="1","Time"] y = Theoph[Theoph$Subject=="1","conc"] sNCA(x, y, dose=320, doseUnit="mg", concUnit="mg/L", timeUnit="h", iAUC=iAUC) ``` ```R sNCA(x, y, dose=320, concUnit="mg/L", iAUC=iAUC) ``` -------------------------------- ### sNCA Source: https://cran.r-project.org/web/packages/NonCompart/refman/NonCompart.html The work-horse function for Non-Compartmental Analysis (NCA). It calculates various NCA parameters based on time-concentration data. ```APIDOC ## sNCA ### Description This is the work-horse function for NCA. ### Usage ```R sNCA(x, y, dose = 0, adm = "Extravascular", dur = 0, doseUnit = "mg", timeUnit = "h", concUnit = "ug/L", iAUC = "", down = "Linear", R2ADJ = 0.7, MW = 0, SS = FALSE, Keystring="", excludeDelta = 1, UsePoints = NULL) ``` ### Arguments `x` | usually time, a vector ---|--- `y` | usually concentration, a vector `dose` | given amount, not amount per body weight, a scalar `adm` | one of `"Bolus"` or `"Infusion"` or `"Extravascular"` to indicate drug administration mode `dur` | duration of infusion, a scalar `doseUnit` | unit of dose `timeUnit` | unit of time `concUnit` | unit of concentration `iAUC` | interval AUCs to calculate `down` | either of `"Linear"` or `"Log"` to indicate the way to calculate AUC and AUMC `R2ADJ` | Minimum adjusted R-square value to determine terminal slope automatically `MW` | molecular weight of the drug `SS` | if steady-state, this should be TRUE. AUCLST (AUClast) is used instead of AUCIFO (AUCinf) for the calculation of Vz (VZFO, VZO), CL (CLFO, CLO), and Vdss (VSSO). `Keystring` | a text string to be shown at the plot in case of manual selection of terminal slope `excludeDelta` | Improvement of R2ADJ larger than this value could exclude the last point. Default value 1 is for the compatibility with other software. `UsePoints` | Indices of points to calculate terminal slope. Vaules of use points should not be zero. Use only when automatic determination is not satisfactory. If this is used, R2ADJ option is ignored. ### Details This replaced previous `IndiNCA`. Author recommends to use `excludeDelta` option with about 0.3. ``` -------------------------------- ### gAUC Source: https://cran.r-project.org/web/packages/NonCompart/refman/NonCompart.html General AUC function for Emax, TEmax and AUCs. It calculates Cmax, Tmax, and AUCs, and can handle pharmacodynamic data with negative values. ```APIDOC ## gAUC ### Description General AUC function for Emax, TEmax and AUCs ### Usage ```R gAUC(x, y, Ymax = "Emax", XofYmax = "TEmax", AUCname = "AUEClast", iAUC = "", Outer = "NEAREST") ``` ### Arguments `x` | usually time ---|--- `y` | usually concentration or effect. This can be negative/ `Ymax` | usually Cmax or Emax `XofYmax` | usually Tmax or TEmax `AUCname` | usually AUClast or AUEClast `iAUC` | a data.frame to calculate interval AUCs `Outer` | indicates how to do the out of x range point ### Details This is a general purpose AUC function. It calculates only Cmax(Emax), Tmax(TEmax) and AUCs(AUECs). This can be used for effect(pharmacodynamic) data which has negative values. For concentration data, use `IntAUC`. ### Value Column names can vary according to the options. `Emax` | maximum y value ---|--- `TEmax` | x value at the maximum y value `AUEClast` | Area under the y versus x curve `iAUCs` | Columns from iAUC input ### Author(s) Kyun-Seop Bae ### Examples ```R # For one subject x = Theoph[Theoph$Subject=="1", "Time"] y = Theoph[Theoph$Subject=="1", "conc"] gAUC(x, y) iAUC = data.frame(Name=c("AUC[0-12h]","AUC[0-24h]"), Start=c(0,0), End=c(12,24)) gAUC(x, y, iAUC=iAUC) ``` ``` -------------------------------- ### tblNCA Source: https://cran.r-project.org/web/packages/NonCompart/refman/NonCompart.html Performs multiple Non-Compartmental Analysis (NCA) and returns a result table. This function is designed for comprehensive NCA calculations. ```APIDOC ## tblNCA ### Description Do multiple NCA and returns a result table. See `sNCA` for more detail i.e. `iAUC` ### Usage ```R tblNCA(concData, key = "Subject", colTime = "Time", colConc = "conc", dose = 0, adm = "Extravascular", dur = 0, doseUnit = "mg", timeUnit = "h", concUnit = "ug/L", down = "Linear", R2ADJ = 0, MW = 0, SS = FALSE, iAUC = "", excludeDelta = 1, UsePoints = NULL) ``` ### Arguments `concData` | concentration data table `key` | column names of concData to be shown in the output table `colTime` | column name for time `colConc` | column name for concentration `dose` | administered dose, a scalar or a vector `adm` | one of "Bolus" or "Infusion" or "Extravascular" to indicate drug administration mode `dur` | duration of infusion, a scalar or a vector `doseUnit` | unit of dose `timeUnit` | unit of time `concUnit` | unit of concentration `down` | method to calculate AUC, "Linear" or "Log" `R2ADJ` | Lowest threshold of adjusted R-square value to do manual slope determination `MW` | molecular weight of drug `SS` | if steady-state, this should be TRUE. AUCLST (AUClast) is used instead of AUCIFO (AUCinf) for the calculation of Vz (VZFO, VZO), CL (CLFO, CLO), and Vdss (VSSO). `iAUC` | data.frame for interval AUC `excludeDelta` | Improvement of R2ADJ larger than this value could exclude the last point. Default value 1 is for the compatibility with other software. `UsePoints` | A list of length equal to the number of subjects/NCAs. Each element is a vector of indices of points to calculate terminal slope for the corresponding subject. Values of use points should not be zero. Use only when automatic determination is not satisfactory. If this is used, R2ADJ option is ignored. ### Details Tabular output of NCA with many subjects. Author recommends to use `excludeDelta` option with about 0.3. ``` -------------------------------- ### Interpolate Y Value Source: https://cran.r-project.org/web/packages/NonCompart/refman/NonCompart.html Interpolates a y-value for a given x-value that may not exist in the original data. Useful for estimating concentrations at specific time points. Handles out-of-range values using the 'Outer' argument. ```R x = 1:10 + 0.1 y = -2*x + 40.2 gInterpol(x, y, 1.5) gInterpol(x, y, 0.5) # Out of range, Left gInterpol(x, y, 11) # Out of range, Right ``` -------------------------------- ### General AUC Calculation in R Source: https://cran.r-project.org/web/packages/NonCompart/refman/NonCompart.html Use gAUC for calculating Cmax, Tmax, and AUCs for a single subject's data. It can also compute interval AUCs when an iAUC data frame is provided. ```r gAUC(x, y, Ymax = "Emax", XofYmax = "TEmax", AUCname = "AUEClast", iAUC = "", Outer = "NEAREST") ``` ```r # For one subject x = Theoph[Theoph$Subject=="1", "Time"] y = Theoph[Theoph$Subject=="1", "conc"] gAUC(x, y) ``` ```r iAUC = data.frame(Name=c("AUC[0-12h]","AUC[0-24h]"), Start=c(0,0), End=c(12,24)) gAUC(x, y, iAUC=iAUC) ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.