Lag shape constructors to be used in model formulas.
ecq(x, a, b, x.group =NULL, nlag =NULL)qd(x, a, b, x.group =NULL, nlag =NULL)ld(x, a, b, x.group =NULL, nlag =NULL)gam(x, a, b, x.group =NULL, nlag =NULL)
Arguments
x: The name of the variable.
a, b: The shape parameters.
nlag: The number of lags considered. If NULL or more than 2/3 of the sample size, it is set equal to 2/3 of the sample size.
x.group: The name of the group factor (optional).
References
A. Magrini (2020). A family of theory-based lag shapes for distributed-lag linear regression. To be appeared on Italian Journal of Applied Statistics.
Examples
data(industry)# example in linear regressionm1 <- lm(Consum ~-1+Region+ecq(Job,0,5,x.group=Region), data=industry)m2 <- lm(Consum ~-1+Region+gam(Job,0.85,0.2,x.group=Region), data=industry)