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!
- Function StdDev(n As Long, SampleArray() As Integer)
- Dim i As Integer
- Dim avg As Single, SumSq As Single
- avg = Mean(n, SampleArray)
- SumSq = 0
- Answer ?
- SumSq = SumSq + (SampleArray(i) - avg) ^ 2
- Next i
- StdDev = Sqr(SumSq / n)
End Function
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
