lib/stats.js
function() {
			// Get y coordinates
			var xCoords = this.pluck('x');
			var yCoords = this.pluck('y');

			// Do a log-log transformation of the coordinates
			xCoords.map(function(num) {
				return Math.log(num);
			});
			yCoords.map(function(num) {
				return Math.log(num);
			});

			// Get a new stats object to work with that has the transformed data
			var nums = this.clone().map(function(coord, index) {
				return {
					x: xCoords.get(index),
					y: yCoords.get(index)
				};
			});

			// Calculate the linear regression for the linearized data
			var linReg = nums.linReg();

			// Calculate the coefficient for the power equation
			var coefficient = Math.pow(Math.E, linReg.yIntercept);

			// Calculate the exponent for the power equation
			var exponent = linReg.slope;

			return {
				coefficient: coefficient,
				exponent: exponent,
				r: linReg.r
			};
		}
function() {
			// Get y coordinates
			var xCoords = this.pluck('x');
			var yCoords = this.pluck('y');

			// Do a log-log transformation of the coordinates
			xCoords.map(function(num) {
				return Math.log(num);
			});
			yCoords.map(function(num) {
				return Math.log(num);
			});

			// Get a new stats object to work with that has the transformed data
			var nums = this.clone().map(function(coord, index) {
				return {
					x: xCoords.get(index),
					y: yCoords.get(index)
				};
			});

			// Calculate the linear regression for the linearized data
			var linReg = nums.linReg();

			// Calculate the coefficient for the power equation
			var coefficient = Math.pow(Math.E, linReg.yIntercept);

			// Calculate the exponent for the power equation
			var exponent = linReg.slope;

			return {
				coefficient: coefficient,
				exponent: exponent,
				r: linReg.r
			};
		}
function ( ) { // Get y coordinates
 var xCoords = this . pluck ( 'x' ) ; var yCoords = this . pluck ( 'y' ) ; // Do a log-log transformation of the coordinates
 xCoords . map ( function ( num ) { return Math . log ( num ) ; } ) ; yCoords . map ( function ( num ) { return Math . log ( num ) ; } ) ; // Get a new stats object to work with that has the transformed data
 var nums = this . clone ( ) . map ( function ( coord , index ) { return { x : xCoords . get ( index ) , y : yCoords . get ( index ) } ; } ) ; // Calculate the linear regression for the linearized data
 var linReg = nums . linReg ( ) ; // Calculate the coefficient for the power equation
 var coefficient = Math . pow ( Math . E , linReg . yIntercept ) ; // Calculate the exponent for the power equation
 var exponent = linReg . slope ; return { coefficient : coefficient , exponent : exponent , r : linReg . r } ; }
Calculates the power regression line for the data set.  Returns an object with the coefficient, base, and correlation coefficient for the linearized data.
Calculates the power regression line for the data set . Returns an object with the coefficient base and correlation coefficient for the linearized data .