| categorical_bugs | R Documentation |
Bugs code for Categorical response
categorical_bugs(
nodename,
nodesCatIdx,
parentnames,
nodesintercepts,
parentcoefs
)
categorical_bugsGroup(
nodename,
nodesCatIdx,
nodesintercepts,
parentnames,
parentcoefs,
sigma,
sigma_alpha
)
nodename |
character string of response variable name. |
nodesCatIdx |
integer vector of length |
parentnames |
single character string (for one parent) or vector of characters (for multiple parent nodes) with parent node (predictor variables) names. |
nodesintercepts |
overall mean of response. Parameter from fixed-effects intercept. |
parentcoefs |
overall slope for each predictor (parent node) variable (fixed-effects). |
sigma |
within-group variance. Parameter from random-effects residual. |
sigma_alpha |
between-group variance-covariance matrix. Parameters from random-effects intercept. |
The output of fitAbn with method = "mle" is based on
the output of logistic regression models fit with either lm,
glm, glmer, multinom,
mblogit or internal irls methods.
They all use the first factor level as reference level.
Therefore, nodesCatIdx starts with index 2 and not 1.
nodesintercepts and parentcoefs refer to the values of
(Intercept) and Estimate of the respective model output.
Predictor names build the keys in parentcoef.
Bugs model returned as stdout.
categorical_bugsGroup(): Bugs code for Categorical response with varying intercept
makebugs simulateAbn
# A -> B
# Where B is a categorical variable with 4 levels.
categorical_bugs(nodename = "b",
nodesCatIdx = c(2, 3, 4),
parentnames = "a",
nodesintercepts = c(2.188650, 3.133928, 3.138531),
parentcoefs = list("a"=c(a=1.686432, a=3.134161, a=5.052104)))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.