# tmlenet v0.1.0

Monthly downloads

## Targeted Maximum Likelihood Estimation for Network Data

Estimation of average causal effects for single time point
interventions in network-dependent data (e.g., in the presence of spillover
and/or interference). Supports arbitrary interventions (static or
stochastic). Implemented estimation algorithms are the targeted maximum
likelihood estimation (TMLE), the inverse-probability-of-treatment (IPTW)
estimator and the parametric G-computation formula estimator. Asymptotically
correct influence-curve-based confidence intervals are constructed for the
TMLE and IPTW. The data are assumed to consist of rows of unit-specific
observations, each row i represented by variables (F.i,W.i,A.i,Y.i), where
F.i is a vector of friend IDs of unit i (i's network), W.i is a vector of
i's baseline covariates, A.i is i's exposure (can be binary, categorical or
continuous) and Y.i is i's binary outcome. Exposure A.i depends on
(multivariate) user-specified baseline summary measure(s) sW.i, where sW.i
is any function of i's baseline covariates W.i and the baseline covariates
of i's friends in F.i. Outcome Y.i depends on sW.i and (multivariate)
user-specified summary measure(s) sA.i, where sA.i is any function of i's
baseline covariates and exposure (W.i,A.i) and the baseline covariates and
exposures of i's friends. The summary measures are defined with functions
def.sW and def.sA. See ?'tmlenet-package' for a general overview.

## Readme

# tmlenet

The `tmlenet`

R package performs estimation of average causal effects for single time point interventions in network-dependent (non-IID) data in the presence of interference and/or spillover. Currently implemented estimation algorithms are the targeted maximum likelihood estimation (TMLE), Horvitz-Thompson or the inverse-probability-of-treatment (IPTW) estimator and the parametric G-computation estimator. The user-specified interventions can be either static, dynamic or stochastic. Asymptotically correct influence-curve-based confidence intervals are also constructed for the TMLE and IPTW. See the paper below for more information on the estimation methodology employed by the `tmlenet`

R package:

M. J. van der Laan, “Causal inference for a population of causally connected units,” J. Causal Inference J. Causal Infer., vol. 2, no. 1, pp. 13–74, 2014.

### Installation

To install the development version of `tmlenet`

(requires the `devtools`

package):

```
devtools::install_github('osofr/tmlenet', build_vignettes = FALSE)
```

### Documentation

Once the package is installed, please refer to the help file `?'tmlenet-package'`

and `tmlenet`

function documentation for details and examples:

```
?'tmlenet-package'
?tmlenet
```

### The input data and the network summary measures

The input data are assumed to consist of rows of unit-specific observations, with each row `i`

represented by variables (`F.i`

,`W.i`

,`A.i`

,`Y.i`

), where `F.i`

is a vector of "**friend IDs**" of unit `i`

(also referred to as `i`

's "**network**"), `W.i`

is a vector of `i`

's baseline covariates, `A.i`

is `i`

's exposure (either binary, categorical or continuous) and `Y.i`

is `i`

's binary outcome.

Each exposure `A.i`

depends on (possibly multivariate) baseline summary measure(s) `sW.i`

, where `sW.i`

can be any user-specified function of `i`

's baseline covariates `W.i`

and the baseline covariates of `i`

's friends in `F.i`

(all `W.j`

such that `j`

is in `F.i`

). Similarly, each outcome `Y.i`

depends on `sW.i`

and (possibly multivariate) summary measure(s) `sA.i`

, where `sA.i`

can be any user-specified function of `i`

's baseline covariates and exposure (`W.i`

,`A.i`

) and the baseline covariates and exposures of `i`

's friends (all `W.j`

,`A.j`

such that `j`

is in `i`

's friend set `F.i`

).

The summary measures (`sW.i`

,`sA.i`

) are defined simultaneously for all `i`

with functions `def.sW`

and `def.sA`

. It is assumed that (`sW.i`

,`sA.i`

) have the same dimensionality across `i`

. The function `eval.summaries`

can be used for evaluating these summary measures.

All estimation is performed by calling the `tmlenet`

function. The vector of friends `F.i`

can be specified either as a single column in the input data (where each `F.i`

is a string of friend IDs or friend row numbers delimited by character `sep`

) or as a separate input matrix of network IDs (where each row is a vector of friend IDs or friend row numbers). Specifying the network as a matrix generally results in significant improvements to run time. See `tmlenet`

function help file for additional details on how to specify these and the rest of the input arguments.

### Example

...

### Citation

To cite `tmlenet`

in publications, please use:

Sofrygin O, van der Laan MJ (2015).

tmlenet: Targeted Maximum Likelihood Estimation for Networks.R package version 0.1.

### Funding

The development of this package was funded through an NIH grant (R01 AI074345-07).

### Copyright

This software is distributed under the GPL-2 license.

## Functions in tmlenet

Name | Description | |

RegressionClass | R6 class that defines regression models evaluating P(sA|sW), for summary measures (sW,sA) | |

df_netKmax6 | An example of a row-dependent dataset with known network of at most 6 friends. | |

DatNet | R6 class for storing and managing already evaluated summary measures sW or sA (but not both at the same time). | |

CategorSummaryModel | R6 class for fitting and predicting joint probability for a univariate categorical summary measure sA[j] | |

print_tmlenet_opts | Print Current Option Settings for tmlenet | |

eval.summaries | Evaluate Summary Measures sA and sW | |

tmlenet_options | Setting Options for tmlenet | |

NetInd_mat_Kmax6 | An example of a network ID matrix | |

SummariesModel | R6 class for fitting and predicting model P(sA|sW) under g.star or g.0 | |

tmlenet-package | Targeted Maximum Likelihood Estimation for Network Data | |

mcEvalPsi | R6 class for Monte-Carlo evaluation of various substitution estimators for exposures generated under the user-specified stochastic intervention function. | |

BinDat | R6 class for storing the design matrix and binary outcome for a single logistic regression | |

DatNet.sWsA | R6 class for storing and managing the combined summary measures sW & sA from DatNet classes. | |

tmlenet | Estimate Average Network Effects For Arbitrary (Stochastic) Interventions | |

DefineSummariesClass | R6 class for parsing and evaluating user-specified summary measures (in exprs_list) | |

def.sW | Define Summary Measures sA and sW | |

Define_sVar | R6 class for parsing and evaluating node R expressions. | |

df_netKmax2 | An example of a row-dependent dataset with known network of at most 2 friends. | |

BinOutModel | R6 class for fitting and making predictions for a single logistic regression with binary outcome B, P(B | PredVars) | |

ContinSummaryModel | R6 class for fitting and predicting joint probability for a univariate continuous summary measure sA[j] | |

No Results! |

## Last month downloads

## Details

URL | https://github.com/osofr/tmlenet |

BugReports | https://github.com/osofr/tmlenet/issues |

LinkingTo | Rcpp |

License | GPL-2 |

LazyData | true |

NeedsCompilation | yes |

Packaged | 2015-09-28 02:15:34 UTC; olegsofrygin |

Repository | CRAN |

Date/Publication | 2015-09-28 09:26:59 |

imports | assertthat , data , data.table , Matrix , methods , R6 , Rcpp , simcausal , speedglm , stats , stringr |

depends | base (>= 3.2.0) , R (>= 3.2.0) |

suggests | doParallel , foreach , igraph , knitr , locfit , matrixStats , RUnit |

Contributors | Oleg Sofrygin, Mark J. van der Laan |

#### Include our badge in your README

```
[![Rdoc](http://www.rdocumentation.org/badges/version/tmlenet)](http://www.rdocumentation.org/packages/tmlenet)
```