Category : BASIC Source Code
Archive   : QB_CODE.ZIP
Filename : TESTSTAT.BAS
DECLARE FUNCTION YesNo$ (Msg$)
DECLARE SUB Center.Message (Msg$, L%)
DECLARE SUB Blank.Lines (N%)
'------------------- from BASTAT ------------------
DECLARE SUB Initialize.Bastat ()
DECLARE SUB Sum.Data (D#(), Index%, IndxFreq%, N%)
DECLARE SUB Mean.Sdev (Mean#, Sdev#)
DECLARE SUB Moments (Mean#, Mom2#, Mom3#, Mom4#, _
SkewCoeff#, KurtCoeff#)
' QuickBASIC 4.0 program to test module BASTAT.BAS
' Copyright (c) 1988 Namir C. Shammas
' Modules Required:
' BASTAT.BAS
' TOOLBOX0.BAS
OPTION BASE 1
DIM X#(100, 1)
Message$ = "How many random numbers to generate (10->100)"
DO
CLS ' clear screen
CALL Center.Message("BASIC STAT FOR RANDOM NUMBER", 1)
CALL Center.Message("----------------------------", 2)
CALL Blank.Lines(3)
N% = Integer.In.Range%(Message$, 10, 100)
RANDOMIZE
FOR I% = 1 TO N%
X#(I%, 1) = 100 * RND(1)
NEXT I%
' Initialize summations and control variable
CALL Initialize.Bastat
' Accumlate statistical data
CALL Sum.Data(X#(), 1, 0, N%)
' calculate basic statistics
CALL Mean.Sdev(Mean#, Sdev#)
PRINT "Mean = "; Mean#
PRINT "Sdev = "; Sdev#
' Calculate the first four moments and the coefficients
' of skewness and kurtosis
CALL Moments(Mean#, Mom2#, Mom3#, Mom4#, SkewCoeff#, KurtCoeff#)
PRINT "Third moment = "; Mom3#
PRINT "Fourth moment = "; Mom4#
PRINT "Skewness coefficient = "; SkewCoeff#
PRINT "Kurtosis coefficient = "; KurtCoeff#
OK$ = YesNo$("Process another set")
LOOP UNTIL OK$ = "N"
END
Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!
This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.
But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/