Focal Point
[SOLVED] How to obtain 95%tile

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/7887040906

August 29, 2011, 09:33 PM
Kengaun
[SOLVED] How to obtain 95%tile
Hi,

Would like to get help and advise how to do this in FOCUS.

Example- Have 132 data values, would like to find out the 95%tile of the data value field - PCYCT

In the manual method is use 132 * 0.05 = 6.6 then is 7 as record# , so the value for 95%tile of PCYCT is 3.9 as per showed in below.

Can you help to advise do FOCUS have such function or any method can produce the result ?

Currently we are running Focus 6.9.4 on OpenVMS Alpha Operating System, Version V6.2-1H3.

----------------------------------------
Date values:-
GROUP LOTNO PLANTCT
LOGIC lot130 13.4 1
LOGIC lot1 9.5 2
LOGIC lot2 8.2 3
LOGIC lot58 7 4
LOGIC lot102 4.3 5
LOGIC lot59 4.1 6
LOGIC lot132 3.9 7 =95% tile
LOGIC lot14 3.8
LOGIC lot15 3.8
LOGIC lot98 3.8
LOGIC lot131 3.8

This message has been edited. Last edited by: Kerry,


Focus 6.9.4 on OpenVMS
, All Outputs
August 30, 2011, 01:16 PM
Doug
Give this a shot for starters:
-WRITE 95THPCTL
-WRITE 95THPCTL FILE=95THPCTL,SUFFIX=FOC
-WRITE 95THPCTL SEGNAME=SEG1, SEGTYPE=S0
-WRITE 95THPCTL FIELD=GROUP,        , A5   , A5   ,$
-WRITE 95THPCTL FIELD=LOTNO,        , A6   , A6   ,$
-WRITE 95THPCTL FIELD=PLANTCT,      , A4   , A4   ,$
-RUN
CREATE FILE 95THPCTL
MODIFY FILE 95THPCTL
FIXFORM GROUP/A5 LOTNO/A6 PLANTCT/A4
DATA
LOGIClot13013.4
LOGIClot1   9.5
LOGIClot2   8.2
LOGIClot58  7.0
LOGIClot102 4.3
LOGIClot59  4.1
LOGIClot132 3.9
LOGIClot14  3.8
LOGIClot15  3.8
LOGIClot98  3.8
LOGIClot131 3.8
END
-RUN
TABLE FILE 95THPCTL
SUM CNT.GROUP
ON TABLE HOLD
END
-RUN
TABLE FILE 95THPCTL
"COMPUTE 95TH FROM &RECORDS RECORDS"
PRINT GROUP
      LOTNO
      PLANTCT
COMPUTE 95TH/D6.2 = &RECORDS * 0.05 ; 
ON TABLE NOTOTAL
ON TABLE SET PAGE OFF
END
I don't have time now, so, you need to work on the compute.
August 30, 2011, 02:17 PM
Doug
Consider this:
TABLE FILE 95THPCTL
"COMPUTE 95TH FROM &RECORDS RECORDS"
PRINT GROUP
      LOTNO
      PLANTCT
COMPUTE ITEMNMBR/I4 = ITEMNMBR + 1 ;
COMPUTE 95THD6/D4 = (&RECORDS * 0.05) * 10 ; 
COMPUTE 95THA1/A1   = IF ITEMNMBR GT 95THD6 THEN 'Y' ELSE 'n'; 
ON TABLE NOTOTAL
ON TABLE SET PAGE OFF
END
And take only the 'Y' records... Whatever...
August 31, 2011, 03:52 AM
Kengaun
Hi Doug,

Thanks for your solution.

Would like to check whether you know FOCUS have any function to do this or need to use this method ?


Focus 6.9.4 on OpenVMS
, All Outputs