Add a variable to indicate the total. In this case, 6 months is half a year, so we will call this variable "half". Sample data below for columns A,B,C
![enter image description here](https://i.stack.imgur.com/J2VAw.png)
Now set up a pivot table with both half and month as rows and sales as the value, as shown below.
![enter image description here](https://i.stack.imgur.com/TwdwG.png)
The simplest outcome from a regression is a set of coefficients, but that is not sufficient for a true regression analysis. You say that you have used R, in R there is a built in dataset called "anscombe" (after the person who created the data). Use that dataset and fit a regression of y1 vs. x1, then do a regression of y2 vs. x2, y3 vs. x3, and y4 vs. x4.
Compare the coefficients (formulas) for the 4 regressions and think about what your conclusions are. Now plot the pairs of data and compare the plots. How does the comparison of the plots compare to the comparison of the regression models?
You could also look up Anscombe's quartet on wikipedia or google, but it is much more informative to do it yourself.
A more complete regression analysis will include not only the coefficients but also things like residual, fitted values, standard errors, confidence intervals, diagnostic plots, etc. (the complete list of everything needed in an analysis depends on the specific data, science, and questions being asked). The above can be produced with about 4 lines of code in R, I don't know how much python code it would take (but there may be prewritten python code to do the same in much fewer lines than programming straight python would).
Also, unless your predictor variables (independent variables, but I don't like the independent/dependent names) are perfectly orthogonal to each other you will get different coefficients fitting one at a time than fitting them all together, and for any dataset of real interest the other important aspects (standard errors, etc) will differ whether you do things one at a time or all together.
Best Answer
If by logarithmic regression you mean the model
log(y) = m1.x1 + m2.x2 + ... + b + (Error)
, you can useLOGEST
andGROWTH
with multiple independent variables. Note that if you want the estimated coefficientsm1, m2, ..., b
fromLOGEST
, you'll have to enter the formula into multiple cells as an array. See Excel's online help for the steps required.Alternatively, you can log-transform your dependent variable and use
LINEST
/TREND
which does the same thing under the hood.ObWarning: Excel isn't the best regression package in the world. See, for example, McCullough & Heiser (2008), On the accuracy of statistical procedures in Microsoft Excel 2007, Comp Stats & Data Analysis 52(10) pp.4570-4578.