Geoscience Reference
In-Depth Information
Estimated Coefficients:
Estimate SE tStat pValue
________ __ _____ ______
(Intercept) 0.2 0 Inf 0
Var1 -52 0 -Inf 0
Var2 276 0 Inf 0
Number of observations: 50, Error degrees of freedom: 47
Root Mean Squared Error: 0
R-squared: 1, Adjusted R-Squared 1
F-statistic vs. constant model: Inf, p-value = 0
i rst recalls the linear regression model using the names of the response
variable and the predictor variables. It then displays a table with the regression
coei cient estimates for each predictor variable in the i rst column, the
standard error, the F -statistic, and the p -values of the coei cient estimates.
h e quality of the model is excellent as the p -value of the constant model, i.e.,
with no inl uence of predictor variables on the response variable, is zero, as
suggested in the last line of the comments below the table.
Since we have only three variables we can display the results in a three-
dimensional plot. We i rst create a rectangular grid for the i rst two variables
and then calculate the predicted values for the second variable using the
estimated regression coei cients. We then use surf to display the linear
regression plane of the model and line to plot the measurements as red
points, with a marker size of 30 points.
[Var1,Var2] = meshgrid(0.20:0.01:0.45,0.17:0.01:0.23);
Var3 = beta.Coefficients.Estimate(1) + ...
beta.Coefficients.Estimate(2)*Var1 + ...
beta.Coefficients.Estimate(3)*Var2;
surf(Var1,Var2,Var3,'FaceAlpha',0.2), hold on
line(data(:,1), data(:,2), data(:,3),...
'LineStyle','none',...
'Marker','.',...
'MarkerSize',30)
grid on
view(70,30)
hold off
Since the data set is noise free the data points all lie on the linear regression
plane. h is changes if we introduce normally-distributed noise with a
standard deviation of 2.4.
clear
rng(0)
Search WWH ::




Custom Search