"(lm|glm|nls|lmer)Resp"
lmResp-class.Rd
Reference classes for response modules, including linear
models, "lmResp"
, generalized linear models,
"glmResp"
, nonlinear models, "nlsResp"
and
linear mixed-effects models, "lmerResp"
. Each
reference class is associated with a C++ class of the
same name. As is customary, the generator object for
each class has the same name as the class.
All reference classes extend and inherit methods from
"envRefClass"
. Furthermore,
"glmResp"
, "nlsResp"
and "lmerResp"
all extend the "lmResp"
class.
Objects from these reference classes correspond to
objects in C++ classes. Methods are invoked on the C++
classes using the external pointer in the ptr
field. When saving such an object the external pointer
is converted to a null pointer, which is why there are
redundant fields containing enough information as R
objects to be able to regenerate the C++ object. The
convention is that a field whose name begins with an
upper-case letter is an R object and the corresponding
field whose name begins with the lower-case letter is a
method. Access to the external pointer should be through
the method, not through the field.
showClass("lmResp")
#> Class "lmResp" [package "lme4"]
#>
#> Slots:
#>
#> Name: .xData
#> Class: environment
#>
#> Extends:
#> Class "envRefClass", directly
#> Class ".environment", by class "envRefClass", distance 2
#> Class "refClass", by class "envRefClass", distance 2
#> Class "environment", by class "envRefClass", distance 3, with explicit coerce
#> Class "refObject", by class "envRefClass", distance 3
#>
#> Known Subclasses: "lmerResp", "glmResp", "nlsResp"
str(lmResp$new(y=1:4))
#> Reference class 'lmResp' [package "lme4"] with 8 fields
#> $ Ptr :<externalptr>
#> $ mu : num [1:4] 0 0 0 0
#> $ offset : num [1:4] 0 0 0 0
#> $ sqrtXwt: num [1:4] 1 1 1 1
#> $ sqrtrwt: num [1:4] 1 1 1 1
#> $ weights: num [1:4] 1 1 1 1
#> $ wtres : num [1:4] 1 2 3 4
#> $ y : num [1:4] 1 2 3 4
#> and 24 methods, of which 10 are possibly relevant:
#> allInfo, copy#envRefClass, initialize, initializePtr, ptr, setOffset,
#> setResp, setWeights, updateMu, wrss
showClass("glmResp")
#> Class "glmResp" [package "lme4"]
#>
#> Slots:
#>
#> Name: .xData
#> Class: environment
#>
#> Extends:
#> Class "lmResp", directly
#> Class "envRefClass", by class "lmResp", distance 2
#> Class ".environment", by class "lmResp", distance 3
#> Class "refClass", by class "lmResp", distance 3
#> Class "environment", by class "lmResp", distance 4, with explicit coerce
#> Class "refObject", by class "lmResp", distance 4
str(glmResp$new(family=poisson(), y=1:4))
#> Reference class 'glmResp' [package "lme4"] with 11 fields
#> $ Ptr :<externalptr>
#> $ mu : num [1:4] 0 0 0 0
#> $ offset : num [1:4] 0 0 0 0
#> $ sqrtXwt: num [1:4] 1 1 1 1
#> $ sqrtrwt: num [1:4] 1 1 1 1
#> $ weights: num [1:4] 1 1 1 1
#> $ wtres : num [1:4] 1 2 3 4
#> $ y : num [1:4] 1 2 3 4
#> $ eta : num [1:4] 0 0 0 0
#> $ family :List of 13
#> ..$ family : chr "poisson"
#> ..$ link : chr "log"
#> ..$ linkfun :function (mu)
#> ..$ linkinv :function (eta)
#> ..$ variance :function (mu)
#> ..$ dev.resids:function (y, mu, wt)
#> ..$ aic :function (y, n, mu, wt, dev)
#> ..$ mu.eta :function (eta)
#> ..$ initialize: expression({ if (any(y < 0)) stop("negative values not allowed for the 'Poisson' family") n <- rep.int(1, nobs| __truncated__
#> ..$ validmu :function (mu)
#> ..$ valideta :function (eta)
#> ..$ simulate :function (object, nsim)
#> ..$ dispersion: num 1
#> ..- attr(*, "class")= chr "family"
#> $ n : num [1:4] 1 1 1 1
#> and 43 methods, of which 29 are possibly relevant:
#> Laplace, aic, allInfo, allInfo#lmResp, copy#envRefClass, devResid, fam,
#> initialize, initialize#lmResp, initializePtr, link, muEta, ptr, ptr#lmResp,
#> resDev, setOffset, setResp, setTheta, setWeights, sqrtWrkWt, theta,
#> updateMu, updateMu#lmResp, updateWts, variance, wrkResids, wrkResp, wrss,
#> wtWrkResp
showClass("nlsResp")
#> Class "nlsResp" [package "lme4"]
#>
#> Slots:
#>
#> Name: .xData
#> Class: environment
#>
#> Extends:
#> Class "lmResp", directly
#> Class "envRefClass", by class "lmResp", distance 2
#> Class ".environment", by class "lmResp", distance 3
#> Class "refClass", by class "lmResp", distance 3
#> Class "environment", by class "lmResp", distance 4, with explicit coerce
#> Class "refObject", by class "lmResp", distance 4
showClass("lmerResp")
#> Class "lmerResp" [package "lme4"]
#>
#> Slots:
#>
#> Name: .xData
#> Class: environment
#>
#> Extends:
#> Class "lmResp", directly
#> Class "envRefClass", by class "lmResp", distance 2
#> Class ".environment", by class "lmResp", distance 3
#> Class "refClass", by class "lmResp", distance 3
#> Class "environment", by class "lmResp", distance 4, with explicit coerce
#> Class "refObject", by class "lmResp", distance 4
str(lmerResp$new(y=1:4))
#> Reference class 'lmerResp' [package "lme4"] with 9 fields
#> $ Ptr :<externalptr>
#> $ mu : num [1:4] 0 0 0 0
#> $ offset : num [1:4] 0 0 0 0
#> $ sqrtXwt: num [1:4] 1 1 1 1
#> $ sqrtrwt: num [1:4] 1 1 1 1
#> $ weights: num [1:4] 1 1 1 1
#> $ wtres : num [1:4] 1 2 3 4
#> $ y : num [1:4] 1 2 3 4
#> $ REML : int 0
#> and 28 methods, of which 14 are possibly relevant:
#> allInfo, copy#envRefClass, initialize, initialize#lmResp, initializePtr,
#> initializePtr#lmResp, objective, ptr, ptr#lmResp, setOffset, setResp,
#> setWeights, updateMu, wrss