Hi. I am trying to model the visits of pollinators to sunflower heads in a field experiment. My response variable is the number of insect visits in 15' periods looking at a variable number of flower heads at a time. The experiment includes three sunflower hybrids. Samples were taken at three distances from the field margin (2, 20 and 100m). There are two complete blocks in the experiment. I added the number of flower heads as an offset variable as they varied among samples.
Here is a workable code: require(RCurl) #need this to download data from Google Drive my.file <- getURL(" https://docs.google.com/spreadsheets/d/e/2PACX-1vQq-Clbksm1S3Qq2_V9FBuEfUVno11Dytk0v9eJ2j7e7FpXHYqigaqJlcTyt5u2ipfVUjrKbAFL294e/pub?output=csv ") sunflower_data <- read.csv(textConnection(my.file), head=T) str(sunflower_data) model1 <- glm(visits ~ offset(cap) + block + hybrid + distance, family=poisson, data=sunflower_data) summary(model1) plot(model1) #First diagnostic plot suggests residuals have a trend #Other diagnostic plots suggest observation #35 is too influential, so... model2 <- glm(visits ~ offset(cap) + block + hybrid + distance, family=poisson, data=sunflower_data[-35,]) summary(model2) plot(model2) #things look a bit better, but residuals in diagnostic plot #1 still show a trend. What should I try next? Any advice is much appreciated. Mariano *Dr. Mariano Devoto* Profesor Adjunto - Cátedra de Botánica General, Facultad de Agronomía de la UBA Investigador Adjunto del CONICET Av. San Martín 4453 - C1417DSE - C. A. de Buenos Aires - Argentina +5411 4524-8069 *https://www.researchgate.net/profile/Mariano_Devoto <https://www.researchgate.net/profile/Mariano_Devoto>* <http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail> Libre de virus. www.avg.com <http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail> <#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2> [[alternative HTML version deleted]] _______________________________________________ R-sig-ecology mailing list R-sig-ecology@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-ecology