Description Usage Arguments Value Examples
This function estimates regression coefficients using a randomly selected subset of the full dataset.
1 | algo_leverage(Y, X, rsize, method)
|
Y |
= response vector |
X |
= covariate data frame |
rsize |
= the subset sample size |
method |
= either "Uniform" or "Leverage" for weighting |
output of coefficient estimates, with t-statistic and p-value
1 2 3 4 5 6 7 8 9 10 | set.seed(123)
fullX <- rt(500, df=6)
fullY <- -1*fullX + rnorm(100)
fullDF <- data.frame(fullY, fullX)
plot(fullX, fullY, main="Full Sample")
summary(lm(fullY ~ fullX))$coef #True coefficients, compare with uniform/leverage output
algo_leverage(fullY, data.frame(fullX), rsize = 200, method="Uniform")
algo_leverage(fullY, data.frame(fullX), rsize = 200, method="Leverage")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.