DECLARE EXTERNAL FUNCTION mean, variance, StandardDeviation
DATA 1,2,3,4,5
DIM x(5)
MAT READ x
PRINT "mean";mean(x),"varinace";variance(x),"standard deviation";StandardDeviation(x)
END
EXTERNAL FUNCTION mean(x())
LET a=LBOUND(x)
LET b=UBOUND(x)
LET s=0
FOR i=a TO b
   LET s=s+x(i)
NEXT i
LET mean=s/SIZE(x)
END FUNCTION 
EXTERNAL FUNCTION variance(x())
DECLARE EXTERNAL FUNCTION mean
LET a=LBOUND(x)
LET b=UBOUND(x)
LET m=mean(x)
LET s=0
FOR i=a TO b
   LET s=s+(x(i)-m)^2
NEXT i
LET variance=s/SIZE(x)
END FUNCTION 
EXTERNAL FUNCTION StandardDeviation(x())
DECLARE EXTERNAL FUNCTION variance
LET StandardDeviation=SQR(variance(x))
END FUNCTION