Read the model formula and split it into the parametric and nonparametric partitions
Read the model formula and split it into the parametric and nonparametric partitions
Read the model formula and split it into two new ones concerning the parametric and nonparametric partitions of the predictor.
formparser(formula, env=parent.frame())
Arguments
formula: object representing the model formula. standard for GLM models
parent.frame: an environment to be used as the parent of the environment created
Details
This function extracts all the information in the model formula. Most important, split the model into two parts regarding the parametric nature of the model. A model can be specified as following:
Yf(sfr)+V1+V2+V3+g(V4,df4)+g(V5,df5)
where sfr is a seasonal factor with period r and dfi is the degree of freedom of the smoother of the i-th covariate. Actually, two new formulae will be created:
sf1+⋯+sfr+V1+V2+V3
and
V4+V5
These two formulae will be used to build the necessary datasets for model estimation. Dummy variables reproducing the seasonal factors will be created also.
Models without explanatory variables must be specified as in the following formula
YNULL
Returns
List containing the information needed for model fitting.