I am quite new to R. I gathered data about parasite infection in insects from many references, in which it follows 3 parameters logistic function, with x=parasite count (in concentration), y = proportion of infected insects (consisting of various numbers of infected/total dissected).
Is that a possibility that I got the equation weighted by the various numbers of total dissected (the more they dissect the insect, the result is more reliable and important)?
Something like using optim, lme, or lmne packages in R?
My data looked like this:
> dat <- read_excel('Data.xlsx') %>%
+ # view() %>%
+ glimpse()
Rows: 158
Columns: 15
$ Reference <chr> "(Bryan & Southgate, 1988…
$ Parasite_count_per_1uL <dbl> 0.9313223, 1.0464999, 1.1…
$ Insect_totaldissected <dbl> 30, 50, 20, 36, 32, 40, 3…
$ Insect_infected_count <dbl> 1, 4, 3, 7, 3, 6, 2…
$ Insect_larvae_infected_proportion_fromtotaldissected <dbl> etc...
I did try nlme but I don't want to group the parasite count, it will make such a huge data loss in details. What I want to do is create a model (get the 3 parameters based on the data fitting) and weight it based on Insect_totaldissected.
library(nlme)
# 3 params model are choosen based on visual interpretations by using SSlogis()
model_sslogis <- nls(Insect_larvae_infected_proportion_fromtotaldissected ~ SSlogis(Parasite_count_per_1uL, A, B, C),
data = dat,
algorithm = "port",
# weights = 1/sd_Insect_larvae_infected
)
summary(model_sslogis)
Instead of modelling the proportions, you could model the counts: