Property Tax Fairness
From the Center for Municipal Finance
To generate the report, first download the data. This dataset is a raw public dataset we can use.
After downloading the dataset, please run the below R code, for example in RStudio. Remember to replace “your output directory” with the path where you want to save the generated report.
library(tidyverse)
library(data.table)
library(readstata13)
library(cmfproperty)
sales <- read.dta13( “/Los Angeles/Simplified_LA_Complete_beta2.dta”))
assessments <- read.dta13( “/Los Angeles/Simplified_Assessor_Data_All_Years.dta”))
sales <- sales %>% filter(Year > 2004) %>% select(AIN, Year, LS1SaleAmount) %>% filter(LS1SaleAmount > 100)
joined <- left_join(assessments, sales, by = c(“AIN” = “AIN”, “RollYear” = “Year”))
joined <- joined %>% filter(str_sub(PropertyUseCode,1,1) == 0) #residential only
df_to_join <-joined %>% select(AIN, RollYear, TotalLandImpValue) %>% mutate(RollYear = RollYear + 1) %>% rename(LAST_YEAR_AV = TotalLandImpValue)
df <-joined %>% left_join(df_to_join, by = c(“AIN” = “AIN”, “RollYear” = “RollYear”)) %>% filter(RollYear != 2006)
df <- df %>% mutate(SALE_PRICE = `LS1SaleAmount`,SALE_YEAR = RollYear,TAX_YEAR = RollYear,ASSESSED_VALUE = LAST_YEAR_AV,TOTAL_AV = ASSESSED_VALUE)
mini <- df %>% filter(!is.na(SALE_PRICE)) %>% select(AIN, SALE_PRICE:TOTAL_AV)
df <- mini %>% filter(SALE_PRICE < 20000000,SALE_PRICE > 20000,ASSESSED_VALUE > 5000)
df <- df %>% mutate(SALE_YEAR = RollYear, ASSESSED_VALUE = netTaxableValue, SALE_PRICE = TotalLandImpValue)
df <- df %>% mutate_at(c(‘ASSESSED_VALUE’, ‘SALE_PRICE’, ‘SALE_YEAR’), as.numeric)
df <- df[c(‘SALE_PRICE’, ‘SALE_YEAR’, ‘TAX_YEAR’, ASSESSED_VALUE’)]
ratios <-cmfproperty::reformat_data(df,sale_col = “SALE_PRICE”,assessment_col = “ASSESSED_VALUE”,sale_year_col = “SALE_YEAR”)
cmfproperty::make_report(ratios, jurisdiction_name = “Los Angeles County”, output_dir = “your output directory”)
Below is a pre-generated example report: