Skip to contents

Run Klein & Vella demonstration

Usage

run_klein_vella_demo(n = .hetid_const("N_SMALL"), verbose = TRUE)

Arguments

n

Sample size (default: 500)

verbose

Whether to print results

Value

Invisibly returns the results

Examples

run_klein_vella_demo()
#> 
#> ====================================
#> Klein & Vella (2010) Demonstration
#> ====================================
#> 
#> Klein & Vella configuration created:
#>   Sample size: 500
#>   Number of X variables: 1
#>   True gamma1: -0.800
#>   Error correlation: 0.600
#> 
#> Generating data...
#> 
#> OLS estimation (ignoring endogeneity)...
#> 
#> Klein & Vella parametric estimation...
#> 
#> === Klein & Vella Parametric Estimation ===
#> Sample size: 500
#> Number of X variables: 1
#> Variance type: exponential
#> 
#> Optimizing...
#> Warning: Could not compute standard errors: Lapack routine dgesv: system is exactly singular: U[5,5] = 0
#> 
#> Estimation complete.
#> gamma1 estimate: -0.1208 (SE: NA)
#> rho estimate: 0.0000 (SE: NA)
#> 
#> 
#> === RESULTS COMPARISON ===
#> True gamma1:         -0.8000
#> OLS estimate:        -0.1208 (bias: +0.6792)
#> K&V estimate:             NA (bias: NA)
#> 
#> True rho:              0.6000 
#> K&V rho estimate:      0.0000 
#> 
#> Note: For semiparametric estimation, use klein_vella_semiparametric()