Get the 75th percentile of vector.
double y75( vector & vec )
Returns the 75th percentile of vector.
EX1
// This is a self contained sample program for the function y75, // Its sample data is created at the beginning of the program. // To run the program, enter the following command in the Script window: // y75_ex1 // It returns like: // 75th Percentile of Book3_B = 0.47304 // void y75_ex1() { Worksheet wks; wks.Create(); Dataset myDs(wks, 1); String strDsName = myDs.GetName(); //******* Create sample data ***************** myDs.SetSize(7); myDs[0]=0.3; myDs[1]=0.097; myDs[2]=0.41256; myDs[3]=0.24909; myDs[4]=0.47304; myDs[5]=0.2476; myDs[6]=0.64529; myDs.Sort(); //******** End of Sample Data Creation ******* vector vVal = myDs; double dP75 = y75(vVal); // Demonstration of y75 printf("75th Percentile of %s = %g\n", strDsName, dP75); }
Let the th percentile be y, set , n is the number of data points, and let
where j is the integer part of np, and g is the fractional part of np, then different methods define the percentile, y, as described by the following.
Get the 75th percentile of a vector(Not suppotted Dataset after version 8.0).
y25, y50
origin.h