Chapter 5 Lecture 09
5.1 Generative model
library(simcausal)
<- 1000
N
<- sample(1:2, size = N, replace = TRUE)
G
<- rbern(N, ifelse(G==1, 0.3, 0.8)) + 1
D
<- matrix(c(0.05, 0.2, 0.1, 0.3), nrow = 2)
accept_rate
<- rbern(N, accept_rate[D, G]) A
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