We use rclone
to mount OneDrive as a network share in the directory ~/OneDrive
.
First, log in as the user who needs OneDrive, and create the directory:
mkdir ~/OneDrive
Then configure rclone:
rclone config
sysuse auto, clear | |
* separately add required estimate to each model and store models | |
foreach yvar in mpg price length { | |
foreach xvar in weight foreign { | |
reg `yvar' `xvar' | |
lincomestadd `xvar', statname(`xvar'_) | |
eststo `yvar'_`xvar' | |
} | |
} |
library(tidyverse) | |
library(viridis) | |
cbo_elast_2021 <- -0.48 | |
cbo_elast_2019 <- -0.38 | |
dube_elast_2019 <- -0.04 | |
emp_effects <- tribble( | |
~source, ~emp, |
library(tidyverse) | |
library(haven) | |
library(data.table) | |
clean_qcew_annual <- function(x) { | |
# QCEW data from https://www.bls.gov/cew/downloadable-data-files.htm | |
fread(cmd = paste0("unzip -p ", x, "_annual_singlefile.zip")) %>% | |
# keep only county-level private sector | |
filter(agglvl_code == 71 & own_code == 5) %>% |
summarize_groups <- function(.data, .groups, ...) { | |
dots <- enquos(...) | |
map_dfr(.groups, ~ summarize_onegroup(.data, all_of(.x), !!!dots)) %>% | |
relocate(name, value) | |
} | |
summarize_onegroup <- function(.data, .group, ...) { | |
data <- .data %>% | |
rename(value = {{ .group }}) %>% |
library(tidyverse) | |
mydata <- mtcars | |
groups <- c("cyl", "gear", "carb") | |
group_summarize <- function(x) { | |
mydata %>% | |
rename(group_value = {{ x }}) %>% | |
group_by(group_value) %>% |
YEAR | JAN | FEB | MAR | APR | MAY | JUNE | JULY | AUG | SEP | OCT | NOV | DEC | AVG | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1977 | 100.0 | |||||||||||||
1978 | 100.5 | 101.1 | 101.8 | 102.7 | 103.6 | 104.5 | 105.0 | 105.5 | 106.1 | 106.7 | 107.3 | 107.8 | 104.4 | |
1979 | 108.7 | 109.7 | 110.7 | 111.8 | 113.0 | 114.1 | 115.1 | 116.0 | 117.1 | 117.9 | 118.5 | 119.5 | 114.3 | |
1980 | 120.8 | 122.4 | 123.8 | 124.7 | 125.7 | 126.7 | 127.5 | 128.6 | 129.9 | 130.7 | 131.5 | 132.4 | 127.1 | |
1981 | 133.6 | 135.2 | 136.3 | 137.1 | 137.9 | 138.7 | 139.7 | 140.7 | 141.8 | 142.4 | 142.9 | 143.4 | 139.1 | |
1982 | 144.2 | 144.7 | 144.9 | 145.0 | 146.1 | 147.5 | 148.5 | 148.8 | 149.5 | 150.2 | 150.5 | 150.6 | 147.5 | |
1983 | 151.0 | 151.1 | 151.2 | 152.4 | 153.2 | 153.7 | 154.3 | 154.8 | 155.6 | 156.0 | 156.2 | 156.4 | 153.8 | |
1984 | 157.2 | 158.0 | 158.3 | 159.1 | 159.5 | 160.0 | 160.5 | 161.1 | 161.8 | 162.2 | 162.2 | 162.4 | 160.2 | |
1985 | 162.6 | 163.2 | 164.0 | 164.6 | 165.3 | 165.7 | 166.0 | 166.4 | 166.9 | 167.3 | 167.9 | 168.2 | 165.7 |
library(tidyverse) | |
library(vroom) | |
# sector names | |
sector_names <- read_csv("https://raw.githubusercontent.com/Economic/ui_state_detailed/master/output/state_ui_industry_recoded.csv") %>% | |
group_by(sector, sectorname) %>% | |
tally() %>% | |
select(sector, sector_name = sectorname) | |
# Read in 2019 March CPS |
clear all | |
set more off | |
* download CES data, if new | |
!wget -N https://download.bls.gov/pub/time.series/ce/ce.data.0.AllCESSeries | |
!wget -N https://download.bls.gov/pub/time.series/ce/ce.series | |
!wget -N https://download.bls.gov/pub/time.series/ce/ce.industry | |
* identify 3-digit industries | |
insheet using ce.industry, clear tab |
We use rclone
to mount OneDrive as a network share in the directory ~/OneDrive
.
First, log in as the user who needs OneDrive, and create the directory:
mkdir ~/OneDrive
Then configure rclone:
rclone config
marchcps %>% | |
# adult/af universe for health insurance q | |
filter(prpertyp == 2 | prpertyp == 3) %>% | |
# workers last year with industry info | |
filter(industry > 0) %>% | |
# keep only private and public emp (drop self employed & without pay) | |
filter(clwk == 1 | clwk == 2) %>% | |
# convert 2012 Census industry codes to NAICS sectors | |
# using codebook https://www2.census.gov/programs-surveys/demo/guidance/industry-occupation/census-2012-final-code-list.xls | |
mutate( |