‎2008 Mar 10 8:27 AM
‎2008 Mar 10 8:32 AM
You can use the function module
1. 'QRKT_STD_DEVIATION_SHEWHART'-Algorithms for Shewhart chart for s with internal dispersion and mean line
2.'QRKT_STD_DEVIATION_SHEWHART_2'- Algorithms for Shewhart chart for s with overall dispersion and mean line.
You could also calculate it yourself of course - standard deviation is the square root of the sum of the square of the differences between the mean and each value divided by the number of values you have less one.
Reward points..
‎2008 Mar 10 8:38 AM
Hi,
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.
for square root
DATA : in TYPE f VALUE 16 ,
out TYPE f .
CALL METHOD cl_foev_builtins=>square_root
EXPORTING
im_number = in
IMPORTING
ex_result = out.
WRITE out.
Regards,
Omkar.
‎2008 Mar 10 8:44 AM
Hi,
You can use the SQRT to compute the square root.
Check the code.
data: var(3) type n,
sqt(3) type n.
var = 100.
sqt = sqrt( var ).
write: / sqt.
For Std deviation, you need to compute it manually or by using the function module
'QRKT_STD_DEVIATION_SHEWHART'
Reward if helpful.
Regards.