"Tim " <
timothy...@go.wustl.edu> wrote in message
news:jnusd3$eb6$1...@newscl01ah.mathworks.com...
If you remove all the rows from your independent matrix that contain at
least one NaN and remove the corresponding elements of your dependent
vector, what are the sizes of the new matrix and vector?
M = [magic(5); 1,2,3,4,5];
b = sum(M, 2);
stats = regstats(b, M, 'linear', 'all') % Works; 6 data points, 6 predictors
with the implicit constant
M([1 8]) = NaN
stats = regstats(b, M, 'linear', 'all') % Errors; only 4 data points (the
first two are removed) versus 6 predictors with the implicit constant
stats = regstats(b(3:end), M(3:end, :), 'linear', 'all') % Ditto
--
Steve Lord
sl...@mathworks.com
To contact Technical Support use the Contact Us link on
http://www.mathworks.com