-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathincentive_models_descriptives.qmd
121 lines (84 loc) · 2.67 KB
/
incentive_models_descriptives.qmd
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
---
format:
html:
df-print: paged
embed-resources: true
theme: lumen
code-fold: true
code-line-numbers: true
code-overflow: wrap
toc: true
toc-location: left
knitr:
opts_chunk:
warning: true
message: false
---
# 2011-2022 Panel Data Cross Tables
```{r setup}
#| output: FALSE
# Load packages
library(tidyverse)
library(corrr)
library(glue)
library(DT)
library(flextable)
library(kableExtra)
library(crosstable)
library(scales)
# Set table formatting defaults
set_flextable_defaults(theme_fun = theme_vanilla,
padding = 2,
#line_spacing = 1,
big.mark = ","
)
options(DT.options = list())
FitFlextableToPage <- function(ft, pgwidth = 6){
ft_out <- ft %>% autofit()
ft_out <- width(ft_out, width = dim(ft_out)$widths*pgwidth /(flextable_dim(ft_out)$widths))
return(ft_out)
}
comm_ind <- read_csv("./Output/comm_ind_PINs_2011to2022_timeseries.csv")
## set variable types
comm_ind <- comm_ind %>%
mutate(across(c(class, improvement_ind, comparable_props, class_1dig, has_AB_exemp, fmv_NA_flag, in_tif, incent:leave_tif, exempt_flag), as.character) )
```
## Descriptive Stats for All Years Together
```{r}
library(modelsummary)
datasummary_skim(comm_ind)
datasummary_skim(comm_ind, type = "categorical")
```
## Descriptive Stats for 2011 Strata of data
```{r}
commind2011 <- comm_ind %>% filter(year == 2011)
datasummary_skim(commind2011)
datasummary_skim(commind2011, type = "categorical")
```
## Descriptive Stats for 2022 Strata of data
```{r}
commind2022 <- comm_ind %>% filter(year == 2022)
datasummary_skim(commind2022)
datasummary_skim(commind2022, type = "categorical")
```
```{r}
datasummary_balance(~incent_change, data = commind2022, title = "PINs from 2022 by Incentive Change", output = "flextable")
```
```{r}
datasummary_balance(~landuse_change, data = commind2022, title = "PINs from 2022 by Landuse Change", output = "flextable")
```
# Correlations
```{r}
datasummary_correlation(commind2022, output = "flextable")
```
# Muni Check
Park Forest is there again! 118 Munis have commercial or industrial PINs during tax year 2022.
```{r}
comm_ind |> filter(year==2022) |> reframe(pincount= n(), fmv = sum(fmv), .by = clean_name) |> arrange(clean_name)
```
# Model Things
- Drop unnecessary variables from dataframe. Helps with speed of `pdata.frame()` command.
- Set index of panel data forthe PIN and year (unit of observation and time)
- Fixed effects will drop anything that doesn't change: Municipality, Triad, distance to Indiana, etc.
- DV: FMV Growth since 2011?
- 5760 PINs were exempt at least 1 year in the dataframe...