[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: probability scale on 2D line plot?



Charlotte DeMott wrote:

> Does anyone know how to create a "probability axis" for a
> line plot?  This is an axis that runs from nearly zero to
> nearly 1, that is stretched at each end, such that the
> cumulative distribution of a normal population appears as a
> straight line.
>
> For anyone familiar with the atmospheric sciences, numerous
> examples may be seen in Houze and Cheng, 1977, MWR 106,
> 964-980.
>
> Thanks,
> Charlotte
>
> ---
> Charlotte A. DeMott
> Department of Atmospheric Science
> Colorado State University
> Fort Collins CO  80523
> demott@massif.atmos.colostate.edu
> 970 491 1487

Please find attached my little QQNORM program. That's the name of that
"deviation from standard probability distribution" function in SPlus. It
will compute the deviation from the expected probability for each data
point.

Hope this helps,
Martin.



--
-------------------------------------------------------------------
Dr. Martin Schultz
Department for Engineering&Applied Sciences, Harvard University
109 Pierce Hall, 29 Oxford St., Cambridge, MA-02138, USA

phone: (617)-496-8318
fax  : (617)-495-4551

e-mail: mgs@io.harvard.edu
Internet-homepage: http://www-as.harvard.edu/people/staff/mgs/
-------------------------------------------------------------------




function qqnorm,data

; mgs, 12/14/98, extracted from w_calc.pro
; procedure: sort the data, assign actual "probability" and calculate
; the expected deviation from the mean

   ; compute mean and standard deviation
   bla = moment(data)
   mean = bla[0]
   sigma = sqrt(bla[1])

   ; make working copy to store result and compute sort index
   tmp = data
   tmpind = sort(tmp)
   N = n_elements(tmp)
   for i=0,n-1 do tmp[tmpind[i]] = gauss_cvf( 1.-(i+0.5)/N )

   return,tmp
end