balanced=1; % balanced=1 if the sample is balanced 当样本值完整时,balance=1
if sum(sum(isnan(data)))>0 % Not Balanced Sample(
disp(' '),disp(' WARNING: The sample is not balanced'),disp(' ') %显示 WARNING: The sample is not balanced
balanced=0; % balanced=0 if the sample is not balanced 当样本数值不完整,balance=0;
end
missing=sum(isnan(data)')'; % Location of Missing Values 丢失数据的位置
sample(:,1)=ones(length(Y),1); %使数据第一列全部等于1
sample(missing>0)=0; % Sample of Complete Data ???
balanced_indi=repmat((1:N),T,1);sample(:,2)=balanced_indi(:); % Index of Individuals??
sample(:,3)=repmat((1:T),1,N)'; % Index of Time??
Qadj=Q(sample(:,1)==1); % Values of Qit on the Adjuted Sample??
Xadj=X(sample(:,1)==1,:); % Values of Xit on the Adjuted Sample??