KClass: k-Class Estimator

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/KClass.r

Description

KClass computes the k-Class estimate for the ivmodel object.

Usage

1
2
3
KClass(ivmodel, 
       beta0 = 0, alpha = 0.05, k = c(0, 1),
       heteroSE = FALSE,clusterID = NULL)

Arguments

ivmodel

ivmodel object.

beta0

Null value β_0 for testing null hypothesis H_0: β = β_0 in ivmodel. Default is 0.

alpha

The significance level for hypothesis testing. Default is 0.05.

k

A vector of k values for the k-Class estimator. Default is 0 (OLS) and 1 (TSLS).

heteroSE

Should heteroscedastic-robust standard errors be used? Default is FALSE.

clusterID

If cluster-robust standard errors are desired, provide a vector of length that's identical to the sample size. For example, if n = 6 and clusterID = c(1,1,1,2,2,2), there would be two clusters where the first cluster is formed by the first three observations and the second cluster is formed by the last three observations. clusterID can be numeric, character, or factor.

Details

KClass computes the k-Class estimate for the instrumental variables model in ivmodel, specifically for the parameter β. It generates a point estimate, a standard error associated with the point estimate, a test statistic and a p value under the null hypothesis H_0: β = β_0 in ivmodel along with a 1-α confidence interval.

Value

KClass returns a list containing the following components

k

A row matrix of k values supplied to KClass.

point.est

A row matrix of point estimates of β, with each row corresponding to the k values supplied.

std.err

A row matrix of standard errors of the estimates, with each row corresponding to the k values supplied.

test.stat

A row matrix of test statistics for testing the null hypothesis H_0: β = β_0 in ivmodel, with each row corresponding to the k values supplied.

p.value

A row matrix of p value of the test under the null hypothesis H_0: β = β_0 in ivmodel, with each row corresponding to the k values supplied.

ci

A matrix of two columns specifying the confidence interval, with each row corresponding to the k values supplied.

Author(s)

Yang Jiang, Hyunseung Kang, and Dylan Small

See Also

See also ivmodel for details on the instrumental variables model.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
data(card.data)
Y=card.data[,"lwage"]
D=card.data[,"educ"]
Z=card.data[,c("nearc4","nearc2")]
Xname=c("exper", "expersq", "black", "south", "smsa", "reg661", 
        "reg662", "reg663", "reg664", "reg665", "reg666", "reg667", 
		"reg668", "smsa66")
X=card.data[,Xname]
card.model2IV = ivmodel(Y=Y,D=D,Z=Z,X=X)
KClass(card.model2IV,
          k=c(0,1,length(Y)/(length(Y) - ncol(X) - ncol(Z) + 1)))

ivmodel documentation built on Nov. 17, 2017, 4:09 a.m.