LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 92
Default Re : Excel VBA Charting of a Trendline, the Parameters do not Tally with the Calculations obtained by WorkSheetFunctions.

Re : Excel VBA Charting of a Trendline, the Parameters do not Tally
with the Calculations obtained by WorkSheetFunctions.

1. Enter an Excel Chart-Sheet and plot a Line Chart complete with a
Trendline (via data values as listed on an associated WorkSheet).

2. The xlCategory-axis is tick-labelled with a range of Dates such as,

1981-Apr 1987-Oct 1987-Nov 1988-Jun 1989-Dec 1990-Dec 1991-Sep 1992-
Nov 1994-Mar 1995-Jun 1996-Apr 1996-Oct 1998-Jan 1999-Jun

3. Note that the Series of Dates is entered in a reference range named
"DateGauge" (of the WorkSheet).

4. The corresponding xlVaue-axis is tick-labelled with a range of
Values such as,

20.63 , 22.10 , 22.20 , 22.00, 22.20 , 22.20 , 22.20 ,
22.20 , 22.20 , 22.60 , 23.10 , 22.70 , 21.90 , 18.60

5. Note that the Series of Dates is entered in a reference range named
"WallThickField" (of the WorkSheet).

6. The resultant Trendline equations are given (by virtue of VBA code
statements) as follows,

With .SeriesCollection(1).Trendlines(1)
.DisplayEquation = True
.DisplayRSquared = True
End With

Produces .......... ,

y = -0.000572x + 22.549510
R2 = 0.000957 (Note that "R2" is to be read "R superscript 2")

7. However, the Trendline does not appear to Intercept the y-axis at
22.549510 ; the point of Interception (as shown on the Chart) is
rather approaching (from below) 22.0.

8. And then, there's an attempt to verify the Trendline equations (as
given above) by the following WorkSheetFunction Calculations,

9. Application.Slope(Range("WallThickField"), Range("DateGauge"))
gives,
Best-Fit Rate = -1.66912716320947E-05, which is rather a far cry from
-0.000572x.

10. Application.Intercept(Range("WallThickField, Range("DateGauge"))
gives,
Intercept at Y-Axis = 22.478726514638, which is not quite correct
(according to the depiction on Chart).

11. Rsquared = Application.RSq(Range("WallThickField"),
Range("DateGauge")) gives, RSQ = 7.544141E-04, which is obviously
deviating from 0.000957.

12. Please share your comments. Regards.

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
copy trendline equation to cells for use in other calculations elaine101 Excel Discussion (Misc queries) 1 March 31st 09 06:36 PM
Was trendline available in Excel 2002 as a charting feature? teacher7 Charts and Charting in Excel 1 April 29th 06 11:48 AM
Capturing trendline parameters Lon Sarnoff Excel Programming 3 January 21st 06 08:26 PM
excel.worksheetfunctions Max Excel Worksheet Functions 13 November 26th 05 02:25 AM
Charting Stock Trendline pwinter Charts and Charting in Excel 2 September 13th 05 01:40 PM


All times are GMT +1. The time now is 02:52 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"