RR: Causal risk ratio of a binary/continuous treatment variable

View source: R/RR.r

RRR Documentation

Causal risk ratio of a binary/continuous treatment variable

Description

RR can be used to calculate the causal risk ratio of a binary/continuous treatment variable, with corresponding interval obtained using posterior simulation.

Usage


RR(x, trt, int.var = NULL, joint = TRUE, n.sim = 100, prob.lev = 0.05, 
   length.out = NULL)

Arguments

x

A fitted gjrm object.

trt

Name of the treatment variable.

int.var

A vector made up of the name of the variable interacted with nm.end, and a value for it.

joint

If FALSE then the effect is obtained from the univariate model which neglects the presence of unobserved confounders. When TRUE, the effect is obtained from the simultaneous model which accounts for observed and unobserved confounders.

n.sim

Number of simulated coefficient vectors from the posterior distribution of the estimated model parameters. This is used when delta = FALSE. It may be increased if more precision is required.

prob.lev

Overall probability of the left and right tails of the RR distribution used for interval calculations.

length.out

Ddesired length of the sequence to be used when calculating the effect that a continuous treatment has on a binary outcome.

Details

RR calculates the causal risk ratio of the probabilities of positive outcome under treatment (the binary predictor or treatment assumes value 1) and under control (the binary treatment assumes value 0). Posterior simulation is used to obtain a confidence/credible interval.

RR works also for the case of continuous Gaussian endogenous treatment variable.

Value

prob.lev

Probability level used.

sim.RR

It returns a vector containing simulated values of the average RR. This is used to calculate intervals.

Ratios

For the case of continuous endogenous variable and binary outcome, it returns a matrix made up of three columns containing the risk ratios for each incremental value in the endogenous variable and respective intervals.

Author(s)

Maintainer: Giampiero Marra giampiero.marra@ucl.ac.uk

See Also

GJRM-package, gjrm


GJRM documentation built on Oct. 25, 2024, 5:07 p.m.