Learn R Programming

SemiParBIVProbit (version 3.5)

OR: Average odds ratio of a binary or continuous endogenous variable

Description

OR can be used to calculate the sample average odds ratio of a binary or continuous endogenous predictor/treatment, with corresponding interval obtained using posterior simulation.

Usage

OR(x, nm.end, E = TRUE, treat = TRUE, type = "bivariate", ind = NULL, 
   delta = FALSE, n.sim = 100, prob.lev = 0.05, hd.plot = FALSE,
   prob.plot = FALSE, main = "Histogram and Kernel Density of Simulated Odds Ratios", 
   xlab = "Simulated Odds Ratios", ...)

Arguments

x
A fitted SemiParBIVProbit object as produced by SemiParBIVProbit().
nm.end
Name of the endogenous variable.
E
If TRUE then OR calculates the sample OR. If FALSE then it calculates the sample OR for the treated individuals only.
treat
If TRUE then OR calculates the OR 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
ind
Binary logical variable. It can be used to calculate the OR for a subset of the data. Note that it does not make sense to use ind when some observations are excluded from the OR calculation (e.g., when using E = FALSE
delta
This option may be available in future, although it will be unreliable at small sample sizes.
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 OR distribution used for interval calculations.
hd.plot
If TRUE then a plot of the histogram and kernel density estimate of the simulated odds ratios is produced. This can only be produced when delta = FALSE.
prob.plot
For the case of continuous endogenous variable and binary outcome, if TRUE then a plot showing probability that the binary outcome is equal to 1 for each value of the endogenous variable and respective i
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.

Value

  • resIt returns three values: lower confidence interval limit, estimated OR and upper interval limit.
  • prob.levProbability level used.
  • sim.ORIf delta = FALSE then it returns a vector containing simulated values of the average OR. This is used to calculate intervals.
  • OR.soIt returns a vector containing the estimated effect for each single observation. This may not be available in some cases.
  • RatiosFor the case of continuous endogenous variable and binary outcome, it returns a matrix made up of three columns containing the odds ratios for each unit increase in the endogenous variable and respective intervals.
  • PrFor the case of continuous endogenous variable and binary outcome, it returns a matrix made up of three columns containing the probability that the binary outcome is equal to 1 for each value of the endogenous variable and respective intervals.

Details

OR calculates the sample average odds ratio for a binary or continuous treatment. Posterior simulation is used to obtain a confidence/credible interval.

See Also

SemiParBIVProbit-package, SemiParBIVProbit, summary.SemiParBIVProbit

Examples

Run this code
## see examples for SemiParBIVProbit

Run the code above in your browser using DataLab