Dear List,
I am having problems running stepAIC with a negative binomial regression
model. I am working with data on manta ray abundance, using 20 predictor
variables. Predictors include variables for location (site), time (year, cos
and sin of calendar day, length of day, percent lunar illumination),
oceanography (sea surface temp mean and std, sea surface height mean and std),
weather (cos wind direction, sin wind direction, wind speed, temperature,
barometric pressure), and tides (dummy variables for high, falling, low, and
rising). So predictors are binary, categorical, and continuous variables. I
ran glm.nb to fit my full model containing all first order terms. The model I
ran was:
glm.nb.full<glm.nb(mantas~site+year+cosday+sinday+daylength+lunarpercent+sstmean+sststd+
sshmean+sshstd+cosdir+sindir+spd+temp+alt+tideht+high+falling+low+plankton)
However, when I use stepAIC on the model I get the message:
> stepAIC(glm.nb.full)
Start: AIC=19240.46
mantas ~ site + year + cosday + sinday + daylength + lunarpercent +
sstmean + sststd + sshmean + sshstd + cosdir + sindir + spd +
temp + alt + tideht + high + falling + low + plankton
Error in dropterm.default(object, ...) :
number of rows in use has changed: remove missing values?
I know some of my predictors are missing values for certain dates. I assume
this is what number of rows in use has changed means. Must I remove all rows
that are missing values? Or is there an option that does this for me? Or am I
completely off and there is something else going on? This is my first time
using R for statistics, so I am not sure if this is a mistake with my data or
with my use of R. I would appreciate any insight into what I am doing wrong.
Thanks,
Tim
Tim Clark
PhD Candidate
Department of Zoology
University of Hawaii
Honolulu, HI 96816
[[alternative HTML version deleted]]
______________________________________________
[email protected] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.