DPI | R Documentation |
The Directed Prediction Index (DPI) is a simulation-based and conservative method for quantifying the relative endogeneity (relative dependence) of outcome (Y) vs. predictor (X) variables in multiple linear regression models. By comparing the proportion of variance explained (R-squared) between the Y-as-outcome model and the X-as-outcome model while controlling for a sufficient number of potential confounding variables, it suggests a more plausible influence direction from a more exogenous variable (X) to a more endogenous variable (Y). Methodological details are provided at https://psychbruce.github.io/DPI/.
DPI(
model,
y,
x,
data = NULL,
k.cov = 1,
n.sim = 1000,
seed = NULL,
progress,
file = NULL,
width = 6,
height = 4,
dpi = 500
)
model |
Model object ( |
y |
Dependent (outcome) variable. |
x |
Independent (predictor) variable. |
data |
[Optional] Defaults to |
k.cov |
Number of random covariates (simulating potential omitted variables) added to each simulation sample.
|
n.sim |
Number of simulation samples.
Defaults to |
seed |
Random seed for replicable results.
Defaults to |
progress |
Show progress bar.
Defaults to |
file |
File name of saved plot ( |
width , height |
Width and height (in inches) of saved plot.
Defaults to |
dpi |
Dots per inch (figure resolution). Defaults to |
Return a data.frame of simulation results:
DPI
t.beta.xy^2 * (R2.Y - R2.X)
t.beta.xy
t value for coefficient of X predicting Y (always equal to t value for coefficient of Y predicting X) when controlling for all other covariates
df.beta.xy
residual degree of freedom (df) of t.beta.xy
r.partial.xy
partial correlation (always with the same t value as t.beta.xy
) between X and Y when controlling for all other covariates
delta.R2
R2.Y - R2.X
R2.Y
R^2
of regression model predicting Y using X and all other covariates
R2.X
R^2
of regression model predicting X using Y and all other covariates
model = lm(Ozone ~ ., data=airquality)
DPI(model, y="Ozone", x="Solar.R", seed=1)
DPI(data=airquality, y="Ozone", x="Solar.R", k.cov=10, seed=1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.