cellMatrix.net

Spreadsheet Modeling and Related Topics

Linear Regression

Excel's "Add Trendline" option automatically provides an equation for the Linear Regression option. The model below shows how you can manually create that equation if needed. Also included is a calculation for correlation.

image

The formula for the slope (cell F18) is:

=((D13*G13)-(E13*F13))/(D13*H13-E16)

The formula for the Y intercept (cell F19) is:

=(F13-F18*E13)/D13

Although not a part of the linear regression calculations, you might find it useful to know how to manually calculate the correlation of the X and Y data. The formula to calculation correlation (cell F20) is:

=(((D13*G13)-(E13*F13))/SQRT((D13*H13-E16)*(D13*I13-F16)))^2

A chart showing the original points and trendline is below:

image

The Excel-generated trendline formula appears at the top right side of the chart. The manually calculated trendline in the example starts in cell F26 and is copied through the range F26:F33. That formula is below:

=$F$18*E26+$F$19

Posted on Thursday, October 04, 2007 | Comments (1) | Permalink
Comments

John:

Here’s a link to a recent post I made on Excel’s regression tools.

link

Your readers may be interested in the Intercept, Slope, RSQ, SumXMY2 functions as well as LINEST for interpretation of their regression.

This way, they can get their statistical measures without disrupting their data table by adding extra helper columns. The extra columns are not needed if the User uses built-in Excel functions. This can simplify data tables to the actual data.

Kelly

Posted by Kelly O'Day  on  11/14  at  08:50 AM
Page 1 of 1 pages

Comment Entry Form

User Information

Name: (Required)

E-Mail Address: (Optional)

Location: (Optional)

Web Site Address: (Optional)

Comment Formatting Reference
Add VBA Code:
<pre>some code here</pre>
Linking:
[url]http://www.example.com/[/url]
[url=http://www.example.com/]my site[/url]
Text Formatting
[size=4]Some larger text[/size]
[color=green]Some green text[/color]
[b]Some bold text[/b]
[i]Some italic text[/i]
Enter Comment Below

Personalization Options
Remember my personal information
Notify me of follow-up comments?

Next entry: Charting Add-Ins Updated

Previous entry: Healthcare Analysis

<< Back to main

Statistics

  • Total Entries - 136
  • Current Viewers - 15

Categories

Entries by Day

Sep - 2010
S M T W T F S
29 30 31 1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 1 2

Recent Comments

Syndicate