Home All Groups Group Topic Archive Search About

Calculating Standard Deviation?

Author
1 Apr 2006 7:14 PM
Scott
I know in some other languages there is a simple standard deviation function
(sdev(1,2,3,4,5,etc...)).  But I'm unable to find a suitable alternative for
vb.net

I'm assuming it's there somewhere.  Can someone tell me the how to call
standard deviation?  I have a datatable and I need to determine the std for
a series of rows.

Thanks for the help!

Author
2 Apr 2006 12:42 AM
Hal Rosser
"Scott" <scott@scott.scott> wrote in message
news:rKqdnTYOyv7RTLPZnZ2dneKdnZydnZ2d@comcast.com...
> I know in some other languages there is a simple standard deviation
function
> (sdev(1,2,3,4,5,etc...)).  But I'm unable to find a suitable alternative
for
> vb.net
>
> I'm assuming it's there somewhere.  Can someone tell me the how to call
> standard deviation?  I have a datatable and I need to determine the std
for
> a series of rows.

The data is in a database - so you can use SQL to get that information.
http://www.oreilly.com/catalog/sqlnut/chapter/ch04.html
Author
2 Apr 2006 6:33 AM
Scott
Not quite.  It's a datatable, not a database table.

I ended up just writing a function to do it.  Annoying to have to do, but
not difficult.

Show quoteHide quote
"Hal Rosser" <hmros***@bellsouth.net> wrote in message
news:W2FXf.7908$68.1761@bignews7.bellsouth.net...
>
> "Scott" <scott@scott.scott> wrote in message
> news:rKqdnTYOyv7RTLPZnZ2dneKdnZydnZ2d@comcast.com...
>> I know in some other languages there is a simple standard deviation
> function
>> (sdev(1,2,3,4,5,etc...)).  But I'm unable to find a suitable alternative
> for
>> vb.net
>>
>> I'm assuming it's there somewhere.  Can someone tell me the how to call
>> standard deviation?  I have a datatable and I need to determine the std
> for
>> a series of rows.
>
> The data is in a database - so you can use SQL to get that information.
> http://www.oreilly.com/catalog/sqlnut/chapter/ch04.html
>
>
Author
3 Apr 2006 6:37 PM
William LaMartin
You will either have to write your own function, which isn't hard, or you
can add a reference to Microsoft Excel and use the following type of code to
display both the average and standard deviation of a collection of numbers.

I would write my own function.

  Dim xL As New Excel.Application
        Dim S As String = "Average(1, 2, 3, 4, 5, 6, 7, 8)"
        MsgBox(xL.Evaluate(S).ToString)
        S = "STDEV(1,2,3,4,5,6,7,8)"
        MsgBox(xL.Evaluate(S).ToString)


Show quoteHide quote
"Scott" <scott@scott.scott> wrote in message
news:rKqdnTYOyv7RTLPZnZ2dneKdnZydnZ2d@comcast.com...
>I know in some other languages there is a simple standard deviation
>function (sdev(1,2,3,4,5,etc...)).  But I'm unable to find a suitable
>alternative for vb.net
>
> I'm assuming it's there somewhere.  Can someone tell me the how to call
> standard deviation?  I have a datatable and I need to determine the std
> for a series of rows.
>
> Thanks for the help!
>