-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME.Rmd
63 lines (44 loc) · 1.79 KB
/
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
---
title: "README"
output: md_document
bibliography: references.bib
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
# Brazilian subnational governments fiscal data
This package aims to make available in machine readable format regional discriminated data on the fiscal variables that are needed to compute the fiscal indicators used by the Brazilian National Treasury Secretariat (NTS) for payment capacity evaluation.
# Installation
This package can be installed directly from GitHub using `devtools`:
```{r, eval=FALSE}
if (!require("devtools")) {
install.packages("devtools")
}
devtools::install_github("fjuniorr/junior2017")
```
Alternatively, a `csv` file with the dataset can be downloaded <a href="https://github.com/fjuniorr/junior2017/raw/master/data-raw/fiscal_data.csv" target="_blank">here</a>.
# Code examples
The dataset documentation can be accessed with
```{r}
library(junior2017)
?fiscal_data
```
As an example of using the data, figure $3.1c$ of @junior2017 can be reproduced with
```{r}
library(ggplot2)
data("fiscal_data")
ggplot(fiscal_data, aes(x = factor(year), y = capag_il, color = state_calamity)) +
geom_boxplot(position=position_dodge(1)) +
xlab("Year") +
ylab("Current liabilities / Cash and cash equivalents") +
theme(legend.position=c(0.05,0.95), legend.justification=c(0,1)) +
theme(panel.border = element_blank()) +
scale_color_discrete(name = "Financial calamity declared", labels = c("no (n = 216)", "yes (n = 27)")) +
guides(color=guide_legend(reverse=TRUE))
```
<!-- Similarly, the estimation results for model 1 presented in table $4.2$ of @junior2017 can be reproduced with -->
<!-- ```{r} -->
<!-- library(brglm) -->
<!-- fit <- brglm(spec_capag, family=binomial(link='logit'), data = DT) -->
<!-- ``` -->
# References