# Isolating Independent Variables

#### rwoolley

##### New Member
Question 1: How do I isolate an independent variable?

Question 2: Once I know the independent variables impact how do I remove it from a timeline data series

For example my hypothesis is that people buy more beer when it is warm.

Data:
I have 5 years of weekly beer sales data and 5 years of weekly average temperature data. Experimenting with the data I find that there is a linear relationship between the year-over-year change in weekly beer sales vs year-over-year changes in weekly average temperature. The problem is the relationship between the independent variable (temperature) and the dependent variable (sales) is never always the same across all year pairings because of several other undefined independent variables such as the economy.

So for example

Comparing weekly sales and temperature in 2006 to 2005 and using linear regression I get the following regression equation variables. y=mx+b and x is always equal to the change in year-over-year temperature.

m = 0.039
b = 0.035

But when I look at 2007 to 2006 I get

m = 0.091
b = -0.159

And looking at 2008 vs 2007 I get

m = 0.063
b = 0.283

and finally looking at 2009 vs 2008 I get

m = 0.034
b = -0.229

Lets assume beer consumption is directly tied to temperature and the consumer is the same person every year, thus I would think the slope term (m) between beer sales and temperature would be almost the same in every comparison but as you can see it is not.

I have been asked to isolate out the effect of weather in 2008 and 2009 sales data so that we can get a handle on what the effect was due to the slumping economy. Any brilliant helpers out there have an idea of a simple way of doing this?