readPanelUb: Read Data file and transform

Description Usage Arguments Details Value

View source: R/readPanelUb.R


[Internal] readPanelUb takes as arguments the baseline matrix and panel matrix seperately and transforms the (unbalanced) panel data in useable format. The matrices should xalready be in the suggested format for this function. (See example dataset)


readPanelUb(base_mat, panel_mat, type, covars, name, sort_data,
  control_test, data_name)



contains a string of possible model types, must be one of: "SF"


contains additional information about covariate names (optional)


contains name of the model, which will be saved


control parameter passed down in funcional hierarchy to determine whether observations should be sorted for by ID and panel time


a list of base matrix and panel matrix


Base matrices have 1 subject in each row and a unique corresponding ID. It is used to capture the base features of a subject, which are used for estimating selection model effects. Also included are columns with the maximum panel time observed, treatment indicator (0/1). The panel matrix represents an expansion on panel times of the bases matrix with some additional information. Covariates for the treatment model can be included, because they can vary over panel times, yielding the heterogenous effect of treatment. Panel matrix must include the columns ID, panel time, target outcome, some covariates for the models and panel dummy columns (if no panel dummy are included you can specify p.dummy = TRUE) Strictly keep to this structure, the function provides some quality checks, but may prove insufficient for some wierd structured individual chases and proceed to calculate, potentially giving bad quality estimate results. The base and panel matrices should also be in ascending order by subject panel times, and by maximum panel time, meaning subjects with max panel time 3 are listed before subjects with maximum panel time 4, 5, etc. This is necessary to use quicker evaluation functions for the estimation procedures. Also at the moment the base matrix needs to have the subject ID in the first column, panel times of each subject in second column, the treatment in the third and all the covariates for the selection model in subsequent columns.


A data object for further computation, containing of the modified dataset and a model object, which contains covariate information amongst other specifics.

PatrickPfeifferDSc/bite documentation built on Aug. 22, 2019, 9:57 a.m.