getDat.RdIt extract the data from a formula y~z with instrument h and put everything in a matrix. It helps redefine the function \(g(\theta,x)\) that is required by gmm and gel.
getDat(formula, h, data, error=TRUE)The model to be estimated is based on the moment conditions
\(<h,(y-z\theta)>=0\). It adds a column of ones to z and h by
default. They are removed if -1 is added to the formula.
The error argument has been added for sysGmm with common
coefficients because the check is only valid for
equation by equation identification.
x: A \(n \times l\) matrix, where \(l = ncol(y)+ncol(z)+ncol(h)+2\) if "intercept" is TRUE and \(ncol(y)+ncol(z)+xcol(h)\) if "intercept" is FALSE.
nh: dimension of h
k: dimension of z
ny: dimension of y