# Weather analysis | company sales

I'm writing a python code that reads in a csv file of rain in inches for a given zip code and creates a normal distribution from the data. Ultimately, I want to be able to create some score for the given data based on my normal distribution and compare it to previous time frames. What would be a good approach? I was thinking about summing z scores past 2 standard deviations (+2 means more rain and that's bad so subtract it and -2 SD's means less rain than normal so add that z score to 100). However, I came across some problems with this:

Say Chicago has .1 inches of rain for every day from May 1 to July 31 in the year 2013. Then it would have a mean of .1 and a perfect score of 100. However, say in 2014 the average is .008 but the data points are not all .1, so the score will be less than 100 even though there was less rain.

I am trying to figure out a proper scoring system for this program. Any help or ideas would be great!

The whole purpose of this is to see how weather has affected company sales. I know how to code everything properly, but am trying to figure out a good approach for a scoring system. Thanks for the help!

• What data do you have? Sales at location $i$ at time $t$ paired with rainfall at location $i$ at time $t$? If so, why not regress sales on a location factor (i.e. location-specific constants) plus rainfall? Why do you have to create an ad-hoc rainfall score first, instead of using the raw rainfall numbers? – Adrian May 26 '15 at 7:58
• No rainfall data anywhere in the continental US can be transformed into a distribution that is anywhere close to Normal. Chicago, for instance, will have zero inches of rainfall on the majority of days during any sufficiently long period, so any "score" distribution would have a corresponding non-Normal spike. If you want to analyze weather and company sales, you should be focusing on how weather might be related to sales (a regression problem) rather than on forcing the weather data into some Procrustean statistical framework that has no objective relevance to sales. – whuber May 26 '15 at 13:39