AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |
Back to Blog
Ggplot2 scatter plot with regression7/30/2023 ![]() ![]() "CONTROL", "CONTROL", "LOW", "CONTROL", "CONTROL", "CONTROL", "CONTROL", "CONTROL", "CONTROL", "CONTROL", "CONTROL", "CONTROL", Labs(x="Temperature (☌)", y="Hatching succeess")+ Myplot <- ggplot(mydata, aes(y=cbind(Success, Failure), x=Temperature, group=Pesticide, color=Pesticide)) + If i plot the raw data (0/1 response for each egg, instead of the proportion of an egg clutch that successfully hatched) I get the datapoints, but then i dont manage to add the regression, and also not sure if it is correct. I want to make a scatterplot of the datapoints with a regression line from the glm (one line per pesticide treatment (three), in different colours. I have hatching success data from an experiment exposing an invertebrate to a pesticide at different temperatures. Temperature*Pesticide, data=mydata, family=binomial(link="logit")) Is it possible to make a scatterplot that fits this model? mymodel <- glm(cbind(Success,Failure) ~ Temperature + Pesticide +
0 Comments
Read More
Leave a Reply. |