Description Usage Arguments Details Value Author(s) See Also Examples

Special terms for formulas assigned to `tvcm`

,
`fvcm`

and `olmm`

.

1 2 3 4 5 |

`formula` |
a symbolic description for the corresponding component of the formula component. See examples. |

`intercept` |
logical or character vector. |

`...` |
the names of variables that moderate (i.e. modify) the
effects of the variables specified in |

`by` |
a formula of predictors the effects of which are moderated
by the variables in |

`nuisance` |
character vector of variables in |

Special formula terms to define fixed effects `fe`

,
varying coefficients `vc`

and random effects
`re`

. The use of these formula terms ensures that
the functions `fvcm`

, `tvcm`

and
`olmm`

fit the intended model. Some examples are given
below and on the documentation pages of the fitting functions.

For all of `fvcm`

, `tvcm`

and
`olmm`

, variables which are not defined with one of
`fe`

, `vc`

and `re`

are
treated as fixed effects. Intercepts can be dropped from the model by
the `intercept`

argument. The terms `ce`

(category-specific effects) and `ge`

(global effect or
proportional odds effect) are designed for the function
`olmm`

. Notice that `tvcm`

may changes,
for internal reasons, the order of the terms in the specified
formula. Note that you can put multiple terms within
`fe`

, `ge`

and `ce`

terms
(e.g., `fe(ce(x1 + x2 + ge(x3 + x4))`

).

At present, the term `"."`

, which is often use to extract all
variables of the data, is ignored. As an alternative,
`vc`

interprets character vectors, assigned as unnamed
arguments, as lists of variables of moderators to be extracted from
`data`

. See the examples below.

Default for intercepts in `fe`

terms is ```
intercept
= TRUE
```

, or `intercept = "ce"`

for models fitted with
`olmm`

. This means that an intercept is automatically
attached. Alternatives are `intercept = FALSE`

, which is equal to
`intercept = "none"`

, and `intercept = "ge"`

, which yields a
global-effect intercept for models fitted with `olmm`

.

Default for intercepts in `vc`

is to introduce an
intercept if the `by`

argument is ignored, otherwise no intercept
is introduced. Specifically, if input is specified for the `by`

argument, then `intercept = TRUE`

, or `intercept = "ce"`

for models fitted by `olmm`

. Alternatives are
`intercept = FALSE`

, which is equal to `intercept = "none"`

,
and `intercept = "ge"`

, which yields a global-effect varying
intercept.

Default for intercepts in `re`

is ```
intercept =
TRUE
```

, which is equal to `intercept = "ge"`

. ```
intercept =
FALSE
```

is equal to `intercept = "none"`

. For category-specific
random intercepts, use `intercept = "ge"`

. See
`olmm`

.

a list used by `tvcm`

, `fvcm`

and
`olmm`

for constructing the model matrices.

Reto Buergin

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | ```
## Formula for a model with 2 fixed effects (x1 and x2) and a random
## intercept. The 're' terms indicates that an intercept is fitted for
## each level of 'id'.
formula <- y ~ fe(x1 + x2) + re(1|id)
## Formula for a model with one fixed effect and one varying coefficient
## term with 2 moderators and 2 varying coefficient predictors. 'tvcm'
## will fit one partition to model the effects of 'x2' and 'x3' as
## functions of 'z1' and 'z2'.
formula <- y ~ x1 + vc(z1, z2, by = x2 + x3, intercept = TRUE)
## Similar formula as above, but the predictors 'x2' and 'x3' have
## separate 'vc' terms. 'tvcm' will fit a separate partition for each of
## 'x2' and 'x3' to model their effects as functions of 'z1' and 'z2'.
formula <- y ~ x1 + vc(z1, z2, by = x2) + vc(z1, z2, by = x3)
## As an alternative to '.' you can define variables in a vector
vars <- c("x1", "x2", "x3")
formula <- y ~ x1 + vc(vars, by = x2) + vc(vars, by = x3)
``` |

vcrpart documentation built on Feb. 16, 2018, 1:03 a.m.

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.