>> fitlm(SB(:,3:end),SB(:,1))
ans =
Linear regression model:
y ~ 1 + x1 + x2 + x3 + x4 + x5 + x6 + x7
Estimated Coefficients:
Estimate SE tStat pValue
________ _____ _____ ______
(Intercept) 63.33 13.62 4.65 0.13
x1 -29.51 18.92 -1.56 0.36
x2 20.66 15.52 1.33 0.41
x3 4.74 14.23 0.33 0.80
x4 -4.83 15.69 -0.31 0.81
x5 20.96 33.11 0.63 0.64
x6 -0.02 21.87 -0.00 1.00
x7 1.42 16.83 0.08 0.95
Number of observations: 9, Error degrees of freedom: 1
Root Mean Squared Error: 2.49
R-squared: 0.934, Adjusted R-Squared 0.474
F-statistic vs. constant model: 2.03, p-value = 0.495
>> figure
>> LMA=ans;
>> plot(LMA)
>> title('Salinity ~ 1 + B1 +B2 + B3 +B4 + B5 +B6 + B7')
>> LM12=fitlm(SB(:,3:4),SB(:,1))
LM12 =
Linear regression model:
y ~ 1 + x1 + x2
Estimated Coefficients:
Estimate SE tStat pValue
________ ____ _____ ______
(Intercept) 67.74 2.13 31.82 0.00
x1 -20.86 5.90 -3.53 0.01
x2 21.88 3.21 6.82 0.00
Number of observations: 9, Error degrees of freedom: 6
Root Mean Squared Error: 1.33
R-squared: 0.887, Adjusted R-Squared 0.85
F-statistic vs. constant model: 23.6, p-value = 0.00144
>> figure
>> plot(LM12)
>> title('Salinity ~ 1 + B1 +B2')
>> ylim([40 100])
Best Answer