Description Usage Arguments Value Examples
Generates nsim samples of n independent pairs of observations using a linear model y = a + b1*x + b2*z + disturbance where z is unobserved. x and z are jointly normally distributed, and the disturbances are also normal.
1 | sim.2var(n, nsim, a, b1, b2 = 0, sigma.disturb = 1, correl = 0)
|
n |
The number of independent pairs of observations to generate per simulation. |
nsim |
The number of simulations to run. |
a |
The intercept. |
b1 |
The slope for the observed independent variable. |
b2 |
The slope for the unobserved confounder. |
sigma.disturb |
The standard deviation of the disturbances. |
correl |
The correlation of (observed) x and (unobserved) z. |
A list of two matrices. The first matrix contains the x values from each simulation, with one simuluation in each row. The second matrix contains the y values in the same configuration.
1 | sim.2var(10, 5, a = 3, b1 = 1/2, b2 = 1/5, sigma.disturb = 1, correl = .5)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.