2007 Aug 13 12:59 PM
hi all friends ,
for example :
i have these numbers : 13, 8, 5, 2
so result std of this must be : 4.69
which sap function can i use to calculate and get this result ?
thanks to all,
avi
hi all friends ,
for example :
i have these numbers : 13, 8, 5, 2
so result std of this must be : 4.69
which sap function can i use to calculate and get this result ?
thanks to all,
avi
2007 Aug 13 1:02 PM
2007 Aug 13 1:03 PM
try this code..
data : begin of it occurs 1,
num type p,
x_xbar type p,
end of it.
data : num1 type p value 10.
data : tot type p,l(2),
total type p. " E(x - mean)^2
data : mean type p.
data : var type p,
sd type p.
do 5 times .
it-num = num1.
append it.
num1 = num1 + 10.
enddo.
loop at it .
tot = tot + it-num.
endloop.
describe table it lines l.
mean = tot / l.
loop at it .
it-x_xbar = ( it-num - mean ) * ( it-num - mean ).
total = total + it-x_xbar.
endloop.
var = ( total ) / ( l - 1 ).
sd = SQRT( var ).
write : sd.
reward if it helps..
Regards,
Omkar.
2007 Aug 13 1:07 PM
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |