Reputation: 23
I have count data for an ungulate species from two sites (here made up for the question). I want to know how to showcase results of categorical variable in this analysis. I first thought the graph I am getting have incidence rate ratios, but then they were all too high and always positive on Y-axis, which made me think I am doing something definitely wrong. This is what I did, and I would really appreciate the help in this regard
Aspect<-as.factor(c("NW","S","NW","SW","SE","N","NE","N","NE","NE","NW","N","N","N","N","N","NW","SE","SE","SE","SE","N"))
Predator<-as.factor(c("Yes","Yes","Yes","Yes","Yes","Yes","Yes","No","No","Yes","Yes","No","No","No","Yes","Yes","Yes","No","No","Yes","No","Yes"))
Count<-c(53,62,52,51,63,61,65,74,75,70,68,96,85,77,72,69,85,97,96,95,100,83)
Location<-c("Q1","Q1","Q1","Q1","Q1","Q1","Q1","Q1","Q1","Q1","Q1","Q2","Q2","Q2","Q2","Q2","Q2","Q2","Q2","Q2","Q2","Q2")
data<-data.frame(Aspect,Predator,Count,Location)
glm1<-glmer.nb(Count~Aspect+Predator + (1|Location), data=data)
summary(glm1)
Now when I try to plot a graph for the categorical variables, this is how it comes
library(ggplot2)
cat_plot(glm1, pred = "Aspect", int.type = "confidence", outcome.scale = "link",
line.thickness = 0.5,pred.point.size = 2.5, errorbar.width = 0.1,
main.title = "Animal counts",x.label = "Aspect", y.label = "Incidence Rate Ratios") + geom_point(color = "black") + ylim(3.5,5) +theme(text=element_text(size=8))+theme(plot.title = element_text(size=8.5))+
geom_abline(intercept = 4.343293, slope = 0, color = "black", linetype = "longdash")
cat_plot(glm1, pred = "Predator", int.type = "confidence", outcome.scale = "link",
line.thickness = 0.5,pred.point.size = 2.5, errorbar.width = 0.1,
main.title = "Animal counts",x.label = "Aspect", y.label = "Incidence Rate Ratios") +
geom_point(color = "black") + ylim(3.5,5) +theme(text=element_text(size=8))+theme(plot.title = element_text(size=8.5))+
geom_abline(intercept = 4.343293, slope = 0, color = "black", linetype = "longdash")
I want to know how to interpret the results because even though the intercept is the same as the glm1 results, the "SE" Aspect is not significant in the plot. Similarly, Predator presence "Yes" is also not significant in the plot. Am I doing this right? Am I supposed to plot it this way or it is plotted some other way with categorical variables? If this is the correct way, how do I interpret it? I would really appreciate the help.
Upvotes: 1
Views: 86