visreg changes y-axis to a scale other than my original

495 Views Asked by At

I'm studying the effects of some variables in the number of days a bird species stays in my study area and the distribution is negative binomial, so my question is simply "Which morphological traits affect the number of days the birds are staying at the study site?". I used MASS package and the model is mod1=glm.nb(days ~ age + sex + weight + fat + muscle, data=DATA) .

I have a problem in which visreg changes my Y axis to a scale other than my original. I tried scale= "response" but for some reason my Y axis (with the response variable being days) goes to 60 and no bird stayed more than 30 days at the site. I'll use an example below with the variable "age" (which is categorical, divided into adult and young but that is not important, just for context).

This graph was made by the codeline visreg(mod1, "age", partial= TRUE). Not what I want, I want my original response variable scale (1 to 30 days).

enter image description here

So I tried visreg(mod1, "age", partial= TRUE, scale="response") and I ended up with this, which it doesn't make any sense since no bird stayed for 60 days.

enter image description here

What am I doing wrong and what are those y-axis scales? Should I not even be using visreg to start with? Thanks for anyone who can help!

0

There are 0 best solutions below