function [header_national_rotations, nationals_rotations]=nationals_rotation_monthly(header_AT,header_BE,header_DE,header_EL,header_ES,header_FR,header_IE,header_IT,header_NL,header_PT,          data_AT,data_BE,data_DE,data_EL,data_ES,data_FR,data_IE,data_IT,data_NL,data_PT)

%% Industrial Production (IPMN)
id_ip_AT=find(ismember(header_AT, 'IPMN_AT')); ip_AT=data_AT(:,id_ip_AT);
id_ip_BE=find(ismember(header_BE, 'IPMN_BE')); ip_BE=data_BE(:,id_ip_BE);
id_ip_DE=find(ismember(header_DE, 'IPMN_DE')); ip_DE=data_DE(:,id_ip_DE);
id_ip_EL=find(ismember(header_EL, 'IPMN_EL')); ip_EL=data_EL(:,id_ip_EL);
id_ip_ES=find(ismember(header_ES, 'IPMN_ES')); ip_ES=data_ES(:,id_ip_ES);
id_ip_FR=find(ismember(header_FR, 'IPMN_FR')); ip_FR=data_FR(:,id_ip_FR);
id_ip_IT=find(ismember(header_IT, 'IPMN_IT')); ip_IT=data_IT(:,id_ip_IT);
id_ip_NL=find(ismember(header_NL, 'IPMN_NL')); ip_NL=data_NL(:,id_ip_NL);
id_ip_PT=find(ismember(header_PT, 'IPMN_PT')); ip_PT=data_PT(:,id_ip_PT);

header_ip = ['IPMN_AT';'IPMN_BE';'IPMN_DE';'IPMN_EL';'IPMN_ES';'IPMN_FR';'IPMN_IT';'IPMN_NL';'IPMN_PT'];
header_ip=cellstr(header_ip);
nationals_ip = [ip_AT,ip_BE,ip_DE,ip_EL,ip_ES,ip_FR,ip_IT,ip_NL,ip_PT];

% Price Index (HICPOV)
id_hicpov_AT=find(ismember(header_AT, 'HICPOV_AT')); hicpov_AT=data_AT(:,id_hicpov_AT);
id_hicpov_BE=find(ismember(header_BE, 'HICPOV_BE')); hicpov_BE=data_BE(:,id_hicpov_BE);
id_hicpov_DE=find(ismember(header_DE, 'HICPOV_DE')); hicpov_DE=data_DE(:,id_hicpov_DE);
id_hicpov_EL=find(ismember(header_EL, 'HICPOV_EL')); hicpov_EL=data_EL(:,id_hicpov_EL);
id_hicpov_ES=find(ismember(header_ES, 'HICPOV_ES')); hicpov_ES=data_ES(:,id_hicpov_ES);
id_hicpov_FR=find(ismember(header_FR, 'HICPOV_FR')); hicpov_FR=data_FR(:,id_hicpov_FR);
id_hicpov_IE=find(ismember(header_IE, 'HICPOV_IE')); hicpov_IE=data_IE(:,id_hicpov_IE);
id_hicpov_IT=find(ismember(header_IT, 'HICPOV_IT')); hicpov_IT=data_IT(:,id_hicpov_IT);
id_hicpov_NL=find(ismember(header_NL, 'HICPOV_NL')); hicpov_NL=data_NL(:,id_hicpov_NL);
id_hicpov_PT=find(ismember(header_PT, 'HICPOV_PT')); hicpov_PT=data_PT(:,id_hicpov_PT);

header_hicpov = ['HICPOV_AT';'HICPOV_BE';'HICPOV_DE';'HICPOV_EL';'HICPOV_ES';'HICPOV_FR';'HICPOV_IE';'HICPOV_IT';'HICPOV_NL';'HICPOV_PT'];
header_hicpov=cellstr(header_hicpov);
nationals_hicpov = [hicpov_AT,hicpov_BE,hicpov_DE,hicpov_EL,hicpov_ES,hicpov_FR,hicpov_IE,hicpov_IT,hicpov_NL,hicpov_PT];



% Long-Term Interest Rate (LTIRT)   
id_ltirt_AT=find(ismember(header_AT, 'LTIRT_AT')); ltirt_AT=data_AT(:,id_ltirt_AT);
id_ltirt_BE=find(ismember(header_BE, 'LTIRT_BE')); ltirt_BE=data_BE(:,id_ltirt_BE);
id_ltirt_DE=find(ismember(header_DE, 'LTIRT_DE')); ltirt_DE=data_DE(:,id_ltirt_DE);
id_ltirt_EL=find(ismember(header_EL, 'LTIRT_EL')); ltirt_EL=data_EL(:,id_ltirt_EL);
id_ltirt_ES=find(ismember(header_ES, 'LTIRT_ES')); ltirt_ES=data_ES(:,id_ltirt_ES);
id_ltirt_FR=find(ismember(header_FR, 'LTIRT_FR')); ltirt_FR=data_FR(:,id_ltirt_FR);
id_ltirt_IE=find(ismember(header_IE, 'LTIRT_IE')); ltirt_IE=data_IE(:,id_ltirt_IE);
id_ltirt_IT=find(ismember(header_IT, 'LTIRT_IT')); ltirt_IT=data_IT(:,id_ltirt_IT);
id_ltirt_NL=find(ismember(header_NL, 'LTIRT_NL')); ltirt_NL=data_NL(:,id_ltirt_NL);
id_ltirt_PT=find(ismember(header_PT, 'LTIRT_PT')); ltirt_PT=data_PT(:,id_ltirt_PT);

header_ltirt= ['LTIRT_AT';'LTIRT_BE';'LTIRT_DE';'LTIRT_EL';'LTIRT_ES';'LTIRT_FR';'LTIRT_IE';'LTIRT_IT';'LTIRT_NL';'LTIRT_PT'];
header_ltirt=cellstr(header_ltirt);
nationals_ltirt = [ltirt_AT,ltirt_BE,ltirt_DE,ltirt_EL,ltirt_ES,ltirt_FR,ltirt_IE,ltirt_IT,ltirt_NL,ltirt_PT];

% Stock Index (SHIX)   
id_shix_AT=find(ismember(header_AT, 'SHIX_AT')); shix_AT=data_AT(:,id_shix_AT);
id_shix_BE=find(ismember(header_BE, 'SHIX_BE')); shix_BE=data_BE(:,id_shix_BE);
id_shix_DE=find(ismember(header_DE, 'SHIX_DE')); shix_DE=data_DE(:,id_shix_DE);
id_shix_EL=find(ismember(header_EL, 'SHIX_EL')); shix_EL=data_EL(:,id_shix_EL);
id_shix_ES=find(ismember(header_ES, 'SHIX_ES')); shix_ES=data_ES(:,id_shix_ES);
id_shix_FR=find(ismember(header_FR, 'SHIX_FR')); shix_FR=data_FR(:,id_shix_FR);
id_shix_IE=find(ismember(header_IE, 'SHIX_IE')); shix_IE=data_IE(:,id_shix_IE);
id_shix_IT=find(ismember(header_IT, 'SHIX_IT')); shix_IT=data_IT(:,id_shix_IT);
id_shix_NL=find(ismember(header_NL, 'SHIX_NL')); shix_NL=data_NL(:,id_shix_NL);
id_shix_PT=find(ismember(header_PT, 'SHIX_PT')); shix_PT=data_PT(:,id_shix_PT);

header_shix= ['SHIX_AT';'SHIX_BE';'SHIX_DE';'SHIX_EL';'SHIX_ES';'SHIX_FR';'SHIX_IE';'SHIX_IT';'SHIX_NL';'SHIX_PT'];
header_shix=cellstr(header_shix);
nationals_shix = [shix_AT,shix_BE,shix_DE,shix_EL,shix_ES,shix_FR,shix_IE,shix_IT,shix_NL,shix_PT];

% Unemployment Rate (SHIX)   
id_unetot_AT=find(ismember(header_AT, 'UNETOT_AT')); unetot_AT=data_AT(:,id_unetot_AT);
id_unetot_BE=find(ismember(header_BE, 'UNETOT_BE')); unetot_BE=data_BE(:,id_unetot_BE);
id_unetot_DE=find(ismember(header_DE, 'UNETOT_DE')); unetot_DE=data_DE(:,id_unetot_DE);
id_unetot_EL=find(ismember(header_EL, 'UNETOT_EL')); unetot_EL=data_EL(:,id_unetot_EL);
id_unetot_ES=find(ismember(header_ES, 'UNETOT_ES')); unetot_ES=data_ES(:,id_unetot_ES);
id_unetot_FR=find(ismember(header_FR, 'UNETOT_FR')); unetot_FR=data_FR(:,id_unetot_FR);
id_unetot_IE=find(ismember(header_IE, 'UNETOT_IE')); unetot_IE=data_IE(:,id_unetot_IE);
id_unetot_IT=find(ismember(header_IT, 'UNETOT_IT')); unetot_IT=data_IT(:,id_unetot_IT);
id_unetot_NL=find(ismember(header_NL, 'UNETOT_NL')); unetot_NL=data_NL(:,id_unetot_NL);
id_unetot_PT=find(ismember(header_PT, 'UNETOT_PT')); unetot_PT=data_PT(:,id_unetot_PT);

header_unetot= ['UNETOT_AT';'UNETOT_BE';'UNETOT_DE';'UNETOT_EL';'UNETOT_ES';'UNETOT_FR';'UNETOT_IE';'UNETOT_IT';'UNETOT_NL';'UNETOT_PT'];
header_unetot=cellstr(header_unetot);
nationals_unetot = [unetot_AT,unetot_BE,unetot_DE,unetot_EL,unetot_ES,unetot_FR,unetot_IE,unetot_IT,unetot_NL,unetot_PT];



% IPCAG
id_ipcag_at=find(ismember(header_AT, 'IPCAG_AT')); ipcag_AT=data_AT(:,id_ipcag_at);
id_ipcag_be=find(ismember(header_BE, 'IPCAG_BE')); ipcag_BE=data_BE(:,id_ipcag_be);
id_ipcag_de=find(ismember(header_DE, 'IPCAG_DE')); ipcag_DE=data_DE(:,id_ipcag_de);
id_ipcag_el=find(ismember(header_EL, 'IPCAG_EL')); ipcag_EL=data_EL(:,id_ipcag_el);
id_ipcag_es=find(ismember(header_ES, 'IPCAG_ES')); ipcag_ES=data_ES(:,id_ipcag_es);
id_ipcag_fr=find(ismember(header_FR, 'IPCAG_FR')); ipcag_FR=data_FR(:,id_ipcag_fr);
id_ipcag_ie=find(ismember(header_IE, 'IPCAG_IE')); ipcag_IE=data_IE(:,id_ipcag_ie);
id_ipcag_it=find(ismember(header_IT, 'IPCAG_IT')); ipcag_IT=data_IT(:,id_ipcag_it);
id_ipcag_nl=find(ismember(header_NL, 'IPCAG_NL')); ipcag_NL=data_NL(:,id_ipcag_nl);
id_ipcag_pt=find(ismember(header_PT, 'IPCAG_PT')); ipcag_PT=data_PT(:,id_ipcag_pt);

header_ipcag = ['IPCAG_AT';'IPCAG_BE';'IPCAG_DE';'IPCAG_EL';'IPCAG_ES';'IPCAG_FR';'IPCAG_IE';'IPCAG_IT';'IPCAG_NL';'IPCAG_PT'];
header_ipcag=cellstr(header_ipcag);
nationals_ipcag = [ipcag_AT,ipcag_BE,ipcag_DE,ipcag_EL,ipcag_ES,ipcag_FR,ipcag_IE,ipcag_IT,ipcag_NL,ipcag_PT];


% IPCOG
id_ipcog_at=find(ismember(header_AT, 'IPCOG_AT')); ipcog_AT=data_AT(:,id_ipcog_at);
id_ipcog_be=find(ismember(header_BE, 'IPCOG_BE')); ipcog_BE=data_BE(:,id_ipcog_be);
id_ipcog_de=find(ismember(header_DE, 'IPCOG_DE')); ipcog_DE=data_DE(:,id_ipcog_de);
id_ipcog_el=find(ismember(header_EL, 'IPCOG_EL')); ipcog_EL=data_EL(:,id_ipcog_el);
id_ipcog_es=find(ismember(header_ES, 'IPCOG_ES')); ipcog_ES=data_ES(:,id_ipcog_es);
id_ipcog_fr=find(ismember(header_FR, 'IPCOG_FR')); ipcog_FR=data_FR(:,id_ipcog_fr);
id_ipcog_ie=find(ismember(header_IE, 'IPCOG_IE')); ipcog_IE=data_IE(:,id_ipcog_ie);
id_ipcog_it=find(ismember(header_IT, 'IPCOG_IT')); ipcog_IT=data_IT(:,id_ipcog_it);
id_ipcog_nl=find(ismember(header_NL, 'IPCOG_NL')); ipcog_NL=data_NL(:,id_ipcog_nl);
id_ipcog_pt=find(ismember(header_PT, 'IPCOG_PT')); ipcog_PT=data_PT(:,id_ipcog_pt);

header_ipcog = ['IPCOG_AT';'IPCOG_BE';'IPCOG_DE';'IPCOG_EL';'IPCOG_ES';'IPCOG_FR';'IPCOG_IE';'IPCOG_IT';'IPCOG_NL';'IPCOG_PT'];
header_ipcog=cellstr(header_ipcog);
nationals_ipcog = [ipcog_AT,ipcog_BE,ipcog_DE,ipcog_EL,ipcog_ES,ipcog_FR,ipcog_IE,ipcog_IT,ipcog_NL,ipcog_PT];


% IPDCOG
id_ipdcog_at=find(ismember(header_AT, 'IPDCOG_AT')); ipdcog_AT=data_AT(:,id_ipdcog_at);
id_ipdcog_be=find(ismember(header_BE, 'IPDCOG_BE')); ipdcog_BE=data_BE(:,id_ipdcog_be);
id_ipdcog_de=find(ismember(header_DE, 'IPDCOG_DE')); ipdcog_DE=data_DE(:,id_ipdcog_de);
id_ipdcog_el=find(ismember(header_EL, 'IPDCOG_EL')); ipdcog_EL=data_EL(:,id_ipdcog_el);
id_ipdcog_es=find(ismember(header_ES, 'IPDCOG_ES')); ipdcog_ES=data_ES(:,id_ipdcog_es);
id_ipdcog_fr=find(ismember(header_FR, 'IPDCOG_FR')); ipdcog_FR=data_FR(:,id_ipdcog_fr);
id_ipdcog_ie=find(ismember(header_IE, 'IPDCOG_IE')); ipdcog_IE=data_IE(:,id_ipdcog_ie);
id_ipdcog_it=find(ismember(header_IT, 'IPDCOG_IT')); ipdcog_IT=data_IT(:,id_ipdcog_it);
id_ipdcog_nl=find(ismember(header_NL, 'IPDCOG_NL')); ipdcog_NL=data_NL(:,id_ipdcog_nl);
id_ipdcog_pt=find(ismember(header_PT, 'IPDCOG_PT')); ipdcog_PT=data_PT(:,id_ipdcog_pt);

header_ipdcog = ['IPDCOG_AT';'IPDCOG_BE';'IPDCOG_DE';'IPDCOG_EL';'IPDCOG_ES';'IPDCOG_FR';'IPDCOG_IE';'IPDCOG_IT';'IPDCOG_NL';'IPDCOG_PT'];
header_ipdcog=cellstr(header_ipdcog);
nationals_ipdcog = [ipdcog_AT,ipdcog_BE,ipdcog_DE,ipdcog_EL,ipdcog_ES,ipdcog_FR,ipdcog_IE,ipdcog_IT,ipdcog_NL,ipdcog_PT];


% IPNDCOG
id_ipndcog_at=find(ismember(header_AT, 'IPNDCOG_AT')); ipndcog_AT=data_AT(:,id_ipndcog_at);
id_ipndcog_be=find(ismember(header_BE, 'IPNDCOG_BE')); ipndcog_BE=data_BE(:,id_ipndcog_be);
id_ipndcog_de=find(ismember(header_DE, 'IPNDCOG_DE')); ipndcog_DE=data_DE(:,id_ipndcog_de);
id_ipndcog_el=find(ismember(header_EL, 'IPNDCOG_EL')); ipndcog_EL=data_EL(:,id_ipndcog_el);
id_ipndcog_es=find(ismember(header_ES, 'IPNDCOG_ES')); ipndcog_ES=data_ES(:,id_ipndcog_es);
id_ipndcog_fr=find(ismember(header_FR, 'IPNDCOG_FR')); ipndcog_FR=data_FR(:,id_ipndcog_fr);
id_ipndcog_ie=find(ismember(header_IE, 'IPNDCOG_IE')); ipndcog_IE=data_IE(:,id_ipndcog_ie);
id_ipndcog_it=find(ismember(header_IT, 'IPNDCOG_IT')); ipndcog_IT=data_IT(:,id_ipndcog_it);
id_ipndcog_nl=find(ismember(header_NL, 'IPNDCOG_NL')); ipndcog_NL=data_NL(:,id_ipndcog_nl);
id_ipndcog_pt=find(ismember(header_PT, 'IPNDCOG_PT')); ipndcog_PT=data_PT(:,id_ipndcog_pt);

header_ipndcog = ['IPNDCOG_AT';'IPNDCOG_BE';'IPNDCOG_DE';'IPNDCOG_EL';'IPNDCOG_ES';'IPNDCOG_FR';'IPNDCOG_IE';'IPNDCOG_IT';'IPNDCOG_NL';'IPNDCOG_PT'];
header_ipndcog=cellstr(header_ipndcog);
nationals_ipndcog = [ipndcog_AT,ipndcog_BE,ipndcog_DE,ipndcog_EL,ipndcog_ES,ipndcog_FR,ipndcog_IE,ipndcog_IT,ipndcog_NL,ipndcog_PT];


% IPING
id_iping_at=find(ismember(header_AT, 'IPING_AT')); iping_AT=data_AT(:,id_iping_at);
id_iping_be=find(ismember(header_BE, 'IPING_BE')); iping_BE=data_BE(:,id_iping_be);
id_iping_de=find(ismember(header_DE, 'IPING_DE')); iping_DE=data_DE(:,id_iping_de);
id_iping_el=find(ismember(header_EL, 'IPING_EL')); iping_EL=data_EL(:,id_iping_el);
id_iping_es=find(ismember(header_ES, 'IPING_ES')); iping_ES=data_ES(:,id_iping_es);
id_iping_fr=find(ismember(header_FR, 'IPING_FR')); iping_FR=data_FR(:,id_iping_fr);
id_iping_ie=find(ismember(header_IE, 'IPING_IE')); iping_IE=data_IE(:,id_iping_ie);
id_iping_it=find(ismember(header_IT, 'IPING_IT')); iping_IT=data_IT(:,id_iping_it);
id_iping_nl=find(ismember(header_NL, 'IPING_NL')); iping_NL=data_NL(:,id_iping_nl);
id_iping_pt=find(ismember(header_PT, 'IPING_PT')); iping_PT=data_PT(:,id_iping_pt);

header_iping = ['IPING_AT';'IPING_BE';'IPING_DE';'IPING_EL';'IPING_ES';'IPING_FR';'IPING_IE';'IPING_IT';'IPING_NL';'IPING_PT'];
header_iping=cellstr(header_iping);
nationals_iping = [iping_AT,iping_BE,iping_DE,iping_EL,iping_ES,iping_FR,iping_IE,iping_IT,iping_NL,iping_PT];


% IPNRG
id_ipnrg_at=find(ismember(header_AT, 'IPNRG_AT')); ipnrg_AT=data_AT(:,id_ipnrg_at);
id_ipnrg_be=find(ismember(header_BE, 'IPNRG_BE')); ipnrg_BE=data_BE(:,id_ipnrg_be);
id_ipnrg_de=find(ismember(header_DE, 'IPNRG_DE')); ipnrg_DE=data_DE(:,id_ipnrg_de);
id_ipnrg_el=find(ismember(header_EL, 'IPNRG_EL')); ipnrg_EL=data_EL(:,id_ipnrg_el);
id_ipnrg_es=find(ismember(header_ES, 'IPNRG_ES')); ipnrg_ES=data_ES(:,id_ipnrg_es);
id_ipnrg_fr=find(ismember(header_FR, 'IPNRG_FR')); ipnrg_FR=data_FR(:,id_ipnrg_fr);
id_ipnrg_ie=find(ismember(header_IE, 'IPNRG_IE')); ipnrg_IE=data_IE(:,id_ipnrg_ie);
id_ipnrg_it=find(ismember(header_IT, 'IPNRG_IT')); ipnrg_IT=data_IT(:,id_ipnrg_it);
id_ipnrg_nl=find(ismember(header_NL, 'IPNRG_NL')); ipnrg_NL=data_NL(:,id_ipnrg_nl);
id_ipnrg_pt=find(ismember(header_PT, 'IPNRG_PT')); ipnrg_PT=data_PT(:,id_ipnrg_pt);

header_ipnrg = ['IPNRG_AT';'IPNRG_BE';'IPNRG_DE';'IPNRG_EL';'IPNRG_ES';'IPNRG_FR';'IPNRG_IE';'IPNRG_IT';'IPNRG_NL';'IPNRG_PT'];
header_ipnrg=cellstr(header_ipnrg);
nationals_ipnrg = [ipnrg_AT,ipnrg_BE,ipnrg_DE,ipnrg_EL,ipnrg_ES,ipnrg_FR,ipnrg_IE,ipnrg_IT,ipnrg_NL,ipnrg_PT];



% PPICAG
id_ppicag_at=find(ismember(header_AT, 'PPICAG_AT')); ppicag_AT=data_AT(:,id_ppicag_at);
id_ppicag_be=find(ismember(header_BE, 'PPICAG_BE')); ppicag_BE=data_BE(:,id_ppicag_be);
id_ppicag_de=find(ismember(header_DE, 'PPICAG_DE')); ppicag_DE=data_DE(:,id_ppicag_de);
id_ppicag_el=find(ismember(header_EL, 'PPICAG_EL')); ppicag_EL=data_EL(:,id_ppicag_el);
id_ppicag_es=find(ismember(header_ES, 'PPICAG_ES')); ppicag_ES=data_ES(:,id_ppicag_es);
id_ppicag_fr=find(ismember(header_FR, 'PPICAG_FR')); ppicag_FR=data_FR(:,id_ppicag_fr);
id_ppicag_ie=find(ismember(header_IE, 'PPICAG_IE')); ppicag_IE=data_IE(:,id_ppicag_ie);
id_ppicag_it=find(ismember(header_IT, 'PPICAG_IT')); ppicag_IT=data_IT(:,id_ppicag_it);
id_ppicag_nl=find(ismember(header_NL, 'PPICAG_NL')); ppicag_NL=data_NL(:,id_ppicag_nl);
id_ppicag_pt=find(ismember(header_PT, 'PPICAG_PT')); ppicag_PT=data_PT(:,id_ppicag_pt);

header_ppicag = ['PPICAG_AT';'PPICAG_BE';'PPICAG_DE';'PPICAG_EL';'PPICAG_ES';'PPICAG_FR';'PPICAG_IE';'PPICAG_IT';'PPICAG_NL';'PPICAG_PT'];
header_ppicag=cellstr(header_ppicag);
nationals_ppicag = [ppicag_AT,ppicag_BE,ppicag_DE,ppicag_EL,ppicag_ES,ppicag_FR,ppicag_IE,ppicag_IT,ppicag_NL,ppicag_PT];


% PPICOG
id_ppicog_at=find(ismember(header_AT, 'PPICOG_AT')); ppicog_AT=data_AT(:,id_ppicog_at);
id_ppicog_be=find(ismember(header_BE, 'PPICOG_BE')); ppicog_BE=data_BE(:,id_ppicog_be);
id_ppicog_de=find(ismember(header_DE, 'PPICOG_DE')); ppicog_DE=data_DE(:,id_ppicog_de);
id_ppicog_el=find(ismember(header_EL, 'PPICOG_EL')); ppicog_EL=data_EL(:,id_ppicog_el);
id_ppicog_es=find(ismember(header_ES, 'PPICOG_ES')); ppicog_ES=data_ES(:,id_ppicog_es);
id_ppicog_fr=find(ismember(header_FR, 'PPICOG_FR')); ppicog_FR=data_FR(:,id_ppicog_fr);
id_ppicog_ie=find(ismember(header_IE, 'PPICOG_IE')); ppicog_IE=data_IE(:,id_ppicog_ie);
id_ppicog_it=find(ismember(header_IT, 'PPICOG_IT')); ppicog_IT=data_IT(:,id_ppicog_it);
id_ppicog_nl=find(ismember(header_NL, 'PPICOG_NL')); ppicog_NL=data_NL(:,id_ppicog_nl);
id_ppicog_pt=find(ismember(header_PT, 'PPICOG_PT')); ppicog_PT=data_PT(:,id_ppicog_pt);

header_ppicog = ['PPICOG_AT';'PPICOG_BE';'PPICOG_DE';'PPICOG_EL';'PPICOG_ES';'PPICOG_FR';'PPICOG_IE';'PPICOG_IT';'PPICOG_NL';'PPICOG_PT'];
header_ppicog=cellstr(header_ppicog);
nationals_ppicog = [ppicog_AT,ppicog_BE,ppicog_DE,ppicog_EL,ppicog_ES,ppicog_FR,ppicog_IE,ppicog_IT,ppicog_NL,ppicog_PT];


% PPINDCOG
id_ppindcog_at=find(ismember(header_AT, 'PPINDCOG_AT')); ppindcog_AT=data_AT(:,id_ppindcog_at);
id_ppindcog_be=find(ismember(header_BE, 'PPINDCOG_BE')); ppindcog_BE=data_BE(:,id_ppindcog_be);
id_ppindcog_de=find(ismember(header_DE, 'PPINDCOG_DE')); ppindcog_DE=data_DE(:,id_ppindcog_de);
id_ppindcog_el=find(ismember(header_EL, 'PPINDCOG_EL')); ppindcog_EL=data_EL(:,id_ppindcog_el);
id_ppindcog_es=find(ismember(header_ES, 'PPINDCOG_ES')); ppindcog_ES=data_ES(:,id_ppindcog_es);
id_ppindcog_fr=find(ismember(header_FR, 'PPINDCOG_FR')); ppindcog_FR=data_FR(:,id_ppindcog_fr);
id_ppindcog_ie=find(ismember(header_IE, 'PPINDCOG_IE')); ppindcog_IE=data_IE(:,id_ppindcog_ie);
id_ppindcog_it=find(ismember(header_IT, 'PPINDCOG_IT')); ppindcog_IT=data_IT(:,id_ppindcog_it);
id_ppindcog_nl=find(ismember(header_NL, 'PPINDCOG_NL')); ppindcog_NL=data_NL(:,id_ppindcog_nl);
id_ppindcog_pt=find(ismember(header_PT, 'PPINDCOG_PT')); ppindcog_PT=data_PT(:,id_ppindcog_pt);

header_ppindcog = ['PPINDCOG_AT';'PPINDCOG_BE';'PPINDCOG_DE';'PPINDCOG_EL';'PPINDCOG_ES';'PPINDCOG_FR';'PPINDCOG_IE';'PPINDCOG_IT';'PPINDCOG_NL';'PPINDCOG_PT'];
header_ppindcog=cellstr(header_ppindcog);
nationals_ppindcog = [ppindcog_AT,ppindcog_BE,ppindcog_DE,ppindcog_EL,ppindcog_ES,ppindcog_FR,ppindcog_IE,ppindcog_IT,ppindcog_NL,ppindcog_PT];


% PPIDCOG
id_ppidcog_at=find(ismember(header_AT, 'PPIDCOG_AT')); ppidcog_AT=data_AT(:,id_ppidcog_at);
id_ppidcog_be=find(ismember(header_BE, 'PPIDCOG_BE')); ppidcog_BE=data_BE(:,id_ppidcog_be);
id_ppidcog_de=find(ismember(header_DE, 'PPIDCOG_DE')); ppidcog_DE=data_DE(:,id_ppidcog_de);
id_ppidcog_el=find(ismember(header_EL, 'PPIDCOG_EL')); ppidcog_EL=data_EL(:,id_ppidcog_el);
id_ppidcog_es=find(ismember(header_ES, 'PPIDCOG_ES')); ppidcog_ES=data_ES(:,id_ppidcog_es);
id_ppidcog_fr=find(ismember(header_FR, 'PPIDCOG_FR')); ppidcog_FR=data_FR(:,id_ppidcog_fr);
id_ppidcog_ie=find(ismember(header_IE, 'PPIDCOG_IE')); ppidcog_IE=data_IE(:,id_ppidcog_ie);
id_ppidcog_it=find(ismember(header_IT, 'PPIDCOG_IT')); ppidcog_IT=data_IT(:,id_ppidcog_it);
id_ppidcog_nl=find(ismember(header_NL, 'PPIDCOG_NL')); ppidcog_NL=data_NL(:,id_ppidcog_nl);
id_ppidcog_pt=find(ismember(header_PT, 'PPIDCOG_PT')); ppidcog_PT=data_PT(:,id_ppidcog_pt);

header_ppidcog = ['PPIDCOG_AT';'PPIDCOG_BE';'PPIDCOG_DE';'PPIDCOG_EL';'PPIDCOG_ES';'PPIDCOG_FR';'PPIDCOG_IE';'PPIDCOG_IT';'PPIDCOG_NL';'PPIDCOG_PT'];
header_ppidcog=cellstr(header_ppidcog);
nationals_ppidcog = [ppidcog_AT,ppidcog_BE,ppidcog_DE,ppidcog_EL,ppidcog_ES,ppidcog_FR,ppidcog_IE,ppidcog_IT,ppidcog_NL,ppidcog_PT];


% PPIING
id_ppiing_at=find(ismember(header_AT, 'PPIING_AT')); ppiing_AT=data_AT(:,id_ppiing_at);
id_ppiing_be=find(ismember(header_BE, 'PPIING_BE')); ppiing_BE=data_BE(:,id_ppiing_be);
id_ppiing_de=find(ismember(header_DE, 'PPIING_DE')); ppiing_DE=data_DE(:,id_ppiing_de);
id_ppiing_el=find(ismember(header_EL, 'PPIING_EL')); ppiing_EL=data_EL(:,id_ppiing_el);
id_ppiing_es=find(ismember(header_ES, 'PPIING_ES')); ppiing_ES=data_ES(:,id_ppiing_es);
id_ppiing_fr=find(ismember(header_FR, 'PPIING_FR')); ppiing_FR=data_FR(:,id_ppiing_fr);
id_ppiing_ie=find(ismember(header_IE, 'PPIING_IE')); ppiing_IE=data_IE(:,id_ppiing_ie);
id_ppiing_it=find(ismember(header_IT, 'PPIING_IT')); ppiing_IT=data_IT(:,id_ppiing_it);
id_ppiing_nl=find(ismember(header_NL, 'PPIING_NL')); ppiing_NL=data_NL(:,id_ppiing_nl);
id_ppiing_pt=find(ismember(header_PT, 'PPIING_PT')); ppiing_PT=data_PT(:,id_ppiing_pt);

header_ppiing = ['PPIING_AT';'PPIING_BE';'PPIING_DE';'PPIING_EL';'PPIING_ES';'PPIING_FR';'PPIING_IE';'PPIING_IT';'PPIING_NL';'PPIING_PT'];
header_ppiing=cellstr(header_ppiing);
nationals_ppiing = [ppiing_AT,ppiing_BE,ppiing_DE,ppiing_EL,ppiing_ES,ppiing_FR,ppiing_IE,ppiing_IT,ppiing_NL,ppiing_PT];


% PPINRG
id_ppinrg_at=find(ismember(header_AT, 'PPINRG_AT')); ppinrg_AT=data_AT(:,id_ppinrg_at);
id_ppinrg_be=find(ismember(header_BE, 'PPINRG_BE')); ppinrg_BE=data_BE(:,id_ppinrg_be);
id_ppinrg_de=find(ismember(header_DE, 'PPINRG_DE')); ppinrg_DE=data_DE(:,id_ppinrg_de);
id_ppinrg_el=find(ismember(header_EL, 'PPINRG_EL')); ppinrg_EL=data_EL(:,id_ppinrg_el);
id_ppinrg_es=find(ismember(header_ES, 'PPINRG_ES')); ppinrg_ES=data_ES(:,id_ppinrg_es);
id_ppinrg_fr=find(ismember(header_FR, 'PPINRG_FR')); ppinrg_FR=data_FR(:,id_ppinrg_fr);
id_ppinrg_ie=find(ismember(header_IE, 'PPINRG_IE')); ppinrg_IE=data_IE(:,id_ppinrg_ie);
id_ppinrg_it=find(ismember(header_IT, 'PPINRG_IT')); ppinrg_IT=data_IT(:,id_ppinrg_it);
id_ppinrg_nl=find(ismember(header_NL, 'PPINRG_NL')); ppinrg_NL=data_NL(:,id_ppinrg_nl);
id_ppinrg_pt=find(ismember(header_PT, 'PPINRG_PT')); ppinrg_PT=data_PT(:,id_ppinrg_pt);

header_ppinrg = ['PPINRG_AT';'PPINRG_BE';'PPINRG_DE';'PPINRG_EL';'PPINRG_ES';'PPINRG_FR';'PPINRG_IE';'PPINRG_IT';'PPINRG_NL';'PPINRG_PT'];
header_ppinrg=cellstr(header_ppinrg);
nationals_ppinrg = [ppinrg_AT,ppinrg_BE,ppinrg_DE,ppinrg_EL,ppinrg_ES,ppinrg_FR,ppinrg_IE,ppinrg_IT,ppinrg_NL,ppinrg_PT];


% HICPNEF
id_hicpnef_at=find(ismember(header_AT, 'HICPNEF_AT')); hicpnef_AT=data_AT(:,id_hicpnef_at);
id_hicpnef_be=find(ismember(header_BE, 'HICPNEF_BE')); hicpnef_BE=data_BE(:,id_hicpnef_be);
id_hicpnef_de=find(ismember(header_DE, 'HICPNEF_DE')); hicpnef_DE=data_DE(:,id_hicpnef_de);
id_hicpnef_el=find(ismember(header_EL, 'HICPNEF_EL')); hicpnef_EL=data_EL(:,id_hicpnef_el);
id_hicpnef_es=find(ismember(header_ES, 'HICPNEF_ES')); hicpnef_ES=data_ES(:,id_hicpnef_es);
id_hicpnef_fr=find(ismember(header_FR, 'HICPNEF_FR')); hicpnef_FR=data_FR(:,id_hicpnef_fr);
id_hicpnef_ie=find(ismember(header_IE, 'HICPNEF_IE')); hicpnef_IE=data_IE(:,id_hicpnef_ie);
id_hicpnef_it=find(ismember(header_IT, 'HICPNEF_IT')); hicpnef_IT=data_IT(:,id_hicpnef_it);
id_hicpnef_nl=find(ismember(header_NL, 'HICPNEF_NL')); hicpnef_NL=data_NL(:,id_hicpnef_nl);
id_hicpnef_pt=find(ismember(header_PT, 'HICPNEF_PT')); hicpnef_PT=data_PT(:,id_hicpnef_pt);

header_hicpnef = ['HICPNEF_AT';'HICPNEF_BE';'HICPNEF_DE';'HICPNEF_EL';'HICPNEF_ES';'HICPNEF_FR';'HICPNEF_IE';'HICPNEF_IT';'HICPNEF_NL';'HICPNEF_PT'];
header_hicpnef=cellstr(header_hicpnef);
nationals_hicpnef = [hicpnef_AT,hicpnef_BE,hicpnef_DE,hicpnef_EL,hicpnef_ES,hicpnef_FR,hicpnef_IE,hicpnef_IT,hicpnef_NL,hicpnef_PT];


% HICPG
id_hicpg_at=find(ismember(header_AT, 'HICPG_AT')); hicpg_AT=data_AT(:,id_hicpg_at);
id_hicpg_be=find(ismember(header_BE, 'HICPG_BE')); hicpg_BE=data_BE(:,id_hicpg_be);
id_hicpg_de=find(ismember(header_DE, 'HICPG_DE')); hicpg_DE=data_DE(:,id_hicpg_de);
id_hicpg_el=find(ismember(header_EL, 'HICPG_EL')); hicpg_EL=data_EL(:,id_hicpg_el);
id_hicpg_es=find(ismember(header_ES, 'HICPG_ES')); hicpg_ES=data_ES(:,id_hicpg_es);
id_hicpg_fr=find(ismember(header_FR, 'HICPG_FR')); hicpg_FR=data_FR(:,id_hicpg_fr);
id_hicpg_ie=find(ismember(header_IE, 'HICPG_IE')); hicpg_IE=data_IE(:,id_hicpg_ie);
id_hicpg_it=find(ismember(header_IT, 'HICPG_IT')); hicpg_IT=data_IT(:,id_hicpg_it);
id_hicpg_nl=find(ismember(header_NL, 'HICPG_NL')); hicpg_NL=data_NL(:,id_hicpg_nl);
id_hicpg_pt=find(ismember(header_PT, 'HICPG_PT')); hicpg_PT=data_PT(:,id_hicpg_pt);

header_hicpg = ['HICPG_AT';'HICPG_BE';'HICPG_DE';'HICPG_EL';'HICPG_ES';'HICPG_FR';'HICPG_IE';'HICPG_IT';'HICPG_NL';'HICPG_PT'];
header_hicpg=cellstr(header_hicpg);
nationals_hicpg = [hicpg_AT,hicpg_BE,hicpg_DE,hicpg_EL,hicpg_ES,hicpg_FR,hicpg_IE,hicpg_IT,hicpg_NL,hicpg_PT];


% HICPIN
id_hicpin_at=find(ismember(header_AT, 'HICPIN_AT')); hicpin_AT=data_AT(:,id_hicpin_at);
id_hicpin_be=find(ismember(header_BE, 'HICPIN_BE')); hicpin_BE=data_BE(:,id_hicpin_be);
id_hicpin_de=find(ismember(header_DE, 'HICPIN_DE')); hicpin_DE=data_DE(:,id_hicpin_de);
id_hicpin_el=find(ismember(header_EL, 'HICPIN_EL')); hicpin_EL=data_EL(:,id_hicpin_el);
id_hicpin_es=find(ismember(header_ES, 'HICPIN_ES')); hicpin_ES=data_ES(:,id_hicpin_es);
id_hicpin_fr=find(ismember(header_FR, 'HICPIN_FR')); hicpin_FR=data_FR(:,id_hicpin_fr);
id_hicpin_ie=find(ismember(header_IE, 'HICPIN_IE')); hicpin_IE=data_IE(:,id_hicpin_ie);
id_hicpin_it=find(ismember(header_IT, 'HICPIN_IT')); hicpin_IT=data_IT(:,id_hicpin_it);
id_hicpin_nl=find(ismember(header_NL, 'HICPIN_NL')); hicpin_NL=data_NL(:,id_hicpin_nl);
id_hicpin_pt=find(ismember(header_PT, 'HICPIN_PT')); hicpin_PT=data_PT(:,id_hicpin_pt);

header_hicpin = ['HICPIN_AT';'HICPIN_BE';'HICPIN_DE';'HICPIN_EL';'HICPIN_ES';'HICPIN_FR';'HICPIN_IE';'HICPIN_IT';'HICPIN_NL';'HICPIN_PT'];
header_hicpin=cellstr(header_hicpin);
nationals_hicpin = [hicpin_AT,hicpin_BE,hicpin_DE,hicpin_EL,hicpin_ES,hicpin_FR,hicpin_IE,hicpin_IT,hicpin_NL,hicpin_PT];


% HICPSV
id_hicpsv_at=find(ismember(header_AT, 'HICPSV_AT')); hicpsv_AT=data_AT(:,id_hicpsv_at);
id_hicpsv_be=find(ismember(header_BE, 'HICPSV_BE')); hicpsv_BE=data_BE(:,id_hicpsv_be);
id_hicpsv_de=find(ismember(header_DE, 'HICPSV_DE')); hicpsv_DE=data_DE(:,id_hicpsv_de);
id_hicpsv_el=find(ismember(header_EL, 'HICPSV_EL')); hicpsv_EL=data_EL(:,id_hicpsv_el);
id_hicpsv_es=find(ismember(header_ES, 'HICPSV_ES')); hicpsv_ES=data_ES(:,id_hicpsv_es);
id_hicpsv_fr=find(ismember(header_FR, 'HICPSV_FR')); hicpsv_FR=data_FR(:,id_hicpsv_fr);
id_hicpsv_ie=find(ismember(header_IE, 'HICPSV_IE')); hicpsv_IE=data_IE(:,id_hicpsv_ie);
id_hicpsv_it=find(ismember(header_IT, 'HICPSV_IT')); hicpsv_IT=data_IT(:,id_hicpsv_it);
id_hicpsv_nl=find(ismember(header_NL, 'HICPSV_NL')); hicpsv_NL=data_NL(:,id_hicpsv_nl);
id_hicpsv_pt=find(ismember(header_PT, 'HICPSV_PT')); hicpsv_PT=data_PT(:,id_hicpsv_pt);

header_hicpsv = ['HICPSV_AT';'HICPSV_BE';'HICPSV_DE';'HICPSV_EL';'HICPSV_ES';'HICPSV_FR';'HICPSV_IE';'HICPSV_IT';'HICPSV_NL';'HICPSV_PT'];
header_hicpsv=cellstr(header_hicpsv);
nationals_hicpsv = [hicpsv_AT,hicpsv_BE,hicpsv_DE,hicpsv_EL,hicpsv_ES,hicpsv_FR,hicpsv_IE,hicpsv_IT,hicpsv_NL,hicpsv_PT];


% HICPNG
id_hicpng_at=find(ismember(header_AT, 'HICPNG_AT')); hicpng_AT=data_AT(:,id_hicpng_at);
id_hicpng_be=find(ismember(header_BE, 'HICPNG_BE')); hicpng_BE=data_BE(:,id_hicpng_be);
id_hicpng_de=find(ismember(header_DE, 'HICPNG_DE')); hicpng_DE=data_DE(:,id_hicpng_de);
id_hicpng_el=find(ismember(header_EL, 'HICPNG_EL')); hicpng_EL=data_EL(:,id_hicpng_el);
id_hicpng_es=find(ismember(header_ES, 'HICPNG_ES')); hicpng_ES=data_ES(:,id_hicpng_es);
id_hicpng_fr=find(ismember(header_FR, 'HICPNG_FR')); hicpng_FR=data_FR(:,id_hicpng_fr);
id_hicpng_ie=find(ismember(header_IE, 'HICPNG_IE')); hicpng_IE=data_IE(:,id_hicpng_ie);
id_hicpng_it=find(ismember(header_IT, 'HICPNG_IT')); hicpng_IT=data_IT(:,id_hicpng_it);
id_hicpng_nl=find(ismember(header_NL, 'HICPNG_NL')); hicpng_NL=data_NL(:,id_hicpng_nl);
id_hicpng_pt=find(ismember(header_PT, 'HICPNG_PT')); hicpng_PT=data_PT(:,id_hicpng_pt);

header_hicpng = ['HICPNG_AT';'HICPNG_BE';'HICPNG_DE';'HICPNG_EL';'HICPNG_ES';'HICPNG_FR';'HICPNG_IE';'HICPNG_IT';'HICPNG_NL';'HICPNG_PT'];
header_hicpng=cellstr(header_hicpng);
nationals_hicpng = [hicpng_AT,hicpng_BE,hicpng_DE,hicpng_EL,hicpng_ES,hicpng_FR,hicpng_IE,hicpng_IT,hicpng_NL,hicpng_PT];



%===================================================================================

header_ip = header_ip(1:size(nationals_ip,2))';
header_hicpov = header_hicpov(1:size(nationals_hicpov,2))';
header_ltirt = header_ltirt(1:size(nationals_ltirt,2))';
header_shix = header_shix(1:size(nationals_shix,2))';
header_unetot = header_unetot(1:size(nationals_unetot,2))';

header_ipcag = header_ipcag(1:size(nationals_ipcag,2))';
header_ipcog = header_ipcog(1:size(nationals_ipcog,2))';
header_ipdcog = header_ipdcog(1:size(nationals_ipdcog,2))';
header_ipndcog = header_ipndcog(1:size(nationals_ipndcog,2))';
header_iping = header_iping(1:size(nationals_iping,2))';
header_ipnrg = header_ipnrg(1:size(nationals_ipnrg,2))';

header_ppicag = header_ppicag(1:size(nationals_ppicag,2))';
header_ppicog = header_ppicog(1:size(nationals_ppicog,2))';
header_ppindcog = header_ppindcog(1:size(nationals_ppindcog,2))';
header_ppidcog = header_ppidcog(1:size(nationals_ppidcog,2))';
header_ppiing = header_ppiing(1:size(nationals_ppiing,2))';
header_ppinrg = header_ppinrg(1:size(nationals_ppinrg,2))';
header_hicpnef = header_hicpnef(1:size(nationals_hicpnef,2))';
header_hicpg = header_hicpg(1:size(nationals_hicpg,2))';
header_hicpin = header_hicpin(1:size(nationals_hicpin,2))';
header_hicpsv = header_hicpsv(1:size(nationals_hicpsv,2))';
header_hicpng = header_hicpng(1:size(nationals_hicpng,2))';

% all variables
header_national_rotations_core=[header_ip,header_hicpov,header_ltirt,header_shix,header_unetot];
nationals_rotations_core=[nationals_ip,nationals_hicpov,nationals_ltirt,nationals_shix,nationals_unetot];

%%
group1_headers = [header_ipcag,header_ipcog,header_ipdcog,header_ipndcog,header_iping,header_ipnrg];
group1_nationals = [nationals_ipcag,nationals_ipcog,nationals_ipdcog,nationals_ipndcog,nationals_iping,nationals_ipnrg];

group3_headers = [header_hicpnef,header_hicpg,header_hicpin,header_hicpsv,header_hicpng];
group3_nationals = [nationals_hicpnef,nationals_hicpg,nationals_hicpin,nationals_hicpsv,nationals_hicpng];

group2_headers = [header_ppicag,header_ppicog,header_ppindcog,header_ppidcog,header_ppiing,header_ppinrg];
group2_nationals = [nationals_ppicag,nationals_ppicog,nationals_ppindcog,nationals_ppidcog,nationals_ppiing,nationals_ppinrg];

%%
comb_headers = [group1_headers, group2_headers, group3_headers]; 
comb_variables = [group1_nationals, group2_nationals, group3_nationals];


%%

header_national_rotations = [header_national_rotations_core, comb_headers];
nationals_rotations = [nationals_rotations_core, comb_variables];
    

end
