familyWALS | R Documentation |
Objects of class "familyWALS"
inherit from "family"
and extend those with (transformation) functions required for
walsGLM
and walsNB
.
familyWALS(object, ...)
poissonWALS(link = "log")
binomialWALS(link = "logit")
negbinFixedWALS(scale, link)
negbinWALS(scale, link)
## S3 method for class 'walsGLM'
familyWALS(object, ...)
object |
The function |
... |
Further arguments passed to methods. The |
link |
Specifies the model link function. Typically a character string
or an object of class |
scale |
dispersion parameter of NB2 to be used, always larger than 0. |
familyWALS()
is a generic function that extracts the family used in
"walsGLM"
objects.
negbinFixedWALS()
creates the "familyWALS"
object for negative
binomial distribution type 2 (NB2) with fixed dispersion parameter. It extends
negativeBinomial
.
negbinWALS()
creates objects of the specialized class "familyNBWALS"
which inherits from "familyWALS"
and "family"
. It constructs the
"familyNBWALS"
object for the negative binomial distribution type 2 (NB2)
with variable dispersion parameter by extending negativeBinomial
and negbinFixedWALS
with functions required in walsNB.
negbinWALS
should only be used in walsNBfit
and
not in walsGLM
because the NB2 with variable dispersion
parameter is not a GLM!
Currently, binomialWALS()
and poissonWALS()
only support their
canonical links, i.e. "logit"
and "log"
, respectively.
negbinFixedWALS()
supports both, the "canonical"
link and
the "log"
link, however, the first is not recommended due to numerical
difficulties in the fitting process. In contrast, negbinWALS()
only
supports the "log"
link.
An object of class "familyWALS"
to be used in
walsGLM
that inherits from "family"
.
This is a list that contains elements returned from the corresponding family
function that it extends. Additionally, the following elements are available:
theta.eta |
function. Derivative of the canonical parameter |
psi |
function. |
initializeY |
function. Preprocesses the response, e.g. in
|
transformY |
function. Transforms the response to |
transformX |
function. Transforms the regressors to |
density |
function. The probability density/mass function of the family. |
poissonWALS()
and negbinFixedWALS()
return objects of class
"familyWALScount"
that inherit from "familyWALS"
and
"family"
. These are lists that contain the same elements as
"familyWALS"
objects described above.
negbinWALS()
creates an object of class "familyNBWALS"
(only used internally in walsNB
) that inherits from
"familyWALScount"
, "familyWALS"
and "family"
.
This is a list that contains all elements returned from negbinFixed
and the elements described above for objects of class "familyWALS"
.
Additionally contains the following elements with functions required in
walsNB
that are described in
\insertCitehuynhwalsnbWALS:
q |
function. Computes |
g |
function. Computes |
transformY0 |
function. Computes |
t |
function. Computes |
epsilon |
function. Computes |
epsiloninv |
function. Computes |
kappaSum |
function. Computes |
computeAlpha |
function. Computes the log-dispersion parameter
|
family, walsGLM.
## Use in walsGLM():
data("NMES1988", package = "AER")
NMES1988 <- na.omit(NMES1988)
fitPoisson <- walsGLM(emergency ~ health + chronic + age + gender |
I((age^2)/10) + married + region, family = poissonWALS(),
data = NMES1988, prior = laplace())
summary(fitPoisson)
## Plot derivatives of binomialWALS() with default 'logit' link:
bi <- binomialWALS()
plot(bi$mu.eta, from = -10, to = 10)
plot(bi$theta.eta, from = -10, to = 10) # constant. logit is canonical link
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.