Skuls: Diff. of Means by Monte Carlo

From: Luis A. Afonso (licas_at_html.com)
Date: 02/27/05


Date: Sun, 27 Feb 2005 13:16:31 +0000 (UTC)


Difference of means by Monte Carlo

Data was copied from Manly, B.F.J.(1991), Randomisation and Monte
Carlo methods in Biology . Chapman & Hall. It refers to the skulls
length (male-female) of pre-historic jackals.
The observed difference of means, 4.8 mm., was compared with those of
pairs of samples obtained by mixing up the data (10 chosen without
replacement among the total 20 in order to obtain the first sample
pair, the second one formed by the remained values). Total of these
differences 10000.
The frequencies, 10^(-3), of pairs whose differences were greater than
4.8 mm. (repeated 20 times):

1.8 0.6 1.2 1.8 1.4 0.2 1.2 0.6 0.4 1.0
0.4 0.6 0.7 1.2 0.8 0.8 0.9 0.5 0.8 1.1

Because they are all of them greater than 5% (0.05) I concluded that
there is a significant difference. (sexual dimorfism?)
Check: Studentīs t=3.484, 18 df, p=2.7 * 10^(-3). The conclusion is in
accordance with the previous one.

REM "SKULS"
        CLS
        RANDOMIZE TIMER
        DATA 120,107,110,116,114,111,113,117,114,112
        DATA 110,111,107,108,110,105,107,106,111,111
        FOR i = 1 TO 10: READ x(i, 1): xb(i, 1) = x(i, 1)
        mx = mx + x(i, 1) / 10: NEXT i: my = 0
        FOR j = 1 TO 10: READ x(j, 2): xb(j, 2) = x(j, 2)
        my = my + x(j, 2) / 10: NEXT j
        total = 10 * (mx + my)
        TRUE = mx - my
        PRINT " TRUE= "; TRUE
        PRINT
        REPEAT = 10000
        FOR V = 1 TO REPEAT
        LOCATE 10, 10: PRINT USING "#########"; REPEAT - V
        FOR a = 1 TO 2: FOR b = 1 TO 10
        xb(b, a) = x(b, a): NEXT b: NEXT a
        s = 0
        FOR w = 1 TO 10
1 him = 1
        IF RND > .5 THEN him = 2
        ww = INT(10 * RND) + 1
        IF xb(ww, him) = -777 THEN GOTO 1
        s = s + xb(ww, him)
        xb(ww, him) = -777
        NEXT w
        remain = total - s
        DIFF = s / 10 - remain / 10
        IF DIFF > TRUE THEN GOTO 5
        GOTO 6
5 GREATER = GREATER + 1
6 NEXT V
        PRINT GREATER / REPEAT

                                                Feedback, please

                                                Licas_@html.com