predicteff: Predicts treatment effects on an outcome for individuals...

View source: R/predicteff.R

predicteffR Documentation

Predicts treatment effects on an outcome for individuals randomly sampled from the entire dataset (default 20%).

Description

Predicts treatment effects on an outcome for individuals randomly sampled from the entire dataset (default 20%).

Usage

predicteff(
  x,
  featuresinf = NULL,
  cores = 1,
  seed = 1234,
  plot.overlap = FALSE,
  quant = Inf,
  dup = FALSE,
  profile = FALSE,
  resplevel = 0
)

Arguments

x

a list with a fields teffdata and features. teffdata is a data.frame (or matrix) with the treatment $t and the outcome $eff variables, and covariates across subjects. features is a matrix which the profiling is of subjects if performed. The features are adjusted for the covariates on the teffdata before fitting the causal random forest forest.

featuresinf

a vector of characters with the names of the features to be used; a matrix of characters whose columns are names of features whose values will be averaged (Default:NULL).

cores

an integer with the number of cores for parallel computation (Default:1)

seed

and integer with the random seed for splitting data into train (80%) and test (20%) sets.

plot.overlap

a logical. If TRUE then it plots the overlap of adjusted feature data across treatments. Parameter available for less than 20 features (Default: FALSE).

quant

a number from 0 to 1 with the quantile of features to be selected with top information score from the causal forest. By default it selects all the features (Default: Inf).

dup

a logical that indicates whether the feature and teff data should be duplicated in case of small datasets.

profile

a logical. If TRUE then it estimates a profile of binarized feature data for the individuals with significantly positive and negative treatment effects, respectively.

resplevel

a number indicating the level of response for assessing positive ore negative treatment effects (default 0).

Details

This function sets up feature and treatment-effects data, fits random causal forest and identify the individuals with significant treatment effects. Each individual is characterized by a set of feature data and the the effect of treatment on the individual is given by the estimated difference of an outcome between treating and and not treating when the feature data are kept constant. Individuals with significant treatment effects are considered for those whose confidence intervals for the treatment estimate do not overlap 0. Consensus profiles of individuals with positive, and negative, treatment effects are obtained from majority votes of adjusted features, binarized over the population means.

The result is two profiles, associated with positive and negative treatment effects, given by logical vectors across the features. The logical value of a given profile at feature indicates whether the adjusted feature of a new individual should be higher than the feature population mean if the individual is successfully targeted by the profile. See targetprofile.

Value

a list of class pteff with fields:

predictions:

a vector with the estimated treatment effect of the individuals in the test set.

featurenames:

a vector with the names of the features used.

cl:

a vector with the lower limit of the 95% confidence intervals for the estimated treatment effect.

cu:

a vector with the upper limit of the 95% confidence intervals for the estimated treatment effect.

subsids:

a vector with ids of subjects in the test set.

treatment:

a vector with treatment effect in the test set.

profile:

a list with fields profpositive and profnegative that are matrices with binarized feature data for the individuals with significantly positive and negative treatment effects, respectively.

Examples

data(tcell)
homologous<- matrix(c("DDX3Y","DDX3X","KDM5D","KDM5C","PRKY","PRKX","RPS4Y1",
"RPS4X","TXLNGY", "TXLNG",
"USP9Y", "USP9X", "XIST", "XIST", "TSIX", "TSIX"), nrow=2)
predicteff(tcell, featuresinf=homologous, profile=TRUE)


teff-package/teff documentation built on March 20, 2022, 8:25 p.m.