# Example I: Single increasing curve (Emax)
df_emax <- data.frame(
dose = c(0.1, 0.3, 1, 3, 10, 30, 100),
response = c(5, 12, 28, 55, 75, 90, 98)
)
logistic_4pl(
data = df_emax,
dose_col = "dose",
response_col = "response"
)
# Example II: Single decreasing curve (Imax)
df_imax <- data.frame(
dose = c(0.1, 0.3, 1, 3, 10, 30, 100),
response = c(95, 88, 70, 50, 30, 15, 5)
)
logistic_4pl(
data = df_imax,
dose_col = "dose",
response_col = "response"
)
# Example III: Two treatment groups, mixed Emax/Imax
df_groups <- data.frame(
dose = rep(c(0.1, 0.3, 1, 3, 10, 30), 2),
response = c(
4, 10, 25, 55, 78, 92, # Group A: increasing (Emax)
90, 75, 55, 35, 20, 10 # Group B: decreasing (Imax)
),
treatment = rep(c("Group A", "Group B"), each = 6)
)
logistic_4pl(
data = df_groups,
dose_col = "dose",
response_col = "response",
group_col = "treatment",
log_dose = TRUE
)
Run the code above in your browser using DataLab