Chapter 1 Flashcards
(35 cards)
Describe the difference between ‘long’ and ‘wide’ data formats and state which is most commonly used in pharmacokinetic modelling. (3 marks)
In long format data each row represents an observation for each ID, whereas in wide format each row represents a single ID and the columns contain repeated measures. Multiple time points appear horizontally as separate columns.
Long format is most commonly used in pharmacokinetic modelling, as it is easier for computer programmes like R to analyse and manipulate the data. Because it allows the data to be organised with repeated measures over time. In long form each event for each ID has its own row.
Give an example line of code for - Multiplication
3*2
Give an example line of code for each of - Addition
2+4 #Addition
Give an example line of code for each of - Natural logarithm
log(2)
What does the command ‘header=TRUE’ indicate
indicates the first row of the csv file contains headers(labels) for the variable
You have prepared a data frame that you would like to save. You are not sure that R is working in the correct folder that you wish to save it into.
What command will allow you to check that R is working in the correct folder?
getwd()
How to check the contents of the working directory in R
list.files()
What does the function head() do?
Shows the first 6 rows of the data frame
data[15,]
looks at row 15
How to use R to check for anomalies:
summary () function
What are R packages
groups of functions. Packages bring in new functions to use with/for the data (datasets).
what is %>%
Piping (%>%) is a tool that enables multiple logical steps to achieve a desired output.
What line of code should be added to plot a solid line for each individual?
A) geom_line(by=ID)
B) ggplot(data=data, aes(x=time, y=conc, group=ID))
C) ggplot(data=data, aes(x=time, y=conc, group_by=ID))
D) ggplot(data=data, aes(x=time, y=conc, line=ID))
E) geom_line(aes(linetype=ID))
B) ggplot(data=data, aes(x=time, y=conc, group=ID))
What command would produce a separate panel for each individual?
A) facet_wrap(vars(ID))
B) geom_line(aes(col=ID))
C) ggplot(data=data, aes(x=time, y=conc, fill=ID))
D) ggplot(data=data, aes(x=time, y=conc, line=ID))
E) geom_line(col=ID)
facet_wrap(vars(ID))
Why is the function ‘==’ used
it is needed when using code to look for something being exactly a specific value.
You need 2 because it then allows for reasonable alternatives like >=.
τ vs T
τ refers to a dosing interval
AUC_(0-τ) is the AUC from time = 0 to time = τ (τ is just before the next dose is given/0
whereas AUC_(0-T)is any time duration (usually duration of the study)
How to isolate a participant in a dataset?
Aamox<-amox%>%
subset(ID==’A’)
What is the advantage of the logarithmic over the linear method in estimating AUC?
Improved accuracy of AUC estimation for absorption phase
Improved accuracy of AUC estimation
Improved accuracy of AUC estimation in elimination phase
Improved accuracy of AUC estimation at steady state
Improved accuracy of AUC estimation for a continuous infusion
Improved accuracy of AUC estimation in elimination phase
This choice is correct because the logarithmic trapezoidal method more accurately models the exponential decay associated with drug elimination from the body. Unlike the linear trapezoidal method, which assumes a straight-line change between points and can overestimate AUC during rapid changes in concentration, the logarithmic method aligns better with the natural log-linear pharmacokinetics seen during the elimination phase, providing a more precise estimate of AUC under these conditions.
At steady state AUC =
AUC_(0-τ)=AUC_(0-∞)
Define Bioavailability (F)
Fraction of dose that reaches the systemic circulation unchanged
Formula for estimating bioavailability
F= 〖AUC〗(oral,0-∞)/〖AUC〗(iv,0-∞)
how to add a new column(variable) when undertaking non-compartmental analysis (PKNCA)
use %>% and mutate() function
damox<-amox%>% #save this as a new object
subset (time==0)%>%
mutate(dose=1000) #this produces a new variable dose = 1000
estimating clearance using AUC0−∞
CL = Dose/〖AUC〗_(0-∞)