function r8vec_rsquared_adjusted_test ( )

%*****************************************************************************80
%
%% r8vec_rsquared_adjusted_test() tests r8vec_rsquared_adjusted().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    16 January 2019
%
%  Author:
%
%    John Burkardt
%
  degree = 2;
  n = 11;

  y_model = [ ...
     0.00,  9.00, 16.00, 21.00, 24.00, ...
    25.00, 24.00, 21.00, 16.00,  9.00,  ...
     0.00 ];
  y_data = [ ...
     0.00,  9.58, 16.76, 21.52, 24.38, ...
    24.97, 22.90, 20.45, 12.40,  7.65, ...
    -3.82 ];

  fprintf ( 1, '\n' );
  fprintf ( 1, 'r8vec_rsquared_adjusted_test():\n' );
  fprintf ( 1, '  r8vec_rsquared_adjusted() evaluates the adjusted R^2 goodness-of-fit statistic.\n' );

  r8vec2_print ( y_data, y_model, "  Data and model:" );

  rsquared = r8vec_rsquared_adjusted ( n, y_data, y_model, degree );
  fprintf ( 1, '\n' );
  fprintf ( 1, '  Computed R^2, adjusted for degree = %d, is %g\n', degree, rsquared );

  return
end
