Question: The following VBA function computes the sample standard deviation of a user-defined array of integers. The array indices are 0, 1, ..., n. Complete the

The following VBA function computes the sample standard deviation of a user-defined array of integers. The array indices are 0, 1, ..., n. Complete the code in line (6) below such that the sum of squared differences is stored in a variable named SumSq.

Be careful about uppercase and lowercase letters in your response!

  1. Function StdDev(n As Long, SampleArray() As Integer)
  2. Dim i As Integer
  3. Dim avg As Single, SumSq As Single
  4. avg = Mean(n, SampleArray)
  5. SumSq = 0
  6. Answer ?
  7. SumSq = SumSq + (SampleArray(i) - avg) ^ 2
  8. Next i
  9. StdDev = Sqr(SumSq / n)

End Function

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!