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]) |
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
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
use "http://www.stata-press.com/data/r13/grunfeld", clear | |
reghdfe mvalue invest kstock, noab cl(company year) | |
vce |
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 is the draft code for generalizing GLM to vector generalized linear models (VGLM) | |
# Compared to Stata's mlogit (13.1) and R's multinom {nnet}, need to verify and correct mlogit vcov | |
# Code tested with Julia v"0.7.0-DEV.4993" | |
# Special Matrices | |
using LinearAlgebra: Hermitian, LowerTriangular, UpperTriangular, Diagonal | |
# Factorizations | |
using LinearAlgebra: Factorization, qrfact, cholfact!, QRPivoted, norm | |
# Functions | |
using LinearAlgebra: mul!, diag, copytri! |
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
# Author: José Bayoán Santiago Calderón (@Nosferican) | |
# Set up the environment for this application | |
using Distributions: Normal, TDist | |
using Plots: Plot, PyPlotBackend, plot, density, savefig, plot!, pyplot | |
using StatPlots: StatPlots, @df | |
using Random: seed! | |
using Statistics: mean, quantile | |
using StatsBase: coef, coefnames, confint, countmap, dof_residual, levelsmap, |
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
1.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1.0 | 1.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | |
1.0 | 0.0 | 1.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 1.0 | 1.0 | 0.0 | |
1.0 | 0.0 | 0.0 | 1.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | |
1.0 | 0.0 | 0.0 | 0.0 | 1.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 1.0 | 1.0 | 0.0 | |
1.0 | 0.0 | 0.0 | 0.0 | 0.0 | 1.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 1.0 | 1.0 | 0.0 | |
1.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 1.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | |
1.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 1.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 1.0 | 1.0 | 0.0 | |
1.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 1.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | |
1.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 1.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 |
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 Pkg.TOML: parsefile | |
using Base.Iterators: flatten | |
pkgs = ((d for d in readdir(dir) if occursin(r"^[(aA-zZ|0-9)]+$", d)) | |
for dir in joinpath.(first(DEPOT_PATH),"registries","General", string.('A':'Z'))) |> | |
flatten |> | |
collect | |
""" | |
cap(v::AbstractString) |
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
/*** SAS code for examples in Chapter 4 of ***/ | |
/*** Bioequivalence and Statistics in Clinical Pharmacology, ***/ | |
/*** by Scott Patterson and Byron Jones,***/ | |
/*** Chapman and Hall/CRC Press: Boca Raton, London and New York, 2005.***/ | |
/*** WARNING : PROGRAM OFFERED FOR USE WITHOUT ANY GUARANTEES ***/ | |
/*** NO LIABILITY IS ACCEPTED FOR ANY LOSS RESULTING FROM USE OF ***/ | |
/*** THIS SET OF SAS INTRUCTIONS ***/ |
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
id | sequence | period | AUC | formulation | |
---|---|---|---|---|---|
1 | TT | 1 | 5.634789603169249 | T | |
1 | TT | 2 | 6.1779441140506 | T | |
2 | TT | 1 | 5.389071729816501 | T | |
2 | TT | 2 | 5.081404364984463 | T | |
3 | TT | 1 | 5.438079308923196 | T | |
3 | TT | 2 | 4.59511985013459 | T | |
4 | TT | 1 | 5.43372200355424 | T | |
4 | TT | 2 | 5.560681631015528 | T | |
5 | TT | 1 | 6.202535517187923 | T |
OlderNewer