Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.office.developer.vba,microsoft.public.excel.programming,microsoft.public.excel.misc,microsoft.public.excel
external usenet poster
 
Posts: 36
Default Does Excel 2003 have CDF feature in its histogram plotting function?

Hi all,

Does Excel 2003 have CDF feature in its histogram plotting function?

Here CDF means "Cumulative Probability Density Function",

We know that histogram is actually discretized version of PDF, which stands
for "Probability Density Function".

But where can I find the CDF plotting function in Excel?

Thanks a lot


  #2   Report Post  
Posted to microsoft.public.office.developer.vba,microsoft.public.excel.programming,microsoft.public.excel.misc,microsoft.public.excel
external usenet poster
 
Posts: 68
Default Does Excel 2003 have CDF feature in its histogram plotting function?

cfman

I think you will have to write a function to integrate the pdf
yourself.

Within a spreadsheet you can use the FREQUENCY() function on very
small partitions/bins to create the data via which you chart the pdf,
then doing a cumulative sum of the results will give a good
approximation of the cdf...works best on a large data set.

Within VBA I use the following functions to create a 2-d array of
breaks and frequencies...you could add a 3rd dimension to keep a
running total of the frequencies and chart that for the cdf.


Function Hist2(Breaks As Long, arr() As Double, Optional
FreqAsPercentage As Boolean = False)

'calculates bins and frequencies for an array
' where Breaks = no. of breaks
'have to use the GetMax and GetMin functions as arr is likely to have
more than 65,535 elements

Dim i As Long, j As Long, ArrSize As Double
Dim length As Double
Dim MaxValue As Double
Dim MinValue As Double
ReDim breaksNfreq(1 To Breaks, 1 To 2) As Double 'first column is
breaks, second is freq

'Assign initial value for the frequency array
For i = 1 To Breaks
breaksNfreq(i, 2) = 0
Next i

MaxValue = GetMax(arr)
MinValue = GetMin(arr)

'Linear interpolation
length = (MaxValue - MinValue) / Breaks
For i = 1 To Breaks
breaksNfreq(i, 1) = MinValue + length * i
Next i

'Counting the number of occurrences for each of the bins
For i = LBound(arr) To UBound(arr)
If (arr(i) <= breaksNfreq(1, 1)) Then breaksNfreq(1, 2) =
breaksNfreq(1, 2) + 1
If (arr(i) = breaksNfreq(Breaks - 1, 1)) Then
breaksNfreq(Breaks, 2) = breaksNfreq(Breaks, 2) + 1
For j = 2 To Breaks - 1
If (arr(i) breaksNfreq(j - 1, 1) And arr(i) <=
breaksNfreq(j, 1)) Then
breaksNfreq(j, 2) = breaksNfreq(j, 2) + 1
Exit For
End If
Next j
Next i

If FreqAsPercentage = True Then
ArrSize = (UBound(arr) - LBound(arr) + 1)
For i = 1 To UBound(breaksNfreq)
breaksNfreq(i, 2) = breaksNfreq(i, 2) / ArrSize
Next i
End If
Hist2 = breaksNfreq()
End Function

Function GetMax(arr() As Double) As Double
Dim i As Long
Dim j As Long
Dim z As Long

i = LBound(arr)
j = UBound(arr)

GetMax = arr(i)
For z = i + 1 To j
If arr(z) GetMax Then GetMax = arr(z)
Next z
End Function

Function GetMin(arr() As Double) As Double
Dim i As Long
Dim j As Long
Dim z As Long

i = LBound(arr)
j = UBound(arr)

GetMin = arr(i)
For z = i + 1 To j
If arr(z) < GetMin Then GetMin = arr(z)
Next z


Hope that helps
Lloyd

  #3   Report Post  
Posted to microsoft.public.office.developer.vba,microsoft.public.excel.programming,microsoft.public.excel.misc,microsoft.public.excel
external usenet poster
 
Posts: 762
Default Does Excel 2003 have CDF feature in its histogram plotting function?

cfman -

The Histogram in Excel's Analysis ToolPak has a checkbox for "Cumulative
Percentage."

You find it at Tools | Data Analysis | Histogram.

(For an alternative, see my free Better Histogram add-in at
www.treeplan.com.)

In general, a histogram is usually a column chart of a frequency
distribution, where the frequency distribution is summarizing real data.

For me, "CDF" usually means "Cumulative Distribution Function."

- Mike
http://www.mikemiddleton.com

"cfman" wrote in message
...
Hi all,

Does Excel 2003 have CDF feature in its histogram plotting function?

Here CDF means "Cumulative Probability Density Function",

We know that histogram is actually discretized version of PDF, which
stands for "Probability Density Function".

But where can I find the CDF plotting function in Excel?

Thanks a lot



  #4   Report Post  
Posted to microsoft.public.excel.misc,microsoft.public.excel.programming,microsoft.public.office.developer.vba,microsoft.public.excel
external usenet poster
 
Posts: 11,058
Default Does Excel 2003 have CDF feature in its histogram plotting functio

see:

http://groups.google.com/group/micro...be32b7dc60cde8
--
Gary''s Student
gsnu200712

Reply
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
how to delete a class category in histogram, Excel 2003? Djalia Kabebwa[_2_] Charts and Charting in Excel 1 March 20th 09 09:08 AM
Does Excel 2003 have CDF feature in its histogram plotting function? cfman Excel Discussion (Misc queries) 3 March 28th 07 03:02 AM
Excel 2003 plotting graphs in inverse order jsking Charts and Charting in Excel 1 June 8th 06 03:11 AM
Excel 2003 xy chart - problem plotting more than 330 points ehmcneill Charts and Charting in Excel 1 December 17th 05 12:18 AM
Histogram VBA Code won't run in Excel 2003 jimbuff Excel Programming 3 December 2nd 03 08:19 PM


All times are GMT +1. The time now is 09:06 PM.

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

About Us

"It's about Microsoft Excel"