Learn R Programming

erfe (version 0.0.1)

erfeVecR: Dexpectilize a vector according the a single asymmetric point

Description

This function is part of the erfe package. It estimates the ERFE model for a panel dataset and for a single asymmetric point \(\tau \in (0, 1)\). When \(\tau=0.5\) the function estimate the classical within-transformation estimator and its sandwich covariance matrix.

Usage

erfeVecR(xmat, yvec, panSizeVec, asym, id)

Value

Return a list of objects related to the erfe model such as the asymmetric point, the coefficient-estimate, the standard deviation, the estimated covariance.

Arguments

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.

Author

Amadou Barry, barryhafia@gmail.com

References

Barry, Amadou, Oualkacha, Karim, and Charpentier Arthur. (2022). Weighted asymmetric least squares regression with fixed-effects. arXiv preprint arXiv:2108.04737

Examples

Run this code
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)

Run the code above in your browser using DataLab