library(tidyverse)
library(rdrobust)
library(rdlocrand)
hansen <- haven::read_dta(
"https://github.com/kylebutts/UARK_5783/raw/refs/heads/main/Slides/04_RDD/data/hansen_dwi.dta"
)
est_rdlocrand <- rdlocrand::rdrandinf(
Y = hansen$recidivism,
R = hansen$bac1,| ## Adapated from bipartitepandas python package | |
| #' Simulate Bipartite Labor Market Network | |
| #' | |
| #' Generates panel data for a bipartite network of workers and firms with | |
| #' assortative matching, mobility, and AKM wage structure. | |
| #' | |
| #' @param n_workers Integer. Number of workers (default: 10000) | |
| #' @param n_time Integer. Panel length in time periods (default: 5) | |
| #' @param firm_size Numeric. Average firm size per period (default: 50) |
Source: https://www.census.gov/geographies/reference-files/time-series/geo/addcountlisting.html
Block-level housing units count for the following dates: June 2022 and biannually for 2023 through 2025
The Address Count Listing Files are available for download from our file transfer protocol (FTP) site. The files include total housing units and total group quarters counts by census tabulation block from the tabs below. They are generated twice a year based on data from July and November and include data for all 50 States, the District of Columbia, Puerto Rico, and the Island Areas.
| triangle_info <- function(A, B, C) { | |
| # Helper function to compute distance between two points | |
| dist <- function(P, Q) sqrt((P[1] - Q[1])^2 + (P[2] - Q[2])^2) | |
| # Side lengths | |
| dist_AB <- dist(A, B) | |
| dist_AC <- dist(A, C) | |
| dist_BC <- dist(B, C) | |
| # Law of Cosines for each angle |
- Download the files with
gh repo clone posit-dev/positronin some directory npm ifrom the main directory to install packagesnpm run watchfrom the main directory to compile client and extensions (watch-clientandwatch-extensions). This will run continuously in the background, so you need a second terminal window
The npm test-extension takes way too long as it runs all tests. The -g and -l options do not seem to work.
Instead, I recommend opening the positron folder with vscode and it will prompt you to install a task running extension.
library(tidyverse)
library(spatstat)
#> Loading required package: spatstat.data
#> Loading required package: spatstat.univar
#> spatstat.univar 3.1-1
#> Loading required package: spatstat.geom
#> spatstat.geom 3.3-5
#> Loading required package: spatstat.random
#> spatstat.random 3.3-2This famous theorem states that when you have:
- A large number of independent trials (
$n \to \infty$ ) - Each trial has a small probability of success (
$p \to 0$ ) - The expected number of successes (
$\lambda = np$ ) remains constant
| * https://github.com/py-econometrics/pyfixest/issues/672 | |
| . use "~/Downloads/census2000_5pc.dta", clear | |
| (5% Extract from 2000 US Census (from Abadie et al., 2023)) | |
| . | |
| . // set 1 | |
| . b1x2 ln_earnings, x1all(educ) x2all(hours) | |
| Number of obs = 2632838 |
library(ggplot2)
beta <- seq(-0.2, 0.2, by = 0.001)
exp_minus_1 <- exp(beta) - 1(plot_pct_change_appxoimation <- ggplot() +
geom_line(
aes(x = beta, y = beta, color = "approx"),# Modified to use `sf` from this article:
# https://rud.is/b/2014/11/16/moving-the-earth-well-alaska-hawaii-with-r/
library(sf)
#> Linking to GEOS 3.11.0, GDAL 3.5.3, PROJ 9.1.0; sf_use_s2() is TRUE
library(tigris)
#> To enable caching of data, set `options(tigris_use_cache = TRUE)`
#> in your R script or .Rprofile.
library(rmapshaper)
library(ggplot2)