Usage
expand_data(data, y, missing.x, value.set, weights = rep.int(1, NROW(data)), indicator = rep.int(0, NROW(data)))
Arguments
data
a vector, matrix, list or data frame containing numerics. This data is checked for incompleteness and needs to contain the independent variables for a subsequent regression with n observations and k regressors. Each gap is filled with all values from value.set
. New observations are added for each possible value.
y
a vector of integers or numerics. This vector has to be complete and is the dependent variable for a subsequent regression.
missing.x
a vector that contains integers and gives the position of the independent variables, for which the data will be checked for incompleteness, i.e. for a matrix the position of the corresponding columns.
value.set
a vector of numerics containing all possible values the missing data can take. This set has to be finite.
weights
a vector of numerics giving the initial weight of each observation. Default is 1 for each observation.
indicator
a vector of integers that indicates which observations belong to each other. If some columns with incomplete data were already completed, this vector has to be passed here. For raw incomplete data, the function connects observations which belong to each other. Default is 0 for this vector indicating no connection.