Processing math: 100%

V-structure bias, binary exposure and binary outcome.

V-structure bias, binary exposure and binary outcome.

Details

Explore bias due to sample ascertainment when the exposure and outcome are binary variables. This class explores the range or OR generated by parameters in the following model: P(S=1|A,Y)=β0+βaA+βyY+βayAY Where A is a binary exposure, Y is a binary outcome and S indicates whether an individual is present in the dataset P(S=1) is the proportion of the population that is present in the data.

Public fields

param

Dataframe of parameter range list

Methods

Public methods


Method or_calc()

Calculate the expected OR under collider bias when null hypothoses of OR = 1 is true:

Usage

VBB$or_calc(b0, ba, by, bay)

Arguments

b0

Baseline probability of being selected

ba

Effect of A on being selected

by

Effect of Y on being selected

bay

Effect of joint AY interaction on being selected

Returns

Odds ratio


Method ps_calc()

Calculate the proportion of samples included in the model for a given set of parameters

Usage

VBB$ps_calc(b0, ba, by, bay, pA, pY, pAY)

Arguments

b0

Baseline probability of being selected

ba

Effect of A on being selected

by

Effect of Y on being selected

bay

Effect of joint AY interaction on being selected

pA

P(A=1) in the general population

pY

P(Y=1) in the general population

pAY

P(A=1,Y=1) in the general population

Returns

P(S = 1)


Method parameter_space()

Specify a set of parameters for the structural equation, and calculate the set of odds ratios that would be obtained, assuming the odds ratio of A on Y in the total population is 1.

Usage

VBB$parameter_space(
  target_or,
  pS,
  pA,
  pY,
  pAY,
  b0_range,
  ba_range,
  by_range,
  bay_range,
  granularity = 100,
  pS_tol = 0.0025
)

Arguments

target_or

Target odds ratio. e.g. in an observational study this OR is observed, and the researcher seeks to find parameter ranges that could explain it

pS

Proportion of the population present in the sample

pA

P(A=1) in the general population

pY

P(Y=1) in the general population

pAY

P(A=1,Y=1) in the general population

b0_range

Baseline probability of being selected. Provide a range of values to explore e.g. c(0,1)

ba_range

Effect of A on being selected into the sample. Provide a range of values to explore e.g. c(-0.2, 0.2)

by_range

Effect of Y on being selected into the sample. Provide a range of values to explore e.g. c(-0.2, 0.2)

bay_range

Effect of AY interaction on being selected into the sample. Provide a range of values to explore e.g. c(-0.2, 0.2)

granularity

Granularity of the search space. Default=100, going much higher can be computationally difficult

pS_tol

Tolerance of pS value Default=0.0025

Returns

Data frame of parameters that satisfy the target_or and target pS values


Method scatter3d()

3D scatterplot of output from parameter_space function. See plot3D::scatter3D for info on parameters

Usage

VBB$scatter3d(
  ticktype = "detailed",
  theta = 130,
  phi = 0,
  bty = "g",
  xlab = "ba",
  ylab = "by",
  zlab = "b0",
  clab = "OR",
  ...
)

Arguments

ticktype

Default="detailed"

theta

Default=130

phi

Default=0

bty

Default="g"

xlab

Default="ba"

ylab

Default="by"

zlab

Default="b0"

clab

Default="OR"

...

Further parameters to be passed to plot3D::scatter3D

Returns

Scatterplot


Method scatter()

Simple scatterplot of output from parameter_space function. Plotted are the parameter values of b0, ba and by that can give rise to an OR target_or

Usage

VBB$scatter()


Method histogram()

Histogram of odds ratios across the range of parameter values

Usage

VBB$histogram(bins = 30)

Arguments

bins

How many bins to split histogram. Default=30

Returns

ggplot object


Method clone()

The objects of this class are cloneable with this method.

Usage

VBB$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.