library(readxl)
library(tidyverse)
## ── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
## ✔ dplyr     1.1.4     ✔ readr     2.1.5
## ✔ forcats   1.0.0     ✔ stringr   1.5.1
## ✔ ggplot2   3.5.1     ✔ tibble    3.2.1
## ✔ lubridate 1.9.3     ✔ tidyr     1.3.1
## ✔ purrr     1.0.2     
## ── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
## ✖ dplyr::filter() masks stats::filter()
## ✖ dplyr::lag()    masks stats::lag()
## ℹ Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors
Hot<-read_excel("HOTax.xlsx")

pastecs::stat.desc(Hot$`Advertising Revenue`)
##      nbr.val     nbr.null       nbr.na          min          max        range 
## 1.511000e+03 8.900000e+01 8.840000e+02 0.000000e+00 3.951224e+07 3.951224e+07 
##          sum       median         mean      SE.mean CI.mean.0.95          var 
## 7.928100e+08 3.580927e+04 5.246922e+05 6.719031e+04 1.317962e+05 6.821466e+12 
##      std.dev     coef.var 
## 2.611794e+06 4.977763e+00
# The variable of interest is "Advertising Revenue". This variable measures the amount of money municipalities allocate for promotional programs to attract visitors. 

Hot_Cleaned<-Hot%>%filter(!is.na(`Advertising Revenue`))

hist(Hot_Cleaned$`Advertising Revenue`)

sqrt_y<-sqrt(Hot_Cleaned$`Advertising Revenue`)

mutate(Hot_Cleaned,sqrt_y=Hot_Cleaned$`Advertising Revenue`)
## # A tibble: 1,511 × 21
##    `Fiscal Year` `Local Government Type` `Local Government Name` Website
##            <dbl> <chr>                   <chr>                   <chr>  
##  1          2019 city                    City of Abilene         <NA>   
##  2          2021 city                    City of Abilene         <NA>   
##  3          2020 city                    City of Abilene         <NA>   
##  4          2022 city                    City of Abilene         <NA>   
##  5          2019 city                    City of Addison         <NA>   
##  6          2022 city                    City of Addison         <NA>   
##  7          2017 city                    City of Addison         <NA>   
##  8          2021 city                    City of Addison         <NA>   
##  9          2018 city                    City of Addison         <NA>   
## 10          2020 city                    City of Addison         <NA>   
## # ℹ 1,501 more rows
## # ℹ 17 more variables: `Tax Code Ch. 351 Rate` <dbl>,
## #   `Tax Code Ch. 351 Revenue` <dbl>, `Information Centers Revenue` <dbl>,
## #   `Information Centers Percentages` <dbl>, `Registration Revenue` <dbl>,
## #   `Registration Percentages` <dbl>, `Advertising Revenue` <dbl>,
## #   `Advertising Percentages` <dbl>, `Arts Revenue` <dbl>,
## #   `Arts Percentages` <dbl>, `Historical Projects Revenue` <dbl>, …
hist(sqrt_y)