- Sections and subsections numbered like "II.A.1" (add following to end of preamble)
-
\renewcommand{\thesection}{\Roman{section}} -
\renewcommand{\thesubsection}{\thesection.\Alph{subsection}} -
\renewcommand{\thesubsubsection}{\thesubsection.\arabic{subsubsection}}
-
- roman numeraled endnotes instead of footnotes (add following to preamble)
- \usepackage{endnotes}
- \let\footnote=\endnote
- \renewcommand{\theendnote}{\roman{endnote}}
- put "\theendnotes" just before the online appendix
This file contains hidden or 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
| function normalMLE(b::Vector,Y::Array,X::Array,w::Array=ones(size(Y)),d::Array=ones(size(Y)),J::Int64=1) | |
| @assert size(Y,1)==size(X,2) "X and Y must be the same length" | |
| T = promote_type(eltype(b), eltype(X)) | |
| like = zero(T) | |
| @inbounds for i=1:size(Y,1) | |
| xb = zero(T) | |
| for j in 1:size(X,1) | |
| xb += X[j, i] * b[j] | |
| end |
This file contains hidden or 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
| #!/bin/bash | |
| #Download source | |
| wget http://mirrors.concertpass.com/gcc/releases/gcc-4.7.2/gcc-4.7.2.tar.bz2 | |
| tar xvfj gcc-4.7.2.tar.bz2 | |
| cd gcc-4.7.2 | |
| ./contrib/download_prerequisites | |
| #Download and apply fix to be able to build GCC 4.7 with GCC 5.x |
This file contains hidden or 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 DataFrames | |
| using HTTP | |
| using uCSV | |
| using JuMP | |
| using GLPK | |
| using Cbc | |
| # read in the data | |
| fname = "https://gist.githubusercontent.com/tyleransom/3738fa6cd1b3b5602e0621b08d068380/raw/5c4b139639d7b3c16716289b0232b8528d1bf494/mwe.csv" | |
| data = DataFrame(uCSV.read(IOBuffer(HTTP.get(fname).body), quotes='"', header=1)) |
This file contains hidden or 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 | male | income | size | choicecat | dealer1 | dealer2 | dealer3 | |
|---|---|---|---|---|---|---|---|---|
| 1 | 1 | 46.7 | 2 | 3 | 18 | 8 | 5 | |
| 2 | 1 | 26.1 | 3 | 1 | 17 | 6 | 2 | |
| 3 | 1 | 32.7 | 4 | 1 | 12 | 6 | 2 | |
| 4 | 0 | 49.2 | 2 | 2 | 18 | 7 | 4 | |
| 5 | 1 | 24.3 | 4 | 1 | 10 | 7 | 3 | |
| 6 | 0 | 39 | 4 | 1 | 13 | 4 | 1 | |
| 7 | 1 | 33 | 2 | 1 | 24 | 7 | 4 | |
| 8 | 1 | 20.3 | 4 | 1 | 9 | 3 | 3 | |
| 9 | 1 | 38 | 3 | 2 | 14 | 10 | 2 |
This file contains hidden or 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 Random | |
| using LinearAlgebra | |
| using Statistics | |
| using Distributions | |
| using DataFrames | |
| using OrderedCollections | |
| using SMM | |
| Random.seed!(1234) |
This file contains hidden or 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
| library(tidyverse) | |
| library(magrittr) | |
| devtools::load_all('~/lfe') # dev branch of lfe from @grant_mcdermott; see https://twitter.com/grant_mcdermott/status/1313900416342474752?s=20 | |
| df <- read_csv("https://raw.githubusercontent.com/OU-PhD-Econometrics/fall-2020/master/ProblemSets/PS4-mixture/nlsw88t.csv") | |
| df %<>% mutate(occ_code = as.factor(occ_code)) | |
| felm(elnwage5 ~ occ_code | year + idcode, data=df) | |
| # stata equivalent: | |
| # insheet using "https://raw.githubusercontent.com/OU-PhD-Econometrics/fall-2020/master/ProblemSets/PS4-mixture/nlsw88t.csv", comma case | |
| # areg elnwage5 i.occ_code i.year, absorb(idcode) |
This file contains hidden or 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
| library(tidyverse) | |
| letters <- read_csv("https://gist.githubusercontent.com/tyleransom/c197d17b745870a464926435b95d7d9c/raw/3fd2cf7f50ecd9c04bd5adfbe4892f490730a560/beads.csv") | |
| ggplot(data=letters, aes(x=`letter/character`)) + | |
| geom_bar() + | |
| geom_text(stat='count', aes(label=..count..), vjust=-1) + | |
| theme_minimal() |
This file contains hidden or 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
| library(NHANES) | |
| library(tidyverse) | |
| library(magrittr) | |
| library(modelsummary) | |
| df <- as_tibble(NHANES) | |
| datasummary_skim(df, type="categorical") | |
| datasummary_skim(df, type="numeric") |
This file contains hidden or 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
| wait_for_key(prompt) = (print(stdout, prompt); read(stdin, 1); nothing) | |
| user_input(prompt) = (print(prompt); p = readline(); p) | |
| function spin() | |
| wait_for_key("Press enter to spin\n") | |
| spun = rand(1:6) | |
| println("You spun a ",spun) | |
| return spun | |
| end |