kclassfit | R Documentation |
It estimates linearModel
objects using the K-Class method. It
includes LIML, Fuller, TSLS and OLS.
kclassfit(object, k, type = c("LIML", "Fuller", "BTSLS"), alpha = 1)
getK(object, alpha = 1, returnRes = FALSE)
object |
A model of class |
k |
The numeric value of k for the K-Class estimator. If missing, the value for LIML or Fuller is used. |
type |
Which value of |
alpha |
A parameter for the Fuller method |
returnRes |
Should the function return the matrix of residuals from the first stage regression? |
Let the model be Y=X\beta+U
and the matrix of instruments
be Z
. The K-Class estimator is
(X'(I-kM_z)X)^{-1}(X'(I-kM_z)Y)
. The function getK
can be
used to compute the value of k
for both LIML and Fuller. When
type="BTSLS"
, the bias-adjusted TSLS of Nagar (1959) is
computed.
The function returns an object of class kclassfit
.
data(simData)
theta <- c(beta0=1,beta1=2)
model1 <- momentModel(y~x1, ~z1+z2, data=simData)
kclassfit(model1, type="LIML")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.