How to define EC50 and R squares?

60 Views Asked by At

I have a data set as df:

df <- data.frame(
Cases = rep(c("A", "B"), each = 8),
X = c(555.00, 138.75, 34.69, 8.67, 2.17, 0.54, 0.14, 0.03,
      555.00, 138.75, 34.69, 8.67, 2.17, 0.54, 0.14, 0.03),
Y = c(2.00000000, 1.98330401, 1.45089675, 0.84291381,
      0.26096319, -0.36891128, -0.97322417, -1.11918641,
      2.00000000, 1.66883963, 1.12614594, 0.59530173,
      0.03225888, -0.53884787, -1.07051066, -1.11918641),
cut_off = rep(0.4404068, 16)
)

how can I calculate EC50/IC50 (what is X value when curve cut the cut_off or -the concentration that provokes a response half way between the basal (Bottom) response and the maximal (Top) response) and quantify the goodness of fit using R squred for each Cases in R, by considering the below criteria in the model:

  • Fitting method: Least squares regression
  • Maximum iterations : 1000
  • Weighting method: no weighting
  • Standard curve to interpolate: Sigmoidal 4PL and X is the concentration
  • Bottom: minimum Y for each Cases
  • Top: Maximum Y for each Cases

I have the below code but doesn't give me the exact EC50: (For example: when I do calculations using GraphPad the EC50 is 3.4 and 6.18 for A and B cases respectively, while using this code is 3.3 and 6.75)

df_list <- split(df, df$Cases)

calculate_EC50 <- function(data) {
model <- drm(Y ~ X, data = data, fct = LL.4())
EC50 <- ED(model, 50, interval = "delta")
return(EC50)
 }

EC50_values <- lapply(df_list, calculate_EC50)
0

There are 0 best solutions below