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

Description Usage Arguments See Also Examples

View source: R/Inference.R

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

1
2
## S3 method for class '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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# 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

mpcmp documentation built on Oct. 26, 2020, 9:07 a.m.