RR: Causal risk ratio of a binary/continuous/discrete endogenous...

Description Usage Arguments Details Value Author(s) See Also

View source: R/RR.r

Description

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

Usage

1
2
3
4
5
RR(x, nm.end, E = TRUE, treat = TRUE, type = "joint", ind = NULL, 
   n.sim = 100, prob.lev = 0.05, length.out = NULL, hd.plot = FALSE,
   rr.plot = FALSE, 
   main = "Histogram and Kernel Density of Simulated Risk Ratios", 
   xlab = "Simulated Risk Ratios", ...)

Arguments

x

A fitted gjrm object.

nm.end

Name of the endogenous variable.

E

If TRUE then RR calculates the sample RR. If FALSE then it calculates the sample RR for the treated individuals only.

treat

If TRUE then RR calculates the RR using the treated only. If FALSE then it calculates the ratio using the control group. This only makes sense if E = FALSE.

type

This argument can take three values: "naive" (the effect is calculated ignoring the presence of observed and unobserved confounders), "univariate" (the effect is obtained from the univariate model which neglects the presence of unobserved confounders) and "joint" (the effect is obtained from the bivariate model which accounts for observed and unobserved confounders).

ind

Binary logical variable. It can be used to calculate the RR for a subset of the data. Note that it does not make sense to use ind when some observations are excluded from the RR calculation (e.g., when using E = FALSE).

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/discrete treatment has on a binary outcome.

hd.plot

If TRUE then a plot of the histogram and kernel density estimate of the simulated risk ratios is produced. This can only be produced when binary responses are used.

rr.plot

For the case of continuous/discrete endogenous variable and binary outcome, if TRUE then a plot (on the log scale) showing the risk ratios that the binary outcome is equal to 1 for each incremental value of the endogenous variable and respective intervals is produced.

main

Title for the plot.

xlab

Title for the x axis.

...

Other graphics parameters to pass on to plotting commands. These are used only when hd.plot = TRUE.

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/discrete 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/discrete 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


KironmoyDas/KD-STAT0035-GMupdate documentation built on Feb. 15, 2021, 12:17 a.m.