jstat.covariance(allDisplacement,allHorsepower)// confirming I calculated it correctly...
alternativeSlopeCalc=covariance(allDisplacement,allHorsepower)/(variance(allDisplacement))// covar/var is supposed to give the slope. It is close but slightly smaller.
Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.