Code covered by the BSD License  

Highlights from
qtukey

1.5

1.5 | 2 ratings Rate this file 13 Downloads (last 30 days) File Size: 1.77 KB File ID: #3469

qtukey

by

 

20 May 2003 (Updated )

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).

Acknowledgements

This file inspired Cumulative Distribution Function Of The Studentized Range (For Tukey's Hsd Test).

MATLAB release MATLAB 5.3 (R11)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (5)
22 Feb 2013 Sav Deb

The last if condition, return values only for v<120. For v> it returns errors!!

22 Feb 2013 Sav Deb

Is there a better mode to obtain the q-vaue?
Has someone already converted Fortran routines prtrng() and qrtrng to m files?

Other solution?

Thanks

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)

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

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.

Contact us