Description Usage Arguments Value Dependencies Author(s) References See Also Examples
View source: R/gammaMatrix-gammacap_ols_generic.R
Calculates the asymptotic covariance matrix of the unique elements of the covariance matrix using ordinary least squares estimates.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
x |
Numeric matrix, data frame, or vector. Values for regressor variables. |
beta |
Numeric vector. Partial regression slopes. |
sigmacap |
Numeric matrix. Covariance matrix \boldsymbol{Σ} of \{y, x_1, \cdots, x_p \}^{\prime}. |
sigmasq |
Numeric. Error variance σ^2. |
ke |
Numeric. Kurtosis of errors. |
type |
Character string.
Type of asymptotic covariance matrix of the regressors
If |
adf_unbiased |
Logical.
If |
bcap |
Integer.
Number of bootstrap samples
when |
seed |
Integer.
Random number generation seed
when |
yc |
Logical.
If |
names |
Logical. Add names. |
sep |
Character string. Separator for variable names. |
A matrix.
dcap()
vechnames()
rmvn_chol()
(test)
Ivan Jacob Agaloos Pesigan
Yuan, K.-H., & Chan, W. (2011). Biases and standard errors of standardized regression coefficients. Psychometrika, 76, 670–690. doi:10.1007/S11336-011-9224-6.
Other Gamma Matrix Functions:
gammacap_adfnb()
,
gammacap_adf()
,
gammacap_gen()
,
gammacap_mvnadj1()
,
gammacap_mvnadj2()
,
gammacap_mvn()
,
gammacap_nb()
,
gammacap_ols_hc_generic()
,
gammacap_ols_hc_qcap_generic()
,
gammacap_ols_hc_qcap()
,
gammacap_ols_hc()
,
gammacap_ols()
,
gammacapnames()
,
gammacap()
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | set.seed(42)
n <- 1000
k <- 2
z <- matrix(
data = rnorm(n = n * k), nrow = n, ncol = k
)
q <- chol(
matrix(
data = c(1.0, 0.5, 0.5, 1.0),
nrow = k, ncol = k
)
)
x <- as.data.frame(z %*% q)
colnames(x) <- c("y", "x")
obj <- lm(y ~ x, data = x)
beta <- coef(obj)[-1]
sigmacap <- cov(x)
sigmasq <- summary(obj)$sigma^2
ke <- 3
gammacap_ols_generic(
x[, -1],
beta = beta,
sigmacap = sigmacap,
sigmasq = sigmasq,
ke = ke
)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.