The following instructions improve on those here by avoiding the need to:
a. Compile the Homebrew binary itself b. Set the path for the Homebrew binary
- Install HomeBrew using the
.pkg
file available here.
libname home '.'; | |
PROC SQL; | |
CREATE TABLE crsp_dates AS | |
SELECT date, intnx('MONTH', date, 0, 'BEGINNING') AS month format=yymmdd10. | |
FROM crsp.msi | |
ORDER BY date; | |
QUIT; | |
DATA crsp_dates; |
libname home '.'; | |
PROC SQL; | |
CREATE TABLE crsp_dates AS | |
SELECT date, intnx('MONTH', date, 0, 'BEGINNING') AS month format=yymmdd10. | |
FROM crsp.msi | |
ORDER BY date; | |
QUIT; | |
DATA crsp_dates; |
library(farr) | |
library(tidyverse) | |
original <- read_csv("~/Downloads/WalkerDataCodeMar2021/original.csv") | |
original |> | |
group_by(fyear) |> | |
summarize(auc = auc(prob, aaer), .groups = "drop") |> | |
mutate(avg_auc = mean(auc)) |
install.packages(c("formatR", "markdown", "tinytex", "downlit", "xml2")) |
library(dplyr, warn.conflicts = FALSE) | |
library(DBI) | |
db <- dbConnect(duckdb::duckdb()) | |
dbExecute(db, "ATTACH '' AS pg (TYPE POSTGRES);") | |
dbExecute(db, "COPY pg.crsp.dsf FROM '/Users/iangow/Library/CloudStorage/Dropbox/pq_data/crsp/dsf.parquet'") | |
create_view <- function(conn, table, schema = "", |
library(httr2) # request(), req_*(), resp_body_html() | |
library(rvest) # html_elements(), html_table() | |
library(tidyverse) | |
extract_team_ids <- function(link_text) { | |
matches <- str_match(link_text, '<a href="teams/(.*)_idx.html">(.*)</a>') | |
team_id <- matches[, 2] | |
team_name <- matches[, 3] | |
tibble(team_id, team_name) | |
} |
library(tidyverse)
library(DBI)
library(googlesheets4)
options(gargle_oauth_email = TRUE)
gs_2024 <- as_sheets_id("1Qymhw_LGN1Z00ip_qswa29yPeZzWvTymD-u-lMY8b-A")
nnhs_2024 <- read_sheet(gs_2024, na = c("", "N/A"))
library(tidyverse)
regions <- c("USA", "Australia", "China")
years <- 2017:2023L
markets <- letters[1:4]
nn <- 1000
sample_n <- function(var, n = nn) {
var <- rlang::ensym(var)