Learn R Programming

mpcmp (version 0.3.6)

update.cmp: Update and Re-fit a COM-Poisson Model

Description

update (i.e., update.cmp) will update and (by-default) re-fit a model. It is identical to update in the stats package.

Usage

# S3 method for cmp
update(object, formula., formula_nu., ..., evaluate = TRUE)

Arguments

object

an object class 'cmp', obtained from a call to glm.cmp.

formula.

changes to the existing formula in object -- see update.formula

formula_nu.

changes to the existing formula_nu in object -- see update.formula for details. It also accepts NULL to not regressing on the dispersion.

...

other arguments passed to or from other methods (currently unused).

evaluate

logical; if TRUE evaluate the new call otherwise simply return the call

See Also

glm.cmp, update.formula, cmplrtest.

Examples

Run this code
# NOT RUN {
# To update the mean regression formula
data(takeoverbids)

## Fit full model 
M.bids.full <- glm.cmp(numbids ~ leglrest + rearest + finrest + whtknght 
    + bidprem + insthold + size + sizesq + regulatn, data=takeoverbids)
M.bids.full
        
## Dropping whtknght
M.bids.null <- update(M.bids.full, .~.-whtknght)
M.bids.null

## To update the dispersion regression formula
data(sitophilus)

## Fit full model 
M.sit.full <- glm.cmp(formula = ninsect ~ extract, formula_nu = ~extract, data = sitophilus)
M.sit.full
        
## Dropping extract from the dispersion regression
M.sit.null1 <- update(M.sit.full, formula_nu =  ~.-extract)
M.sit.null1

## To not regress on the dispersion at all
M.sit.null2 <- update(M.sit.full, formula_nu = NULL)
M.sit.null2
# }

Run the code above in your browser using DataLab