Chapter 5 Lecture 09

5.1 Generative model

library(simcausal)
N <- 1000

G <- sample(1:2, size = N, replace = TRUE)

D <- rbern(N, ifelse(G==1, 0.3, 0.8)) + 1 

accept_rate <- matrix(c(0.05, 0.2, 0.1, 0.3), nrow = 2)

A <- rbern(N, accept_rate[D, G])
table(G, D)
##    D
## G     1   2
##   1 350 163
##   2 104 383
table(G, A)
##    A
## G     0   1
##   1 454  59
##   2 397  90

5.2

Is a start, but lots missing

Addmission rate usaully depends upon size of applicant pool, distribution of qualifications

In principle, should sample applicant pool and then sort to select admissions

Rates are conditional on structure of applicant pool.

5.3 Generalized Linear Models

Linear Models

Generalized linear modesl:

Expoected value is some fuction of an additive combination of parameters