gamstage2 {DTVEM} | R Documentation |
PLEASE USE THE LAG FUNCTION RATHER THAN THIS UNLESS YOU WOULD LIKE TO SPECIFY THIS MANUALLY. This runs the confirmatory stage of DTVEM using multilevel models and the spline effect of time.
gamstage2( Timelagsdummy = Timelagsdummy, variablenamesonlysigall = variablenamesonlysigall, independentpredictors = independentpredictors, k3 = k3, software = software )
Timelagsdummy |
The data frame with lags from data manipulation |
variablenamesonlysigall |
The variables to be included in the confirmatory model |
independentpredictors |
This is whether or not the wide model comparisons should be run independently and combined via stepwise regression with backward selection. This can be useful to reduce the amount of lags included in the confirmatory model. |
k3 |
The number of k selection points used in the model for the time spline (NOTE THAT THIS CONTROLS FOR TIME TRENDS OF THE POPULATION) (see ?choose.k in mgcv package for more details). Default is 3. (OPTIONAL) |
software |
This is the software used to run the secondary analysis. State-space models are implemented by the argument "OpenMx". The option "gam" can be used to run a traditional multilevel model with a spline that controls for non-linear time trends at the population level. The option "hybrid" first runs a multilevel model then runs an state-space model. Model. Note that the state-space approach can be very slow with large amounts of lags, and consequently "gam" should be used with large amounts of lags are included. However, state-space model estimation is generally marginally superior to the multilevel modeling approach, and if using small amounts of lags or time is not an issue the state-space option is recommended. The default is "OpenMx" which implements multilevel models. (OPTIONAL) |
The output of this function is: The output from the second stage of DTVEM in mgcv's gam