Constructs an artificial data set with \(n\) cross-sectional units observed for \(t\) time periods for logit, poisson, or gamma models. The “true” linear predictor (\(\boldsymbol{\eta}\)) is generated as follows: $$\eta_{it} = \mathbf{x}_{it}^{\prime} \boldsymbol{\beta} + \alpha_{i} + \gamma_{t} \, ,$$ where \(\mathbf{X}\) consists of three independent standard normally distributed regressors. Both parameter referring to the unobserved heterogeneity (\(\alpha_{i}\) and \(\gamma_{t}\)) are generated as iid. standard normal and the structural parameters are set to \(\boldsymbol{\beta} = [1, - 1, 1]^{\prime}\).
Note: The poisson and gamma model are based on the logarithmic link function.
simGLM(n = NULL, t = NULL, seed = NULL, model = c("logit", "poisson", "gamma"))
The function simGLM
returns a data.frame with 6 variables.
a strictly positive integer equal to the number of cross-sectional units.
a strictly positive integer equal to the number of time periods.
a seed to ensure reproducibility.
a string equal to "logit"
, "poisson"
, or "gamma"
. Default is
"logit"
.
feglm