%Program to seasonally adjust CPS data

clear;
clc;
close all;
addpath(fullfile(cd, '/iris'))
irisstartup

m=xlsread('cps.xls','nsa','C2:J449');
x1=tseries(mm(1976,1):mm(2013,4),m(:,1));
x2=tseries(mm(1976,1):mm(2013,4),m(:,2));
x3=tseries(mm(1976,1):mm(2013,4),m(:,3));
x4=tseries(mm(1976,1):mm(2013,4),m(:,4));
x5=tseries(mm(1976,1):mm(2013,4),m(:,5));
x6=tseries(mm(1976,1):mm(2013,4),m(:,6));
x7=tseries(mm(1976,1):mm(2013,4),m(:,7));
x8=tseries(mm(1976,1):mm(2013,4),m(:,8));
xsa1=x12(x1,Inf,'specfile=','U1.spc');
xsa2=x12(x2,Inf,'specfile=','U2.spc');
xsa3=x12(x3,Inf,'specfile=','U3.spc');
xsa4=x12(x4,Inf,'specfile=','U4.spc');
xsa5=x12(x5,Inf,'specfile=','E1.spc');
xsa6=x12(x6,Inf,'specfile=','E2.spc');
xsa7=x12(x7,Inf,'specfile=','E3.spc');
xsa8=x12(x8,Inf,'specfile=','E4.spc');
xsa1=double(xsa1);
xsa2=double(xsa2);
xsa3=double(xsa3);
xsa4=double(xsa4);
xsa5=double(xsa5);
xsa6=double(xsa6);
xsa7=double(xsa7);
xsa8=double(xsa8);
msa=[xsa1 xsa2 xsa3 xsa4 xsa5 xsa6 xsa7 xsa8];

xlswrite('cps.xls',msa,'sa','C2:J449');


irisfinish

