LMlike-class: Linear Model-like Class

LMlike-classR Documentation

Linear Model-like Class

Description

Wrapper around modeling function to make them behave enough alike that Wald tests and Likelihood ratio are easy to do. To implement a new type of zero-inflated model, extend this class. Depending on how different the method is, you will definitely need to override the fit method, and possibly the model.matrix, model.matrix<-, update, coef, vcov, and logLik methods.

Usage

## S4 method for signature 'LMlike'
summary(object)

## S4 method for signature 'LMlike'
update(object, formula., design, keepDefaultCoef = FALSE, ...)

## S4 method for signature 'LMlike,CoefficientHypothesis'
waldTest(object, hypothesis)

## S4 method for signature 'LMlike,matrix'
waldTest(object, hypothesis)

## S4 method for signature 'LMlike,character'
lrTest(object, hypothesis)

## S4 method for signature 'LMlike,CoefficientHypothesis'
lrTest(object, hypothesis)

## S4 method for signature 'LMlike,Hypothesis'
lrTest(object, hypothesis)

## S4 method for signature 'LMlike,matrix'
lrTest(object, hypothesis)

## S4 method for signature 'GLMlike'
logLik(object)

Arguments

object

LMlike

formula.

formula

design

something coercible to a data.frame

keepDefaultCoef

logical. Should the coefficient names be preserved from object or updated if the model matrix has changed?

...

passed to model.matrix

hypothesis

one of a CoefficientHypothesis, Hypothesis or contrast matrix.

Value

see section "Methods (by generic)"

Methods (by generic)

  • summary(LMlike): Print a summary of the coefficients in each component.

  • update(LMlike): update the formula or design from which the model.matrix is constructed

  • waldTest(object = LMlike, hypothesis = CoefficientHypothesis): Wald test dropping single term specified by CoefficientHypothesis hypothesis

  • waldTest(object = LMlike, hypothesis = matrix): Wald test of contrast specified by contrast matrix hypothesis

  • lrTest(object = LMlike, hypothesis = character): Likelihood ratio test dropping entire term specified by character hypothesis naming a term in the symbolic formula.

  • lrTest(object = LMlike, hypothesis = CoefficientHypothesis): Likelihood ratio test dropping single term specified by CoefficientHypothesis hypothesis

  • lrTest(object = LMlike, hypothesis = Hypothesis): Likelihood ratio test dropping single term specified by Hypothesis hypothesis

  • lrTest(object = LMlike, hypothesis = matrix): Likelihood ratio test dropping single term specified by contrast matrix hypothesis

  • logLik(GLMlike): return the log-likelihood of a fitted model

Slots

design

a data.frame from which variables are taken for the right hand side of the regression

fitC

The continuous fit

fitD

The discrete fit

response

The left hand side of the regression

fitted

A logical with components "C" and "D", TRUE if the respective component has converged

formula

A formula for the regression

fitArgsC
fitArgsD

Both lists giving arguments that will be passed to the fitter (such as convergence criteria or case weights)

See Also

coef

lrTest

waldTest

vcov

logLik


RGLab/MAST documentation built on Sept. 30, 2023, 1:08 p.m.