if (NON_EMPTY_SELECTION)
{
	count = Columns (SELECTED_CHART_DATA);

	sum  = 0;
	sum2 = 0;
	sum3 = 0;
	sum4 = 0;
	
	SELECTED_CHART_DATA = Transpose(SELECTED_CHART_DATA)%0;
	
	data_min  = SELECTED_CHART_DATA [0];
	data_max  = SELECTED_CHART_DATA [count-1];
	data_25   = SELECTED_CHART_DATA [(count*0.025)$1];
	data_975  = SELECTED_CHART_DATA [Min((count*0.975+0.5)$1,count-1)];
	
	if (count%2)
	{
		median = SELECTED_CHART_DATA[count/2];
	}
	else
	{
		counter = count/2-1;
		median = (SELECTED_CHART_DATA[counter]+SELECTED_CHART_DATA[counter+1])/2;
	}

	for (counter=0; counter < count; counter = counter+1)
	{
		term = SELECTED_CHART_DATA [counter];
		sum  = sum+term;
		sum2 = sum2+term*term;
		sum3 = sum3+term^3;
		sum4 = sum4+term^4;
	}

	if (count > 1)
	{
		counter = (sum2-sum*sum/count)/(count-1);
		
		if (count > 3)
		{
			sum4 = (-6*sum^4+12*count*sum^2*sum2-3(count-1)*count*sum2^2-4*count(count+1)*sum*sum3+count^2*(count+1)*sum4)/(count*(count-1)*(count-2)*(count-3));
			sum4 = sum4/counter^2+3;
		}
		else
		{
			sum4 = 0;
		}	

		if (count > 2)
		{
			sum3 = (2*sum^3-3*count*sum*sum2+count^2*sum3)/(count*(count-1)*(count-2))/Sqrt(counter^2);
		}
		else
		{
			sum3 = 0;
		}	
		
		fprintf (stdout, "\nCount    = ", count,
						 "\nMean     = ", sum/count,
						 "\nMedian   = ", median,
						 "\nVariance = ", counter,
						 "\nStd.Dev  = ", Sqrt (counter),
						 "\nCOV      = ", Sqrt (counter)*count/sum,
						 "\nSum      = ", sum,
						 "\nSq. sum  = ", sum2,
						 "\nSkewness = ", sum3,
						 "\nKurtosis = ", sum4,
						 "\nMin      = ", data_min,
						 "\n2.5%     = ", data_25,
						 "\n97.5%    = ", data_975,
						 "\nMax      = ", data_max,"\n\n");
	}
	else
	{
		fprintf (stdout, "\nCount    = ", count,
						 "\nMean     = ", sum/count,
						 "\nMedian   = ", median,
						 "\nVariance = Inf",
						 "\nStd.Dev  = Inf",
						 "\nCOV      = Inf",
						 "\nSum      = ", sum,
						 "\nSq. sum  = ", sum2,
						 "\nMin      = ", data_min,
						 "\nMax      = ", data_max,"\n\n""\n\n");
	}
}
else
{
	NON_EMPTY_SELECTION = -1;
}
