<< 
      DiscreteMath`Combinatorica`

    << Statistics`ContinuousDistributions`

    ndist = 
      NormalDistribution[0, 
        1]



    x =  { .225,   .262,  .217,   .240,   .230,   .229,   .235,  .217}

    y =  { .209,  .205,  .196,   .210,  .202,   .207,   .224,   .223,   .220,   .201}

    z = Join[x, y]

    m1 = Mean[x]

    m2 = Mean[y]

    diff = m1 - m2

    18!

    Binomial[18, 8]

    zb = Mean[z]

    sz2 = Variance[z]

    sN2 = (1 - 7/17)*sz2/8

    tau = (m1 - zb)/Sqrt[sN2]
 (* 
      This is the finite - sampling form of the permutation - 
        t statistic *) 
 (* See chapter 6,  
      section 2,  
      582 notes                             *) 


    SS = KSubsets[z, 8];

    FL = 
        Table[(Mean[SS[[j]]] - zb)/Sqrt[sN2], {j, 1, 
            Length[SS]}];



    nn = Length[SS];

    zz = Sort[FL];

    hh = Table[k, {k, 1, nn}]*(1/nn); // N

    nq = 
        Table[Quantile[ndist, k/(nn + 1)], {k, 1, 
            nn}];

    J1 = 
        Table[{zz[[i]], hh[[i]]}, {i, 1, nn}];

    J2 = 
        Table[{zz[[i]], nq[[i]]}, {i, 1, nn}];

    ListPlot[J1]

    ListPlot[J2]

    Delta[x_] := 0 /; x < 0

    Delta[x_] := 1 /; x ≥ 0

    DE[x_] := Table[{Delta[zz[[i]] - x]}, {i, 1, nn}]

    EDF[nn_, x_] := 
      1.  - Apply[Plus, DE[x]]*(1/nn) // N

    P1 = Plot[EDF[nn, x], {x, -3, 3}, PlotRange -> {0, 1}, 
        PlotStyle -> {Thickness[1/100], RGBColor[0.400, 0.000,  .6], 
            Dashing[{}]}]

    1 - EDF[nn, tau] 

    1 - EDF[nn, tau] + 
      EDF[nn, -tau]