Specify Formulae in a Random Effects HHH Model
hhh4_formula.RdThe special functions fe and ri are used to specify
unit-specific effects of covariates and random intercept terms,
respectively, in the component formulae of hhh4.
Arguments
- x
an expression like
sin(2*pi*t/52)involving the time variablet, or just1for an intercept. In general this covariate expression might use any variables contained in thecontrol$dataargument of the parenthhh4call.- unitSpecific
logical indicating if the effect of
xshould be unit-specific. This is a convenient shortcut forwhich = rep(TRUE, nUnits), wherenUnitsis the number of units (i.e., columns of the"sts"object).- which
vector of logicals indicating which unit(s) should get an unit-specific parameter. For units with a
FALSEvalue, the effect term forxwill be zero in the log-linear predictor. Note especially that setting aFALSEvalue for the intercept term of a unit, e.g.,ar = list(f = ~-1 + fe(1, which=c(TRUE, FALSE)))in a bivariatehhh4model, does not mean that the (autoregressive) model component is omitted for this unit, but that \(\log(\lambda_1) = \alpha_1\) and \(\log(\lambda_2) = 0\), which is usually not of interest. ATM, omitting an autoregressive effect for a specific unit is not possible.
Ifwhich=NULL, the parameter is assumed to be the same for all units.- initial
initial values (on internal scale!) for the fixed effects used for optimization. The default (
NULL) means to use zeroes.- type
random intercepts either follow an IID or a CAR model.
- corr
whether random effects in different components (such as
arandend) should be correlated or not.- initial.fe
initial value for the random intercept mean.
- initial.var
initial values (on internal scale!) for the variance components used for optimization.
- initial.re
initial values (on internal scale!) for the random effects used for optimization. The default
NULLare random numbers from a normal distribution with zero mean and variance 0.001.
See also
hhh4 model specifications in vignette("hhh4"),
vignette("hhh4_spacetime") or on the help page of
hhh4.