enrich.betareg: Enrich objects of class betareg

Description Usage Arguments Details Value Examples

Description

Enrich objects of class betareg with any or all of a set of auxiliary functions, the expected information at the maximum likelihood estimator, and the first term in the expansion of the bias of the maximum likelihood estimator.

Usage

1
2
## S3 method for class 'betareg'
enrich(object, with = "all", ...)

Arguments

object

an object of class betareg

with

a character vector of options for the enrichment of object

...

extra arguments to be passed to the compute_* functions

Details

The auxiliary_functions component consists of any or all of the following functions:

Value

The object object of class betareg with extra components. get_enrichment_options.betareg() returns the components and their descriptions.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
## Not run: 
if (require("betareg")) {

   data("GasolineYield", package = "betareg")
   gy <- betareg(yield ~ batch + temp, data = GasolineYield)

   # Get a function that evaluates the expected information for gy at supplied parameter values
   gy_info <- get_information_function(gy)
.   # compare standard errors with what `summary` returns
   all.equal(sqrt(diag(solve(gy_info())))[1:11],
             coef(summary(gy))$mean[, 2], check.attributes = FALSE)
.   # evaluating at different parameter values
   gy_info(rep(1, length = 12))

   # Get a function that evaluates the first-order bias of gy at supplied parameter values
   gy_bias <- get_bias_function(gy)
   # compare with internal betareg implementation of bias correction
   gy_bc <- update(gy, type = "BC")
   all.equal(gy_bias(coef(gy)), gy_bc$bias, check.attributes = FALSE)

 }

## End(Not run)

enrichwith documentation built on Nov. 17, 2017, 4 a.m.