# NOT RUN {
# view lamprey_tox data
head(lamprey_tox)
# using glm() to detemine LC values using probit model for May and June
m <- glm((response / total) ~ log10(dose),
data = lamprey_tox[lamprey_tox$nominal_dose != 0, ],
subset = c(month == "May"),
weights = total,
family = binomial(link = "probit"))
j <- glm((response / total) ~ log10(dose),
data = lamprey_tox[lamprey_tox$nominal_dose != 0, ],
subset = c(month == "June"),
weights = total,
family = binomial(link = "probit"))
# now that both May and June models have been made. use ratio_test to
# compare LC50 values or whatever LC values of interest.
ratios <- ratio_test(model_1 = m, model_2 = j, percentage = 50,
compare = "May - June")
# view ratio test results
ratios
# you can also use LC_probit to create the models and use ratio test
m_1 <- LC_probit((response / total) ~ log10(dose), p = c(50, 99),
weights = total,
data = lamprey_tox[lamprey_tox$nominal_dose != 0, ],
subset = c(month == "May"))
j_1 <- LC_probit((response / total) ~ log10(dose), p = c(50, 99),
weights = total,
data = lamprey_tox[lamprey_tox$nominal_dose != 0, ],
subset = c(month == "June"))
ratios_2 <- ratio_test(model_1 = m_1, model_2 = j_1, percentage = 50,
compare = "May - June", obj_type = "df")
ratios_2
# }
Run the code above in your browser using DataLab