Code covered by the BSD License  

Highlights from
RNDTTEST

Be the first to rate this file! 2 Downloads (last 30 days) File Size: 3.74 KB File ID: #20928

RNDTTEST

by Giuseppe Cardillo

 

31 Jul 2008 (Updated 23 Dec 2009)

An alternative to Student t-test assessing difference in means.

| Watch this File

File Information
Description

Permutation or randomisation tests are a useful alternative to more standard parametric tests for analysing experimental data. They have the advantage of making no distributional assumptions (such as Normality)about the data, while remaining as powerful as more standard tests. The t-test assumes that the two groups arose by drawing samples from two Normally distributed populations, and that we are investigating whether these populations differ in their mean.
The randomisation test, on the other hand, assumes that some initial set of individuals were randomly allocated to two treatment groups. The number of permutations to be examined soon grows prohibitively large, so, this function uses two approaches: an Exact Method when the possible permutations are less than 20.000 and a Monte Carlo Naive Method when the
permutations are more than 20.000.
Example:
          X1=[12 17 14]; X2=[21 16 18];

rndttest(X1,X2)

Answer is:

RANDOMISATION TEST
--------------------------------------------------------------------------------
Exact Method
--------------------------------------------------------------------------------
20 randomisations evaluated
Probability (p-value) that the observed difference is accidental: 0.2000
--------------------------------------------------------------------------------

This p-value is the best one that can be quoted for these data. It is based only on the assumption that individuals are allocated at random to groups. It does not assume anything about Normality of distributions, which may or may not be true. Even when such assumptions are true, the randomisation test is as powerful as a t-test. (If you are curious, a t-test of the experimental data in our example gives p=0.12)

You can visit my homepage http://home.tele2.it/cardillo
My profile on XING http://www.xing.com/go/invita/13675097
My profile on LinkedIN http://it.linkedin.com/in/giuseppecardillo

Required Products Statistics Toolbox
MATLAB release MATLAB 7.5 (R2007b)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Please login to add a comment or rating.
Updates
24 Sep 2008

Improvement in input error handling

12 Nov 2008

Changes ih help section

27 Nov 2008

mistakes correction

11 Nov 2009

A more efficient computation was used

23 Dec 2009

Changes in description

Tag Activity for this File
Tag Applied By Date/Time
statistics Giuseppe Cardillo 22 Oct 2008 10:12:40
probability Giuseppe Cardillo 22 Oct 2008 10:12:40
randomisation Giuseppe Cardillo 22 Oct 2008 10:12:40
permutation Giuseppe Cardillo 22 Oct 2008 10:12:40
statistics Cristina McIntire 12 Nov 2008 14:33:10
probability Cristina McIntire 12 Nov 2008 14:33:10
permutation Wen-jing 15 Sep 2009 20:10:31
randomisation Wen-jing 15 Sep 2009 20:10:38
statistics Wen-jing 15 Sep 2009 20:10:40
permutation Eric Brunet-Gouet 12 Feb 2010 03:29:52

Contact us at files@mathworks.com