This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (!any(grepl(pattern = 'pacman', x = installed.packages()[,1]))) { | |
install.packages('pacman') | |
} | |
pacman::p_load(dplyr, plm, multiwayvcov) | |
df = data(Grunfeld, package = 'plm') | |
model = lm(formula = value ~ inv + capital, | |
data = Grunfeld) | |
vcov_both = multiwayvcov::cluster.vcov(model, select(Grunfeld, firm, year)) | |
diag(vcov_both)[2:3] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## This skeleton provides a framework to develop a benchmark for various routines using QRupdate | |
## The following example tests the efficiency of obtaining the subset of linearly independent columns from | |
## various matrices. An application of these procedures is for instrumental least squares estimators (e.g., 2SLS). | |
using QRupdate | |
srand(0) | |
m = Int(1e6) | |
X = rand(m, 3) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Using modified forks to test code (mostly fixed depreciations, but can inspect the changes at the link) | |
using DataFrames # From https://github.com/JuliaEconometrics/DataFrames.jl | |
using Feather | |
using StatsModels # From https://github.com/JuliaEconometrics/StatsModels.jl | |
df = Feather.read("NLS.feather") # Feather file from Stata's webuse nlswork | |
df = df[[:idcode, :year, :ln_wage, :age, :race, :union, :ttl_exp]] | |
df[:idcode] = string.(df[:idcode]) | |
df[:year] = string.(df[:year]) |
NewerOlder