model.matrix-methods {gmm4} | R Documentation |
model.matrix
in Package stats ~~Model matrix form gmmModels
. It returns the matrix of regressors
or the instruments. In restricted models, it returns the reduced matrix
of regressors.
## S4 method for signature 'linearGmm' model.matrix(object, type=c("regressors","instruments")) ## S4 method for signature 'rlinearGmm' model.matrix(object, type=c("regressors","instruments")) ## S4 method for signature 'nonlinearGmm' model.matrix(object, type=c("regressors","instruments")) ## S4 method for signature 'slinearGmm' model.matrix(object, type=c("regressors","instruments")) ## S4 method for signature 'rslinearGmm' model.matrix(object, type=c("regressors","instruments")) ## S4 method for signature 'snonlinearGmm' model.matrix(object, type=c("regressors","instruments"))
object |
Object of class |
type |
Should the function returns the matrix of instruments or the
matrix of regressors. For |
signature(object = "linearGmm")
Linear models with not restrictions.
signature(object = "nonlinearGmm")
Nonlinear models with not restrictions.
signature(object = "rlinearGmm")
linear models with restrictions.
signature(object = "slinearGmm")
System of linear equations with no restrictions.
signature(object = "rslinearGmm")
System of linear equations with restrictions.
signature(object = "snonlinearGmm")
System of nonlinear equations with no restrictions.
data(simData) ## Unrestricted model model1 <- gmmModel(y~x1+x2+x3, ~x2+x3+z1+z2, data=simData) model.matrix(model1)[1:3,] ## Restrictions change the response R <- c("x2=2","x3+x1=3") rmodel1 <- restGmmModel(model1, R) rmodel1 model.matrix(rmodel1)[1:3,]