Skip to content

Commit 6fc5210

Browse files
committed
fixed R script, updated README, polls.dat now has 1 row per survey
1 parent ac8e1f4 commit 6fc5210

File tree

3 files changed

+44
-130
lines changed

3 files changed

+44
-130
lines changed

ARM/Ch.2/2.3_CI.R

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,12 @@ m + geom_point() + scale_y_continuous("Percentage Support for the Death Penalty"
4141

4242
# Weighted averages
4343

44+
N <- c(65633200,80523700,59685200) # population sizes FR, DE, IT
45+
p <- c(0.55,0.61,0.38) # estimated proportions of Yes responses
46+
se <- c(0.02,0.03,0.03)
47+
4448
w.avg <- sum(N*p)/sum(N)
45-
se.w.av <- sqrt (sum ((N*se/sum(N))^2))
49+
se.w.avg <- sqrt (sum ((N*se/sum(N))^2))
4650
int.95 <- w.avg + c(-2,2)*se.w.avg
4751

4852
# CI using simulations

ARM/Ch.2/README

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
11
Data
22
====
33

4+
1 polls.dat - Gallup poll data support for death penalty by year - fig 2.3
5+
5 columns per row
6+
c1 : year
7+
c2 : month
8+
c3 : supports death penalty
9+
c4 : opposed to death penalty
10+
c5 : no opinion
411

512
Models
613
======
7-

ARM/Ch.2/polls.dat

Lines changed: 32 additions & 128 deletions
Original file line numberDiff line numberDiff line change
@@ -1,128 +1,32 @@
1-
2002 10
2-
70
3-
25
4-
05
5-
2002 5
6-
72
7-
25
8-
03
9-
2001 10
10-
68
11-
26
12-
06
13-
2001 5
14-
65
15-
27
16-
08
17-
2001 2
18-
67
19-
25
20-
08
21-
2000 8
22-
67
23-
28
24-
05
25-
2000 6
26-
66
27-
26
28-
08
29-
2000 2
30-
66
31-
28
32-
06
33-
1999 5
34-
71
35-
22
36-
07
37-
1995 9
38-
77
39-
13
40-
10
41-
1994 9
42-
80
43-
16
44-
04
45-
1991 6
46-
76
47-
18
48-
06
49-
1988 9.5
50-
79
51-
16
52-
05
53-
1988 9
54-
79
55-
16
56-
05
57-
1986 1
58-
70
59-
22
60-
08
61-
1985 9
62-
75
63-
17
64-
08
65-
1985 1
66-
72
67-
20
68-
08
69-
1981 1.5
70-
66
71-
25
72-
09
73-
1978 3
74-
62
75-
27
76-
11
77-
1976 4
78-
66
79-
26
80-
08
81-
1972 11
82-
57
83-
32
84-
11
85-
1972 3
86-
50
87-
41
88-
09
89-
1971 10.5
90-
49
91-
40
92-
11
93-
1969 1
94-
51
95-
40
96-
09
97-
1967 6
98-
54
99-
38
100-
08
101-
1966 5
102-
42
103-
47
104-
11
105-
1965 1
106-
45
107-
43
108-
12
109-
1960 3
110-
53
111-
36
112-
11
113-
1957 8.5
114-
47
115-
34
116-
18
117-
1956 3.5
118-
53
119-
34
120-
13
121-
1953 9
122-
68
123-
25
124-
07
125-
1937 12
126-
60
127-
33
128-
07
1+
2002 10 70 25 05
2+
2002 5 72 25 03
3+
2001 10 68 26 06
4+
2001 5 65 27 08
5+
2001 2 67 25 08
6+
2000 8 67 28 05
7+
2000 6 66 26 08
8+
2000 2 66 28 06
9+
1999 5 71 22 07
10+
1995 9 77 13 10
11+
1994 9 80 16 04
12+
1991 6 76 18 06
13+
1988 9.5 79 16 05
14+
1988 9 79 16 05
15+
1986 1 70 22 08
16+
1985 9 75 17 08
17+
1985 1 72 20 08
18+
1981 1.5 66 25 09
19+
1978 3 62 27 11
20+
1976 4 66 26 08
21+
1972 11 57 32 11
22+
1972 3 50 41 09
23+
1971 10.5 49 40 11
24+
1969 1 51 40 09
25+
1967 6 54 38 08
26+
1966 5 42 47 11
27+
1965 1 45 43 12
28+
1960 3 53 36 11
29+
1957 8.5 47 34 18
30+
1956 3.5 53 34 13
31+
1953 9 68 25 07
32+
1937 12 60 33 07

0 commit comments

Comments
 (0)