Learn R Programming

pkr (version 0.1.3)

plotFit: Plot best fit slope

Description

Automatically select best fit slope for the given x(usually time) and log(y)(usually concentration) values.

Usage

plotFit(concData, id, Time, conc, mol = "", adm = "Extravascular", ID = "", Mol = "")

Arguments

concData

name of data table containing time-concentration data of multiple subjects

id

column name for subject ID

Time

column name for the time

conc

column name for the concentration

mol

column name for molecular species

adm

one of "Bolus" or "Infusion" or "Extravascular" to indicate drug administration mode

ID

Subject ID for this plot

Mol

the name of molecular species to see

Value

R2

R-squared

R2ADJ

adjusted R-squared

LAMZNPT

number of points used for slope

LAMZ

negative of slope, lambda_z

b0

intercept of 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 last point, predicted concentration for the last time point

Details

Find the best fit slope then plot it. Currently this function uses ordinary least square method(OLS) only. This function calles BestSlope function.

See Also

BestSlope

Examples

Run this code
# NOT RUN {
plotFit(Theoph, "Subject", "Time", "conc", ID="1")
plotFit(Indometh, "Subject", "time", "conc", adm="Bolus", ID="1")
# }

Run the code above in your browser using DataLab