erhla / cmfproperty Goto Github PK
View Code? Open in Web Editor NEWA R Package for Property Tax analysis
Home Page: https://harris.uchicago.edu/research-impact/centers-institutes/center-municipal-finance
License: Other
A R Package for Property Tax analysis
Home Page: https://harris.uchicago.edu/research-impact/centers-institutes/center-municipal-finance
License: Other
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:
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')
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.