how to plot adjusted r squared , sum of squared error and f-statistic values in one figures in matlab

To plot adjusted R-squared, sum of squared error, and F-statistic values in one figure in MATLAB, you can use the plot function.

First, you will need to have the values of the adjusted R-squared, sum of squared error, and F-statistic stored in separate variables. Let's assume you have them stored in the variables adjR2, sse, and fstat respectively.

Here is an example code to plot these values in the same figure:

main.m
% Example data
adjR2 = [0.75, 0.80, 0.85, 0.90];
sse = [100, 90, 80, 70];
fstat = [10, 20, 30, 40];

% Plotting the values
x = 1:length(adjR2); % create x-axis values
figure; % create a new figure
hold on; % enable plotting multiple lines on the same figure

% plot adjusted R-squared
plot(x, adjR2, 'r*-');

% plot sum of squared error
plot(x, sse, 'bo-');

% plot F-statistic
plot(x, fstat, 'gs-');

% add legend
legend('Adjusted R-squared', 'Sum of Squared Error', 'F-statistic');

% add labels
xlabel('Model Number');
ylabel('Value');

% add title
title('Model Evaluation Metrics');

hold off; % disable further addition of lines to the figure
648 chars
31 lines

This code will create a figure with three lines, each representing the values of adjusted R-squared, sum of squared error, and F-statistic respectively. The x-axis represents the model number, while the y-axis represents the value of the corresponding metric.

Feel free to replace the example data with your actual data and customize the plot according to your needs.

Note: It's advisable to have the same number of data points in each variable.

gistlibby LogSnag