erfeVecR | R Documentation |
This function is part of the erfe package. It estimates the ERFE model for a panel dataset and for a single asymmetric point τ \in (0, 1). When τ=0.5 the function estimate the classical within-transformation estimator and its sandwich covariance matrix.
erfeVecR(xmat, yvec, panSizeVec, asym, id)
xmat |
Numeric vector to de-expectilize. |
yvec |
Numeric vector of individual asymmetric weight. |
panSizeVec |
Numeric vector to individual panel size. |
asym |
Numeric vector to individual panel size. |
id |
Numeric vector to individual panel size. |
Return a list of objects related to the erfe model such as the asymmetric point, the coefficient-estimate, the standard deviation, the estimated covariance.
Amadou Barry, barryhafia@gmail.com
Barry, Amadou, Oualkacha, Karim, and Charpentier Arthur. (2022). Weighted asymmetric least squares regression with fixed-effects. arXiv preprint arXiv:2108.04737
set.seed(13) temps_obs <- 5 n_subj <- 50 sig <- diag(rep(1,temps_obs)) id <- rep(1:n_subj, each=temps_obs) rvec <- c(mvtnorm::rmvnorm(n_subj, sigma = sig)) fvec <- (1 + rep(rnorm(n_subj) , each=temps_obs)) xmat <- cbind(rt(n_subj*temps_obs, df=2, ncp=1.3), 1.2 * fvec + rnorm(n_subj * temps_obs, mean = 0.85, sd = 1.5) ) yvec <- 0.6*xmat[, 1] + xmat[, 2] + fvec + rvec asym <- 0.5 panSizeVec <- unname(unlist(lapply(split(id, id), function(x) length(x)))) erfeVecR(xmat, yvec, panSizeVec, asym, id)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.