In C++ language please!!!
Suppose we have a set of data consisting of ordered pairs and we suspect
the x and y coordinates are related. It is natural to try to find the best line that
fits the data points. If we can find this line, then we can use it to make all sorts
of other predictions. In this project, we're going to use several functions to find
this line using a technique called least squares regression. The result will be
what we call the least squares regression line (or LSRL for short).
In order to do this, you'll be able to reuse some code you've already written
(improve it if necessary, of course), as the LSRL is more or less based on
statistical calculations we've already automated. You'll need to program one
new statistical computation called the correlation coefficient, denoted by r in
statistical symbols:
r = 1/ (n-1) SUM ((x initial -x / Sx ) * (y initial - y / Sy )
Once you have the correlation coefficient, you use it along with the sample
means and sample standard deviations of the x and y-coordinates to compute
the slope and y-intercept of your regression line via these formulas:
By the way, this is another of those numerical methods that computers do so
well. While it's possible to compute an LSRL by hand, automating all of the tedious calculations makes sense, and leaves us to spend our time interpreting
our results in a practical context.
http://www.slideshare.net/guilhermetorres7921/project-37831709
Full Project is on this website in pdf! No virus. Thanks!!!