Results 1 to 3 of 3
  1. #1
    registoni is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    13

    st deviation function on array

    In one new function in my vba code I have declared array variable and then used a procedure to fill it.



    Dim arrROAA(0 To 4) As Double

    'procedure to fill the array.


    now I want to calculate the sample standard deviation . There is a function DStDev, but I have no idea how to apply this function to the data inside my array.
    I tried:

    stdev = DStDev(arrROAA(0), arrROAA(1), arrROAA(2), arrROAA(3), arrROAA(4))

    But it didnot work.

    Any help?

  2. #2
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,716

  3. #3
    registoni is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    13
    Microsoft Access has several built-in functions that enable you to perform statistical analysis across Records, it does not have a built-in function to perform statistical analysis across multiple columns within a single row.
    achieve calculation of standard deviation on array consisting of 5 numeric values by the following 3 lines in VBA code:

    meanROAA = (arrROAA(0) + arrROAA(1) + arrROAA(2) + arrROAA(3) + arrROAA(4)) / 5
    sumsqr = (arrROAA(0) - meanROAA) ^ 2 + (arrROAA(1) - meanROAA) ^ 2 + (arrROAA(2) - meanROAA) ^ 2 + (arrROAA(3) - meanROAA) ^ 2 + (arrROAA(4) - meanROAA) ^ 2
    stdev = Sqr(sumsqr / 4)

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 6
    Last Post: 05-31-2013, 07:46 PM
  2. Array will not ReDim...
    By yeah in forum Programming
    Replies: 1
    Last Post: 10-08-2011, 06:30 PM
  3. Having Trouble Returning Array from Function
    By NigelS in forum Programming
    Replies: 8
    Last Post: 08-15-2011, 07:12 AM
  4. INNER JOIN to a split(array) function?
    By kman42 in forum Queries
    Replies: 8
    Last Post: 05-09-2011, 01:53 PM
  5. can i put the result in array?
    By dada in forum Programming
    Replies: 1
    Last Post: 08-19-2010, 07:17 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums