Description Usage Arguments Value Examples
Simulates data from a linear model using the sim.lm() function, each time applying a Wald test test the null hypothesis that the slope = B0.
1 2 3 | sim.Wald.B(n, nsim, a, b, B0 = 0, sigma.disturb = 1, mu.x = 8,
sigma.x = 2, rdisturb = rnorm, rx = rnorm, het.coef = 0,
pfun = pnorm, ...)
|
n |
The number of pairs of observations to simulate. |
nsim |
The number of simulations to conduct. |
a |
The intercept parameter of the linear regression model to be simulated. |
b |
The slope parameter of the linear regression model to be simulated. |
B0 |
The value of the slope under the null hypothesis to be tested. |
sigma.disturb |
The variance of the disturbances in the model y = a + b*x + disturbance. |
mu.x |
The expectation of the x values. |
sigma.x |
The variance of the x values. |
rdisturb |
A function for drawing the random disturbances. rnorm() is the default, which makes the disturbances normally distributed, but you can use any function for random number generation with first argument the sample size, second argument the expectation, and third argument the standard deviation. |
rx |
A function for drawing the random x values. rnorm() is the default, which makes x normally distributed, but you can use any function for random number generation with first argument the sample size, second argument the expectation, and third argument the standard deviation. |
het.coef |
A number introducing some heteroscedasticity (i.e. non-constant variance) to the disturbances. If het.coef = 0 (the default), then the disturbances have constant variance. If it is positive, then the standard deviation of the disturbances increases with x; if negative, then the standard deviation of the disturbances decreases with x. |
pfun |
A cumulative distribution function to which to compare the Wald statistic. |
... |
Additional arguments to pfun |
A vector of p values of length nsims, one from each Wald test.
1 | sim.Wald.B(10, 100, 3, .1)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.