Description Usage Arguments Examples
This function uses a binomial GAM and a log-normal GAM to compute a delta-lognormal index of abundance with associated 95 strapping the data. A dummy variable for year must be included to get the annual abundance index. The function back-transforms the index and the CI's.
1 2 | ## S3 method for class 'gam.bindex'
predict(pa.model, cpue.model, boot_reps = 500)
|
pa.model |
binomial GAM predicting presence or absence |
cpue.model |
log-normal GAM predicting abundance where catch is positive |
boot_reps |
number of bootstrap replications (default = 500) |
1 2 3 4 5 6 7 8 9 10 11 12 | gam.pa.xvars<-c("inverts","slope","btemp","bdepth")
gam.pa.yvar<-ifelse(PA.data[species.name]>0,1,0)
gam.pa.form <- as.formula(paste("gam.pa.yvar ~", paste(gam.pa.xvars,collapse="+"),"+as.factor(year)",sep=""))
pa.gam <- gam(gam.pa.form, family = binomial, data = PA.data)
CPUE.data<-subset(PA.data,PA.data[species.name]>0)
gam.cpue.yvar<-unlist(log(CPUE.data[species.name]))
gam.cpue.xvars<-c("inverts","slope","btemp","bdepth")
gam.cpue.form <- as.formula(paste("gam.cpue.yvar ~", paste(gam.cpue.xvars,collapse="+"),"+as.factor(year)",sep=""))
cpue.gam <- gam(gam.cpue.form, family = gaussian, data = CPUE.data)
predict.gam.bindex(pa.gam,cpue.gam)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.