-
Notifications
You must be signed in to change notification settings - Fork 2
/
appendix.Rmd
200 lines (149 loc) · 10.6 KB
/
appendix.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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
---
title: "Appendix"
output:
pdf_document:
keep_tex: true
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
\setcounter{table}{0}
\renewcommand{\thetable}{A\arabic{table}}
```{r include=FALSE}
library(readxl)
javabalinusatenggarazipcodes <- read_excel("/Volumes/GoogleDrive/My Drive/Nyepi/Processing Scripts/VNP46A1zipcodes.xlsx")
# Indicator variables for Nyepi Day
javabalinusatenggarazipcodes$nyepi <- as.numeric((javabalinusatenggarazipcodes$date == "2017-03-28") | (javabalinusatenggarazipcodes$date == "2018-03-17") | (javabalinusatenggarazipcodes$date == "2019-03-07") | (javabalinusatenggarazipcodes$date == "2020-03-25") | (javabalinusatenggarazipcodes$date == "2021-03-14"))
# javabalinusatenggarazipcodes$days_from <- ifelse(javabalinusatenggarazipcodes$year==2017,as.Date(javabalinusatenggarazipcodes$newdate) - as.Date("2017-03-28"),NA)
#
# javabalinusatenggarazipcodes$days_from <- ifelse(javabalinusatenggarazipcodes$year==2018,as.Date(javabalinusatenggarazipcodes$newdate) - as.Date("2018-03-17"),javabalinusatenggarazipcodes$days_from)
#
# javabalinusatenggarazipcodes$days_from <- ifelse(javabalinusatenggarazipcodes$year==2019,as.Date(javabalinusatenggarazipcodes$newdate) - as.Date("2019-03-07"),javabalinusatenggarazipcodes$days_from)
#
# javabalinusatenggarazipcodes$days_from <- ifelse(javabalinusatenggarazipcodes$year==2020,as.Date(javabalinusatenggarazipcodes$newdate) - as.Date("2020-03-25"),javabalinusatenggarazipcodes$days_from)
```
```{r include=FALSE}
# Regressions
library(readr)
library(plm)
#1
regList3 <- vector(mode = "list")
zlist1 <- readLines("/Volumes/GoogleDrive/My Drive/Nyepi/Alemarie/zipcode_list1.csv")
for (i in zlist1) {
javabalinusatenggarazipcodes$zipcode <- as.numeric((javabalinusatenggarazipcodes$zipcodename == i))
regList3[[i]] <- plm(log(lightcount+.001) ~ nyepi*zipcode + factor(date),
#data=javabalinusatenggarazipcodes
data=subset(javabalinusatenggarazipcodes, javabalinusatenggarazipcodes$provincename!="Sulawesi Selatan" )
, index = c("zipcodeno","date"),model = "within")
}
#2
regList4 <- vector(mode = "list")
zlist2 <- readLines("/Volumes/GoogleDrive/My Drive/Nyepi/Alemarie/zipcode_list2.csv")
for (i in zlist2) {
javabalinusatenggarazipcodes$zipcode <- as.numeric((javabalinusatenggarazipcodes$zipcodename == i))
regList4[[i]] <- plm(log(lightcount+.001) ~ nyepi*zipcode + factor(date),
#data=javabalinusatenggarazipcodes
data=subset(javabalinusatenggarazipcodes, javabalinusatenggarazipcodes$provincename!="Sulawesi Selatan" )
, index = c("zipcodeno","date"),model = "within")
}
#3
regList5 <- vector(mode = "list")
zlist3 <- readLines("/Volumes/GoogleDrive/My Drive/Nyepi/Alemarie/zipcode_list3.csv")
for (i in zlist3) {
javabalinusatenggarazipcodes$zipcode <- as.numeric((javabalinusatenggarazipcodes$zipcodename == i))
regList5[[i]] <- plm(log(lightcount+.001) ~ nyepi*zipcode + factor(date),
#data=javabalinusatenggarazipcodes
data=subset(javabalinusatenggarazipcodes, javabalinusatenggarazipcodes$provincename!="Sulawesi Selatan" )
, index = c("zipcodeno","date"),model = "within")
}
#4
regList6 <- vector(mode = "list")
zlist4 <- readLines("/Volumes/GoogleDrive/My Drive/Nyepi/Alemarie/zipcode_list4.csv")
for (i in zlist4) {
javabalinusatenggarazipcodes$zipcode <- as.numeric((javabalinusatenggarazipcodes$zipcodename == i))
regList6[[i]] <- plm(log(lightcount+.001) ~ nyepi*zipcode + factor(date),
#data=javabalinusatenggarazipcodes
data=subset(javabalinusatenggarazipcodes, javabalinusatenggarazipcodes$provincename!="Sulawesi Selatan" )
, index = c("zipcodeno","date"),model = "within")
}
```
```{r echo=FALSE, message=FALSE, warning=FALSE, results='asis'}
# Regression table
library(stargazer)
stargazer(list(regList3[1:10]), title="Percent Change in Total Radiance for Districts in Bali. Estimated regression coefficients are displayed with their associated standard errors underneath in parentheses. Asterisks indicate the results of individual two-sided tests of statistical significance: $^{*}$p$<$0.1; $^{**}$p$<$0.05; $^{***}$p$<$0.01.",
font.size="tiny",
dep.var.labels = "Logged Total Radiance",
omit = c("date"),
column.labels = c("Abiansemal", "Kuta", "Kuta Selatan", "Kuta Utara", "Mengwi", "Petang", "Bangli", "Kintamani", "Susut", "Tembuku"),
covariate.labels = c("Nyepi Day", "Nyepi Day in that Zip Code"),
keep.stat=c("n","rsq"),
digits = 3,header=FALSE,omit.table.layout = "n",column.sep.width = "-5pt",
add.lines = list(c("Region Fixed Effects?", "Yes", "Yes", "Yes", "Yes", "Yes", "Yes", "Yes", "Yes", "Yes","Yes"),
c("Date Fixed Effects?", "Yes", "Yes", "Yes", "Yes", "Yes", "Yes", "Yes", "Yes", "Yes","Yes")))
```
```{r echo=FALSE, message=FALSE, warning=FALSE, results='asis'}
# Regression table
stargazer(c(regList3[11:15],list(regList4[1:5])), title="Percent Change in Total Radiance for Districts in Bali. Estimated regression coefficients are displayed with their associated standard errors underneath in parentheses. Asterisks indicate the results of individual two-sided tests of statistical significance: $^{*}$p$<$0.1; $^{**}$p$<$0.05; $^{***}$p$<$0.01.",
font.size="tiny",
dep.var.labels = "Logged Total Radiance",
omit = c("date"),
column.labels = c("Banjar", "Buleleng", "Busungbiu", "Gerokgak", "Kubutambahan", "Sawan","Seririt","Sukasada","Tejakula","Denpasar Barat"),
covariate.labels = c("Nyepi Day", "Nyepi Day in that Zip Code"),
keep.stat=c("n","rsq"),
digits = 3,header=FALSE,omit.table.layout = "n",column.sep.width = "-5pt",
add.lines = list(c("Region Fixed Effects?", "Yes", "Yes", "Yes", "Yes", "Yes", "Yes", "Yes", "Yes", "Yes","Yes"),
c("Date Fixed Effects?", "Yes", "Yes", "Yes", "Yes", "Yes", "Yes", "Yes", "Yes", "Yes","Yes")))
```
```{r echo=FALSE, message=FALSE, warning=FALSE, results='asis'}
# Regression table
stargazer(list(regList4[6:15]), title="Percent Change in Total Radiance for Districts in Bali. Estimated regression coefficients are displayed with their associated standard errors underneath in parentheses. Asterisks indicate the results of individual two-sided tests of statistical significance: $^{*}$p$<$0.1; $^{**}$p$<$0.05; $^{***}$p$<$0.01.",
font.size="tiny",
dep.var.labels = "Logged Total Radiance",
omit = c("date"),
column.labels = c("Denpasar Selatan","Denpasar Timur","Denpasar Utara","Blahbatuh","Gianyar","Payangan","Sukawati","Tampaksiring","Tegallalang","Ubud"),
covariate.labels = c("Nyepi Day", "Nyepi Day in that Zip Code"),
keep.stat=c("n","rsq"),
digits = 3,header=FALSE,omit.table.layout = "n",column.sep.width = "-10pt",
add.lines = list(c("Region Fixed Effects?", "Yes", "Yes", "Yes", "Yes", "Yes", "Yes", "Yes", "Yes", "Yes","Yes"),
c("Date Fixed Effects?", "Yes", "Yes", "Yes", "Yes", "Yes", "Yes", "Yes", "Yes", "Yes","Yes")))
```
```{r echo=FALSE, message=FALSE, warning=FALSE, results='asis'}
# Regression table
stargazer(list(regList5[1:10]), title="Percent Change in Total Radiance for Districts in Bali. Estimated regression coefficients are displayed with their associated standard errors underneath in parentheses. Asterisks indicate the results of individual two-sided tests of statistical significance: $^{*}$p$<$0.1; $^{**}$p$<$0.05; $^{***}$p$<$0.01.",
font.size="tiny",
dep.var.labels = "Logged Total Radiance",
omit = c("date"),
column.labels = c("Jembrana","Melaya","Mendoyo","Negara","Pekutatan","Abang","Bebandem","Karangasem","Kubu","Manggis"),
covariate.labels = c("Nyepi Day", "Nyepi Day in that Zip Code"),
keep.stat=c("n","rsq"),
digits = 3,header=FALSE,omit.table.layout = "n",column.sep.width = "-10pt",
add.lines = list(c("Region Fixed Effects?", "Yes", "Yes", "Yes", "Yes", "Yes", "Yes", "Yes", "Yes", "Yes","Yes"),
c("Date Fixed Effects?", "Yes", "Yes", "Yes", "Yes", "Yes", "Yes", "Yes", "Yes", "Yes","Yes")))
```
```{r echo=FALSE, message=FALSE, warning=FALSE, results='asis'}
# Regression table
stargazer(c(list(regList5[11:14]),list(regList6[1:6])), title="Percent Change in Total Radiance for Districts in Bali. Estimated regression coefficients are displayed with their associated standard errors underneath in parentheses. Asterisks indicate the results of individual two-sided tests of statistical significance: $^{*}$p$<$0.1; $^{**}$p$<$0.05; $^{***}$p$<$0.01.",
font.size="tiny",
dep.var.labels = "Logged Total Radiance",
omit = c("date"),
column.labels = c("Rendang","Selat","Sidemen","Banjarangkan","Dawan","Klungkung","Nusapenida","Baturiti","Kediri","Kerambitan"),
covariate.labels = c("Nyepi Day", "Nyepi Day in that Zip Code"),
keep.stat=c("n","rsq"),
digits = 3,header=FALSE,omit.table.layout = "n",column.sep.width = "-10pt",
add.lines = list(c("Region Fixed Effects?", "Yes", "Yes", "Yes", "Yes", "Yes", "Yes", "Yes", "Yes", "Yes","Yes"),
c("Date Fixed Effects?", "Yes", "Yes", "Yes", "Yes", "Yes", "Yes", "Yes", "Yes", "Yes","Yes"))
)
```
```{r echo=FALSE, message=FALSE, warning=FALSE, results='asis'}
# Regression table
stargazer(list(regList6[7:13]), title="Percent Change in Total Radiance for Districts in Bali. Estimated regression coefficients are displayed with their associated standard errors underneath in parentheses. Asterisks indicate the results of individual two-sided tests of statistical significance: $^{*}$p$<$0.1; $^{**}$p$<$0.05; $^{***}$p$<$0.01.",
font.size="tiny",
dep.var.labels = "Logged Total Radiance",
omit = c("date"),
column.labels = c("Marga","Penebel","Pupuan","Selemadeg","Selemadeg Barat","Selemadeg Timur","Tabanan"),
covariate.labels = c("Nyepi Day", "Nyepi Day in that Zip Code"),
keep.stat=c("n","rsq"),
digits = 3,header=FALSE,omit.table.layout = "n",column.sep.width = "-10pt",
add.lines = list(c("Region Fixed Effects?", "Yes", "Yes", "Yes", "Yes", "Yes", "Yes", "Yes"),
c("Date Fixed Effects?", "Yes", "Yes", "Yes", "Yes", "Yes", "Yes","Yes")))
```