Quinn-Curtis Forums
Quinn-Curtis Forums
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Tools for Microsoft .Net & .Net Compact Framework
 SPC Control Chart Tools for .Net
 frequency limit
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Alice

25 Posts

Posted - 10 Dec 2007 :  14:54:43  Show Profile  Reply with Quote
I want to set the frequency limit for my collected data. It seems

Public Shared Sub CalcFrequencyBins( _
ByVal datavalues As DoubleArray, _
ByVal freqlimits As DoubleArray, _
ByVal bins As DoubleArray _
)

is the one I can use. But later on when I call

Public Sub InitFrequencyHistogram( _
ByVal frequencylimits As Double(), _
ByVal frequencyvalues As Double() _
)

the frequencylimits is double,not doublearray. Am I missing something between these functions? What are the relations between those parameters?

Thanks

quinncurtis

1164 Posts

Posted - 10 Dec 2007 :  18:14:19  Show Profile  Reply with Quote
CalcFrequencyBins is a utility function in the SPCArrayStatistics class. Its use is completely independent of the FrequencyHistogramChart.

If you want to set the frequency bins for a FrequencyHistogramChart plot you should be using InitFrequencyHistogram method as demonstrated in our FrequencyHistogram example program.
Go to Top of Page

Alice

25 Posts

Posted - 11 Dec 2007 :  08:32:05  Show Profile  Reply with Quote
Thanks for the reply.

To call InitFrequencyHistogram(), I need pass it 2 parameters, frequencyvalues is the data I collected. Could you tell how to set frequencylimits?

Public Sub InitFrequencyHistogram( _
ByVal frequencylimits As Double(), _
ByVal frequencyvalues As Double() _
)
Go to Top of Page

quinncurtis

1164 Posts

Posted - 11 Dec 2007 :  09:16:35  Show Profile  Reply with Quote
We do not know what you mean by "Could you tell how to set frequencylimits?". Are you saying that you do not know how to set the individual elements of an array ? That's pretty basic stuff.

The InitFrequencyHistogram is documented in the user manual, and its use, as seen below, is demonstrated in the FrequencyHistogram example program.

Dim freqLimits() As Double = _
                {19.5, 24.5, 29.5, 34.5, 39.5, 44.5, 49.5, 54.5, 59.5}
        'data to be sorted into frequency bins
        Dim freqValues() As Double = _
                {32, 44, 44, 42, 57, 26, 51, 23, 33, _
                27, 42, 46, 43, 45, 44, 53, 37, 25, _
                38, 44, 36, 40, 36, 48, 56, 47, 40, _
                58, 45, 38, 32, 39, 43, 31, 45, 41, _
                37, 31, 39, 33, 20, 50, 33, 50, 51, _
                28, 51, 40, 52, 43}

        Me.InitFrequencyHistogram(freqLimits, freqValues) '


Or you can assign the values element by element.

Dim freqLimits(8) As Double
        freqLimits(0) = 19.5
        freqLimits(1) = 24.5
        freqLimits(2) = 29.5
        freqLimits(3) = 34.5
        freqLimits(4) = 39.5
        freqLimits(5) = 44.5
        freqLimits(6) = 49.5
        freqLimits(7) = 54.5
        freqLimits(8) = 59.5


The frequencyLimits set the frequency bins of the resulting histogram. Look at the example program code, run it, and study the resulting chart.

The number of frequency bins you want in the resulting histogram, and each frequency bin value, is up to you. It depends on your application. We can't tell you what values to use.

If you are still confused, please describe in much, much, more detail exactly what you do not understand.
Go to Top of Page

Alice

25 Posts

Posted - 11 Dec 2007 :  09:27:59  Show Profile  Reply with Quote
Yes, you are absolutely right. Setting the individual elements of freqLimits is just as basic as setting freqValues, which is something I already did!

In your sample,you hard code your freqLimits() values. I guess for a real life application, the array can be any size with any value based on the maximum and minimun data you collected.
Go to Top of Page

quinncurtis

1164 Posts

Posted - 11 Dec 2007 :  10:00:12  Show Profile  Reply with Quote
That's correct. You would dynamically allocate the arrays and fill them with the values either calculated, or hard-coded, in your application. That is the way it is with every aspect of our software.

Dim n As Integer = 8
Dim freqLimits(n) As Double
freqLimits(0) = 19.5
Dim i As Integer
For i = 1 To n
     freqLimits(i) = freqLimits(i - 1) + 5
Next
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
Quinn-Curtis Forums © 2000-07 Quinn-Curtis, Inc. Go To Top Of Page
Powered By: Snitz Forums 2000 Version 3.4.07