You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: CBIG_manova_cov.m
    path of file: ./repos/CBIG/utilities/matlab/stats
    
    the code of the file until where you have to start completion: function [sbb, sww, icc] = CBIG_manova_cov(data)

% [sbb, sww, icc] = CBIG_manova_cov(data)
% Implemented as in Equation 3 of Amemiya 1985 (What should be done when an estimated
% between-group covariance Matrix is not Nonnegative Definite)
% WITHOUT correction for negative-definite covariance
%
% assume data = n x r x p 
% where n is # targets, r is # judges, p is # dimensions of observations
%
% Model assumption
%
% Y_{ij} = mu + b_i + w_{ij},  1 <= j <= r, 1 <= i <= n
%
% b_i ~ mean 0, cov s_bb;  w_{ij} ~ mean 0, cov s_ww
%

    
function [sbb, sww, icc] = CBIG_manova_cov(data)

% [sbb, sww, icc] = CBIG_manova_cov(data)
% Implemented as in Equation 3 of Amemiya 1985 (What should be done when an estimated
% between-group covariance Matrix is not Nonnegative Definite)
% WITHOUT correction for negative-definite covariance
%
% assume data = n x r x p 
% where n is # targets, r is # judges, p is # dimensions of observations
%
% Model assumption
%
% Y_{ij} = mu + b_i + w_{ij},  1 <= j <= r, 1 <= i <= n
%
% b_i ~ mean 0, cov s_bb;  w_{ij} ~ mean 0, cov s_ww
%
% p can be equal to 1.
%
%
% Written by CBIG under MIT license: https://github.com/ThomasYeoLab/CBIG/blob/master/LICENSE.md



n = size(data, 1);
r = size(data, 2);

if(n < 2)
   error('n has to be at least 2'); 
end