Code covered by the BSD License  

Highlights from
qtukey

2.0

2.0 | 1 rating Rate this file 7 Downloads (last 30 days) File Size: 1.77 KB File ID: #3469

qtukey

by Antonio Trujillo-Ortiz

 

20 May 2003 (Updated 27 May 2003)

Finds the Tukey's q studentized range critical value.

| Watch this File

File Information
Description

This function finds the Tukey's q studentized range critical value. This modified macro is based on the Fortran77 algorithm AS 190.2 Appl. Statist. (1983). It needs the sample degrees of freedom (must be the same for each sample), the k number of samples and the p-cumulative probability value (default=0.95). It gives a very good approximation for 0.8 < p < 0.995).

MATLAB release MATLAB 5.3 (R11)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (3)
03 Apr 2006 Liran Carmel

Not accurate. For example, qtukey(20,11,0.99) is 6.1422, while in the tables it is 6.190.

17 Apr 2011 William Rose

qTukey() not very accurate.
qTukey implements an algorithm (AS 190.2, called qtrng0() in the Fortran) which was only intended to be a first approximation of Tukey's q. qtrng0 was intended to serve as a startup estimate for the more accurate routine, AS 190.1, called qtrng() in the Fortran. qtrng() uses AS 190, called prtrng() in the Fortran. ptrng() computes a p value for a given q statistic. qtrng() computes q for a desired probability p by recursively calling prtrng() and updating its estimate for q, until the desired accuracy is achieved (p within 0.001 in the Fortran code). If someone converts the Fortran routines prtrng() and qrtrng to m files, then we will have a good algorithm for estimating Tukey's q. Fortran code at http://lib.stat.cmu.edu/apstat/190.
- rosewc@udel.edu

23 May 2012 Mark

The statistics toolbox does have a private function that implements AS 190 and 190.2 under toolbox/stats/private/stdrinv.m from R2011a. It is called from the multcompare tool when doing the default Tukey HSD comparison.

The note accompanying the code is
% Based on Fortran program from statlib, http://lib.stat.cmu.edu
% Algorithm AS 190 Appl. Statist. (1983) Vol.32, No. 2
% Incorporates corrections from Appl. Statist. (1985) Vol.34 (1)

Please login to add a comment or rating.
Updates
27 May 2003

It was added an appropriate format to cite this file.

Tag Activity for this File
Tag Applied By Date/Time
statistics Antonio Trujillo-Ortiz 22 Oct 2008 07:01:43
probability Antonio Trujillo-Ortiz 22 Oct 2008 07:01:43
tukeys q Antonio Trujillo-Ortiz 22 Oct 2008 07:01:43
tukeys q studentized range critical value Antonio Trujillo-Ortiz 22 Oct 2008 07:01:43
studentized Antonio Trujillo-Ortiz 22 Oct 2008 07:01:43

Contact us at files@mathworks.com