I am doing a linear regression problem. It is a multivariate one and I do not know how to detect outliers because it is multivariate and the scatter graph will not help. Any suggestions?
You might have a look at Robust Statistics in Wikipedia. There is a reference there to a quite recent book by Maronna et al. A lot depends on how many outliers you have. If you have only one outlier, you can find it using $O(\log(n))$ regressions where $n$ is the number of cases, using the divideandconquer version of case removal (row deletion). Or even using $3$ regressions to obtain a robust fit by divideandconquer case removal, and then identify the outliers by comparing with the robust fit. If you have more than one outlier, divideandconquer case removal becomes more complicated, and you might be better off looking at the book of Maronna et al; also there are recent papers by Hawkins and Olive that are very relevant. But then it becomes a question of availability of software: for divideandconquer case removal you just use the regression software you already have. 


RANSAC is an algorithm for fitting a model to data with outliers.
Then choose the largest set of agreeing points and fit the model to that set. 


You might use Cook's distance or Mahalanobis distance, for instance. 


To achieve the robust estimation, you could try the least square regression with L1 regularization that is also wellknown LASSO algorithm. http://wwwstat.stanford.edu/~tibs/lasso.html The relationship between robust estimation and lasso is explained in the following paper: http://www.cim.mcgill.ca/~xuhuan/papers/LassoNIPS.pdf 


RANSAC can be used to find the best fit for data which includes outliers. Below is what I did to solve a line fitting problem in robotic vision using RANSAC. Dr. Mariottini was the professor who taught us the approach and provided some templates for implementation. The credit goes to him and not me. The code is for MATLAB, and the reference to Z.mat is for a file containing the detected points along the wall to be followed which also contains outliers to be excluded.



If you are committed to linear regression, there are two choicesregularization, and changing the loss function (linear regression usually means least squares, which (without regularization) can be solved conveniently with a line of matrix manipulation in matlab). As far as regularization goes, the two techniques which get lots of attention are ridge regression (l2regularization) and lasso (l1regularization). These days, l1regularization gets more attention due to connections to sparsity and also its use in compressed sensing. If you don't have many variables, i.e. model complexity isn't the problem and you just have some outliers really messing with the hyperplane, you can use a more insensitive loss function, for instance absolute loss or huber loss (huber loss is similar to absolute loss in terms of sensitivity to outliers, but is also differentiable). 

