PCTL Function


Computes percentiles

Category: Descriptive Statistics

Syntax

PCTL < n >( percentage , value1 <, value2, >)

Arguments

n

  • is a digit from 1 to 5 which specifies the definition of the percentile to be computed.

  • Default: definition 5

percentage

  • specifies the percentile to be computed.

  • Requirement: is numeric where, 0 percentage 100.

value

  • is numeric.

Details

The PCTL function returns the percentile of the nonmissing values corresponding to the percentage. If percentage is missing, less than zero, or greater than 100, the PCTL function generates an error message.

Note: The formula that is used in the PCTL function is the same as the function that is used in PROC UNIVARIATE. For more information, see 'SAS Elementary Statistics Procedures' in Base SAS Procedures Guide .

Examples

SAS Statements

Results

  lower_quartile=PCTL(25,2,4,1,3);   put lower_quartile;  
  1.5  
  percentile_def2=PCTL2(25,2,4,1,3);   put percentile_def2;  
  1  
  lower_tertile=PCTL(100/3,2,4,1,3);   put lower_tertile;  
  2  
  percentile_def3=PCTL3(100/3,2,4,1,3);   put percentile_def3;  
  2  
  median=PCTL(50,2,4,1,3);   put median;  
  2.5  
  upper_tertile=PCTL(200/3,2,4,1,3);   put upper_tertile;  
  3  
  upper_quartile=PCTL(75,2,4,1,3);   put upper_quartile;  
  3.5  



SAS 9.1 Language Reference Dictionary, Volumes 1, 2 and 3
SAS 9.1 Language Reference Dictionary, Volumes 1, 2 and 3
ISBN: N/A
EAN: N/A
Year: 2004
Pages: 704

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net