predict.negBinMod: predict

Description Usage Arguments Details Value Authors Examples

Description

Predict values for N and E(N) given a model for N and new covariates.

Usage

1
2
3
## S3 method for class 'negBinMod'
## S3 method for class 'negBinMod'
predict(object,new.obs,offset=1,...)

Arguments

object

a fitted model from negBinMod, of class negBinMod.

new.obs

new covariates used to predict N. Must contain the same names as in the formula for negBinMod

offset

Predict sample for an area of this dimension

...

additional arguments to be passed to predict

Details

Uses mvtnorm to obtain new parameters for the glm using calculated variance-covariance matrix, assuming multivariate normal for parameters.

new.obs will be automatically scaled using details in model.N if scale.covar==TRUE

Value

N

predicted N

expect.N

expected N

Authors

Piers Dunstan and Scott Foster

Examples

1
2
3
4
5
N.form <- N~1  + depth + O2_AV + temp_AV + offset(log(area))
model.N <- negBinMod(N.form,data=fish.data,est.var=TRUE,scale.covar =FALSE)
N.pred <- rep(NA,100)
for(n in 1:100) N.pred[n] <- predict(model.N,fish.data[5,],offset=10)$N
hist(N.pred)

RAD documentation built on May 2, 2019, 9:36 a.m.

Related to predict.negBinMod in RAD...