datamanipulation {DTVEM} | R Documentation |
PLEASE USE THE LAG FUNCTION RATHER THAN THIS UNLESS YOU WOULD LIKE TO SPECIFY THIS MANUALLY. Manipulates the data so that it creates a vector that is both in wide and long formats
datamanipulation( ..., numberofvars = numberofvars, input_list = input_list, differentialtimevaryingpredictors = NULL, outcome = NULL, controlvariables = NULL, data = NULL, ID = "ID", Time = NULL, controllag = NULL, standardized = TRUE, predictionstart = NULL, predictionsend = NULL, predictionsinterval = NULL, beforeblock = TRUE )
... |
A list of variable names used in the function e.g. "X","Y" |
numberofvars |
The number of variables entered (normally passed from LAG function) |
input_list |
identical to the elipses above, A list of variable names used in the function e.g. "X","Y" |
differentialtimevaryingpredictors |
A list of predictor variables to be used as predictor variables e.g. c("X","Y") |
outcome |
The outcome(s) to be predicted e.g. c("X","Y") |
controlvariables |
The variables to be controlled for (not lagged). |
data |
The data frame to be converted |
ID |
The name of the ID variable. E.G. ID = "ID" (must be specified). |
Time |
The name of the Time variable. E.G. Time = "Time" (must be specified). |
controllag |
The time of the lag which coviarates should be controlled for (NOT CURRENTLY FUNCTIONAL) |
standardized |
This specifies whether all of the variables (aside from Time) should be standardized. Options are TRUE, FALSE, and "center". TRUE means within-person standardize each variable, FALSE means use the raw data, "center" means to only within-person center the variables. Default = TRUE |
predictionstart |
The differential time value to start with, default is NULL, and the lowest time difference in the time series will be used (use lower value if you're first value if you're interested in a smaller interval prediction) |
predictionsend |
The differential time value to end with. This should usually be set by the user. |
predictionsinterval |
The intervals to predict between differential time points, default = 1 |
beforeblock |
Is this before any data-blocking occurs? default = TRUE |
The output of this will be (1) The data in a very long stacked format (called laglongreducedummy), (2) the data in a wide format with all lags for all variables, time, and time differences (called Timelagsdummy), (3) the name of the differentialtimevarying predictors (namesofnewpredictorvariables), and (4) the length of the long matrix (laglongmatrixlength)