View source: R/bru.inference.R
bru_index | R Documentation |
Extract the index vector for a
bru_obs()
predictor,
or the whole or a subset of a full bru()
predictor.
bru_index(object, ...)
## S3 method for class 'bru_like'
bru_index(object, what = NULL, ...)
## S3 method for class 'bru'
bru_index(object, tag = NULL, what = NULL, ...)
object |
A |
... |
Arguments passed on to sub-methods. |
what |
|
tag |
|
An integer
vector.
bru_index(bru_like)
: Extract the index vector for the predictor vector for a
bru_obs()
sub-model. The indices are relative to the sub-model, and need
to be appropriately offset to be used in the full model predictor.
bru_index(bru)
: Extract the index vector for "APredictor" for one or
more specified observation bru_obs()
sub-models. Accepts any combination
of tag
and what
.
fit <- bru(
~ 0 + x,
bru_obs(
y ~ .,
data = data.frame(x = 1:3, y = 1:3 + rnorm(3)),
tag = "A"
),
bru_obs(
y ~ .,
data = data.frame(x = 1:4, y = c(NA, NA, 3:4) + rnorm(4)),
tag = "B"
)
)
bru_index(fit)
bru_index(fit, "A")
bru_index(fit, "B")
bru_index(fit, c("B", "A"))
bru_index(fit, what = "missing")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.