Linear correlation in 3D? What's the name of a statistical method used to determine the goodness of fit of a series of points in 3D space that are to be fitted on a regression line ?
I can calculate a regression line and the linear (Pearson) correlation coefficient from datapoints in 2D, but have no clue how to do that in 3D.
The name of the methods or references to source materials would be sufficient so I can dig deeper into the subject. All the statistics manuals I found sofar only deal with 2D points.
 A: Even in 2-d, there are two basic ways to approach a "line fitting problem": One is that you want the line that minimizes the sum of squared errors when your 2d points are projected onto the line, and the other is that you want to find the line that minimizes the squared residual of ONE variable (the dependent variable) when it is considered to be a linear function of the other variable (the independent variable). Obviously these are different for example if you have just one unique observed value of independent variable and multiple observed values of dependent variable, across multiple samples. In this case if you fit a line to the 2d points the line it will be perfect, but if you want to best predict the dependent variable in terms of the independent variable then all you can do is predict the observed mean of the dependent variable. These kinds of considerations extend to 3-d as well. You need to decide if you are just trying to fit a line that minimizes sum of squared residuals when projected onto that line, or whether you have two dependent variables and one independent variable and you want the best linear predictors for your dependents in terms of your independent.
