Giter VIP home page Giter VIP logo

cmfproperty's Introduction

Transparency & Equity in Property Assessments

This package analyzes the accuracy of property assessments and produces graphs, tables, and reports designed for general use. This package is produced by the Center for Municipal Finance, a research institute at the Harris School of Public Policy, University of Chicago.

For a detailed guide on how to use this package check out our Get started page.

Installation

You can install the development version from GitHub with:

# install.packages("devtools")
devtools::install_github("cmf-uchicago/cmfproperty")

Basic Usage

First import cmfproperty.

library(cmfproperty)

To conduct our study, we need data where every roll is a unique property’s sale price and assessed value for a given year.

head(cmfproperty::example_data)
#>              PIN SALE_YEAR SALE_PRICE ASSESSED_VALUE
#> 1 17273100931118      2015      53000          33860
#> 2 18013090421010      2018      80000          60390
#> 3 12111190201042      2018     118000         108300
#> 4 13093160601015      2017     125500          87200
#> 5 14322110150000      2018    3705000        3670740
#> 6 27021200080000      2016     345000         267280

Then, preprocess your data with reformat_data and call make_report. The report from the example below can be found here.

df <- cmfproperty::example_data

ratios <-
  cmfproperty::reformat_data(
    df,
    sale_col = "SALE_PRICE",
    assessment_col = "ASSESSED_VALUE",
    sale_year_col = "SALE_YEAR",
  )

cmfproperty::make_report(ratios, 
                         jurisdiction_name = "Cook County, Illinois",
                         output_dir = "~/../Documents/GitHub/cmf-uchicago.github.io/") 

#output_dir is the directory in which report is saved; default is working directory

cmfproperty's People

Contributors

cmf-uchicago avatar erhla avatar jrockower avatar ymericson avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

cmfproperty's Issues

Non deterministic IAAO statistics

Hey @erhla --

In the process of replicating the COD, PRD, and PRB statistics generated via the make_report function I noticed that all three IAAO stats were slightly different from what you'd get if you were to manually compute them. I believe bootstrapping is a good solution for estimating errors but unsure if that is the best choice for estimating the actual IAAO performance indices. Or alternatively perhaps what you can do is provide an option in the make_reports fucntion to generate the statistics without bootstrapping.

As a comparison this is what I got manually computing them without bootstrapping vs using make_report:

  • COD 40.4 (manual) vs 34.55 (make_report)
  • PRD 1.12 (manual) vs 0.843, 1.058, 1.312, 1.177, 1.027 (make_report .. this was least stable)
  • PRB -0.1071028 (manual) vs -0.088 (make_report)

Below is the function I used modeled directly after your code w/o bootstrapping (referencing this: https://github.com/cmf-uchicago/cmfproperty/blob/master/R/iaao_stats.R#L1-L33)

#' @param data dataframe of data
#' @param assessment_value_col string of assessment_value_col name
#' @param sale_price_col string of sale_price_col name
#' @return dataframe 
gen_iaao_stats <- function(data, assessment_value_col, sale_price_col) { 
  df_iaao <- data %>% 
    rename_at(vars(c(assessment_value_col, sale_price_col)), function(x) c('assessment_value','sale_price')) %>% 
    mutate(av_ratio = assessment_value/sale_price,
           log2 = log(2),
           count = 1) %>%
    mutate(cod = 100 * sum(abs(av_ratio - stats::median(av_ratio)))/(n() * stats::median(av_ratio)),
           prd = mean(av_ratio, na.rm = TRUE)/stats::weighted.mean(av_ratio, sale_price, na.rm = TRUE),
           prb_value = 0.50 * (assessment_value/median(av_ratio)) + 0.50 * sale_price,
           prb_ln_value = log(prb_value)/log(2),
           prb_pct_diff = (av_ratio - median(av_ratio))/median(av_ratio)
    )
  prb_model <- linear_reg() %>% 
    fit(prb_pct_diff ~ prb_ln_value,  data = df_iaao) %>%
    tidy(., conf.int = TRUE) 
  iaao_out <- list('cod' = c(unique(df_iaao$cod)) ,
                   'prd' = c(unique(df_iaao$prd)) ,
                   'prb' = c(prb_model %>% filter(term == 'prb_ln_value') %>% select(estimate) %>% distinct() %>% pull())) %>%
    as.data.frame()
  return(iaao_out)
}
test <- gen_iaao_stats(data = data_input, assessment_value_col = 'ASSESSEDVALUE', sale_price_col = 'sale_price')

Why is confidence interval so large for COD?

Hi @erhla, I recently used cmfproperty to analyze sales data for St. Louis County, Mo., for the period 2010 to 2023.

Everything worked well, but I am puzzled by one aspect of the final report that was generated.

The diagram for the Coefficient of Dispersion in our report shows a very large confidence interval -- far bigger than the CI on the COD chart for St. Louis County on the CMF's 2020 report online. (So big that it's changing the Y-axis scale)

Here's a comparison:

On CMF website In our new report
cmf pd

None of the other diagrams in our new report have this issue. All the other diagrams' confidence intervals are very tightly aligned to the data lines, similar to those in the 2020 CMF report.

Anyway, I'm happy to send the source sales data we used (it's a 17mb CSV), or to share my code.

Update documentation with pkgdown for satrday 2020 talk

README

pkgdown

  • Add tab for example report & example report w/ diagnostics
  • Update reference page to group functions into data processing, regressivity tests, plots, and report
  • Link vignettes to each other when appropriate

vignettes

  • preprocessing---more detailed step-by-step example of how to get data in correct format
  • methods---example of output applied for each function & latex equations behind functions (include arm's length/inflation adj) rename to Methods?
  • list of figures---example of output applied for each function
  • Get Started---motivation and overview

plots

  • split plots up into different sections

regressivity_tests

  • update documentation to refer to Methods

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.