piieffect: piieffect

Description Usage Arguments Methods (by class) Author(s) Examples

Description

This function provides estimation and inference for the Population Intervention Indirect Effect (PIIE) as described in Fulcher et al. (2017). The outcome and intermediate variables must be continuous as a linear model is used to model the means. Similarly, the exposure variable must be binary as a logistic model is used.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
piieffect(data, outcome, intermediate, exposure, covariates.outcome,
  covariates.intermediate, covariates.exposure, interaction, astar)


  ## S4 method for signature 
## 'data.frame,
##   character,
##   character,
##   character,
##   vector,
##   vector,
##   vector,
##   numeric,
##   numeric'
piieffect(data,
  outcome, intermediate, exposure, covariates.outcome = c(1),
  covariates.intermediate = c(1), covariates.exposure = c(1),
  interaction = 1, astar = 0)

Arguments

data

A dataframe

outcome

The variable name for the outcome variable in data

intermediate

The variable name for the intermediate variable in data

exposure

The variable name for the exposure variable in data

covariates.outcome

A vector of variable names for covariates to be included in the outcome model

covariates.intermediate

A vector of variable names for covariates to be included in the outcome model

covariates.exposure

A vector of variable names for covariates to be included in the exposure model

interaction

A binary variable indicating if an interaction term between intermediate and exposure is needed

astar

A numeric value for the level of the exposure the intermediate value takes

Methods (by class)

Author(s)

Isabel Fulcher

Examples

1
2
3
4
5
6
7
8
#Load example dataset
simdata <- readRDS(system.file("rds","simdata1.rds",package="frontdoorpiie"))
#Create an interaction term among covariates
simdata$c1c2 <- simdata$c1*simdata$c2
#Apply the function to estimate PIIE
example <- piieffect(data=simdata,outcome="y",intermediate="m",exposure="a",
covariates.outcome=c("c1","c2","c1c2"),covariates.intermediate=c("c1","c2","c1c2"),covariates.exposure=c("c1","c2","c1c2"),
interaction=1,astar=0)

isabelfulcher/frontdoorpiie documentation built on May 28, 2019, 9:56 p.m.