View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Sheeloo[_3_] Sheeloo[_3_] is offline
external usenet poster
 
Posts: 1,805
Default how to encode statistical formula

Ok. I will have to brush up my Statistics.

Did you get what you wanted?

"MikhailGr" wrote:

Thank you very much.
This formula is for Kurtosis. I know there is Excel's Kurtosis, but the
problem is I need to use a different approach (there are several methods for
calculating Kurtosis).

"Sheeloo" wrote:

Step 5 formula should be
=(B101/(C101/100)^2)/100

Here is the UDF
Function StatFormula(rng As Range, N As Integer) As Double
Dim i As Integer
Dim Avg, Xi, SumXP2, SumXP4 As Double
Dim c As Range
Avg = WorksheetFunction.Average(rng)
For Each c In rng
Xi = c.Value
SumXP2 = SumXP2 + (Xi - Avg) ^ 2
SumXP4 = SumXP4 + (Xi - Avg) ^ 4
Next
StatFormula = (SumXP4 / (SumXP2 / N) ^ 2) / N
End Function
"Sheeloo" wrote:

Do you want a USER DEFINED FUNCTION for this? I can write that tomorrow... if
you want... Can you send me some sample data to test?

btw what is this formula computing?

If your can live with some manipulatoin then
1. Calcuate average in A101
=Average(A1:A100)
2. Enter in B1 and copy till B100
=(A1-$A$101)^4
3. Enter in C1 and copy till C100
=(A1-$A$101)^2
4. Enter in B101
=Sum(B1:B100) and copy right to C101
5. Finally enter this where you want your result
=(B101/(C101)^2)/100

Hope I got the formula right...

"Anastasia Gryaznov" wrote:

Hello,
Could you please help me to encode (make it in one function) the following
formula:

[SUM[(X(i) - Mean(X))^4] / ( ((SUM[(X(i) - Mean(X))^2] / N)^2) ] / N

where X(i) is group of numbers stored in cell range A1:A100.

Thanks.