design/design-document.md

Design Document for RoboCar

Purpose

This package will integrate two existing packages for covariate adjustment in RCTs: RobinCAR, which does adjustment using linear models, and __ which does adjustment for survival data.

The code will be written in R using the object-oriented S4 classes.

User API

Main Functions for Inference

There will be three main functions that implement robust inference. Each of the functions will share the following arguments:

Linear Models

The linear function will be named robincar_linear, and it will have the following arguments in addition to those shared above:

It will return an Estimator object and potentially a Contrast object based on whether or not a contrast was requested. These objects have show and summarize methods that will display and summarize the results.

Generalized Linear Models

The GLM function will be named: robincar_glm

Time-to-Event Data

There will be two time-to-event functions, and they will be named robtestcar_tte_logrank and robtestcar_tte_score and it will have the following arguments in addition to those shared above:

Data Simulation Functions

TODO

Backend Structure

The following is an outline of the structure of the S4 classes that will be used in the functions. The main classes are (1) Data, (2) Estimator, and (3) Contrast. For TTE data, we could have a Tester, since testing is the primary purpose in that case.

Data

The Data class keeps track of all data attributes including storing the data, knowing column names, and functions for data retrieval as a vector or a matrix.

Data: Data class with attributes for column names and dataset

Data Sub-Classes

DataTTE: Data class for time-to-event data

Estimator

Estimator is the class that performs the estimation based on some data. Right now, we would just have linear models in this category, but in the future, we could have an Estimator base class and a LinearEstimator (with ANOVA, ANCOVA, and ANHECOVA as sub-classes) and NonlinearEstimator as sub-classes to Estimator.

Estimator: Base object for model fitting

Estimator Sub-Classes

ANOVA(Estimator):

ANCOVA(Estimator):

ANHECOVA(Estimator):

Contrast

Creates contrasts based on the output of Estimator and a contrast function.

Contrast: Base object for contrast estimation

Contrast Sub-Classes

DiffContrast(Contrast):

RatioContrast(Contrast):



mbannick/RoboCar documentation built on June 16, 2022, 6:56 p.m.