socrata / opendatanetwork.com

The Open Data Network
https://www.opendatanetwork.com/
Other
19 stars 12 forks source link

NLG forecasts rounding issues #341

Closed zang0 closed 8 years ago

zang0 commented 8 years ago

See paragraph generated below. Note the 0.00% is causing bogus conclusions.

http://opendatanetwork-staging.herokuapp.com/region/0500000US25017-0500000US25027-0500000US09003/Middlesex_County_MA-Worcester_County_MA-Hartford_County_CT/classroom_statistics/student_teacher_ratio/2014?

The last measured student teacher ratios for Middlesex County, MA was 13.28. Middlesex County, MA experienced an average annual growth rate of 0.00% from our first student teacher ratios statistic recorded in 2003. If past trends continue, we forecast the student teacher ratios to be 0.00 by 2021. The last measured student teacher ratios for Worcester County, MA was 14.81. Worcester County, MA experienced an average annual growth rate of 0.00% from our first student teacher ratios statistic recorded in 2003. If past trends continue, we forecast the student teacher ratios to be 0.00 by 2021. The last measured student teacher ratios for Hartford County, CT was 12.84. Hartford County, CT experienced an average annual growth rate of -0.44% from our first student teacher ratios statistic recorded in 2003. If past trends continue, we forecast the student teacher ratios to be 12.42 by 2021.

ToshMeston commented 8 years ago

Hm. Looks like we do not have data for Middlesex County and Worcester County in 2003 which is causing a problem. Can we purge 2003 from the dataset since it is sparse, @zang0?

zang0 commented 8 years ago

This dataset is quite valuable yet has sparseness in other areas as well. I'd rather we just account for unknown data points in the analysis.

ToshMeston commented 8 years ago

Fixed to consider the first and last defined data points in linear extrapolation calculation.