@Ryan, I noticed that the function uses gamma(degrees of freedom), which becomes infinity very quickly with larger data sets. I think this is the source of the NaN values.

29 Apr 2013

dunnett.m
Dunnett test for multiple comparisons.
Requires Statistics Toolbox
Author: Navin Pokala

I am very interested in using this code, but when run it on my data, I keep getting NaN for all p-values. I think I tracked this down to a high degrees of freedom (971 in my case), although I am admittedly unfamiliar with the algorithm implemented here.

I can replicate my problem using the example code in the help of dunnett.m. After running that code (which executes normally) run the following two lines of code to find that all comparisons yield NaN results:
stats.df = 971; % actually, anything over ~400 will work
p = dunnett(stats)

26 Apr 2013

dunnett.m
Dunnett test for multiple comparisons.
Requires Statistics Toolbox
Author: Navin Pokala

Sorry, I take that back. I do not get the expected results by changing line 118. So I am simply not sure why I keep getting NaNs for all comparisons. Any ideas would be greatly appreciated.

03 Oct 2012

dunnett.m
Dunnett test for multiple comparisons.
Requires Statistics Toolbox
Author: Navin Pokala