-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME.Rmd
45 lines (35 loc) · 941 Bytes
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
---
title: "Lecture 2017-04-20"
author: "Jeffrey Arnold"
date: "4/20/2017"
output: html_document
---
```{r}
library("rstan")
library("loo")
```
```{r}
data("Duncan")
mod1_data <- list(
y = Duncan$prestige,
n = nrow(Duncan)
)
X <- model.matrix(prestige ~ type + income + education, data = Duncan)
mod1_data$X <- X
mod1_data$k <- ncol(X)
mod1_data$b_loc <- 0
mod1_data$b_scale <- 1000
mod1_data$sigma_scale <- 50
mod1_fit <- sampling(mod1)
```
# Example of
Western (1995) Table 2. Least Squares and Robust Regression Analysis of the Determinants of Union Density in 20 Advanced Capitalist Countries.
Model of Union Density
```{r}
library("readr")
unionization <- read_tsv(file = "data/western1995/unionization.tsv")
unionization
lm(union_density ~ left_government + labor_force_size + econ_conc,
data = unionization)
X <- model.matrix(union_density ~ left_government + labor_force_size + econ_conc, data = unionization)
```