I hereby claim:
- I am gzt on github.
- I am gzthompson (https://keybase.io/gzthompson) on keybase.
- I have a public key whose fingerprint is F9F0 FBDC 6222 DD1B EAB4 472F 0A6F 3578 AC65 300E
To claim this, I am signing this object:
;; .emacs | |
;; now init.el | |
;; Added by Package.el. This must come before configurations of | |
;; installed packages. Don't delete this line. If you don't want it, | |
;; just comment it out by adding a semicolon to the start of the line. | |
;; You may delete these explanatory comments. | |
(require 'package) | |
(let* ((no-ssl (and (memq system-type '(windows-nt ms-dos)) | |
(not (gnutls-available-p)))) |
# somebody had a question about manually computing reg coefficients | |
# and accidentally did it with no slope, so I'm demonstrating | |
# might as well make it a gist | |
set.seed(20201114) | |
x <- runif(100, 0, 20) | |
y <- 0.5 + 0.5 * x + rnorm(100, 0, 2) | |
coef(lm(y ~ x)) | |
coef(lm(y ~ -1 + x)) | |
cor(y, x) * sd(y) / sd(x) | |
X <- as.matrix(x) |
devtools::install_github('gzt/catsim') | |
library('catsim') | |
length = 10000 | |
rescohen = numeric(1000) | |
resrand = numeric(1000) | |
numvec = numeric(1000) | |
probabilities = 10:1/sum(10:1) | |
for(i in 1:1000){ | |
x <- sample(1:10, length, replace = TRUE, probabilities) | |
y <- x |
# https://www.reddit.com/r/IAmA/comments/8m21kw/i_am_dr_jordan_b_peterson_u_of_t_professor/dzkha8k/ | |
# this economist produces a clean example in STATA of why controlling for occupation when exploring | |
# the wage gap is wrong. I reproduce it in R because somebody asked. | |
female = c(rep(0,100),rep(1,100)) | |
tech_job_cost =rep((1:100)/100,2) | |
tech_job = ifelse(((female & tech_job_cost>=0.6) | (!female & tech_job_cost>=0.5)),1,0) | |
# not the cleanest way of doing it, but whatevs! | |
wage_1 = ifelse( (!female & tech_job), 1, 0) |
I hereby claim:
To claim this, I am signing this object: