6602.0 - Microdata: Longitudinal Labour Force, Australia, 2008-10 Quality Declaration 
ARCHIVED ISSUE Released at 11:30 AM (CANBERRA TIME) 10/12/2012  First Issue
   Page tools: Print Print Page Print all pages in this productPrint All  
Contents >> Using the CURF >> Longitudinal analysis


USING THE CURF

<< Previous Section: File Structure


LONGITUDINAL ANALYSIS

As mentioned in Longitudinal structure, the Longitudinal Labour Force Survey (LLFS) CURF is presented as a 'long' vertical file, rather than a 'wide' horizontal file.

For longitudinal analysis, the structure can be converted to the 'wide' horizontal format for a selected data item using the following SAS codes.

For multiple data items, run the code for each data item and merge the output datasets by Record ID [ABSRID].


For monthly data items

data saved.input (keep= ABSRID ABSHID ABSFID ABSPID ABSMID ABSFMTH M0801-M1012);
set LLFS10E.LLFS10E;

/*Replace LFSTATCE with the desired data item here*/
dataitem=LFSTATCE;

if dataitem=0 then dataitem=999999;

if ABSMID=801 then M0801=dataitem;
if ABSMID=802 then M0802=dataitem;
if ABSMID=803 then M0803=dataitem;
if ABSMID=804 then M0804=dataitem;
if ABSMID=805 then M0805=dataitem;
if ABSMID=806 then M0806=dataitem;
if ABSMID=807 then M0807=dataitem;
if ABSMID=808 then M0808=dataitem;
if ABSMID=809 then M0809=dataitem;
if ABSMID=810 then M0810=dataitem;
if ABSMID=811 then M0811=dataitem;
if ABSMID=812 then M0812=dataitem;
if ABSMID=901 then M0901=dataitem;
if ABSMID=902 then M0902=dataitem;
if ABSMID=903 then M0903=dataitem;
if ABSMID=904 then M0904=dataitem;
if ABSMID=905 then M0905=dataitem;
if ABSMID=906 then M0906=dataitem;
if ABSMID=907 then M0907=dataitem;
if ABSMID=908 then M0908=dataitem;
if ABSMID=909 then M0909=dataitem;
if ABSMID=910 then M0910=dataitem;
if ABSMID=911 then M0911=dataitem;
if ABSMID=912 then M0912=dataitem;
if ABSMID=1001 then M1001=dataitem;
if ABSMID=1002 then M1002=dataitem;
if ABSMID=1003 then M1003=dataitem;
if ABSMID=1004 then M1004=dataitem;
if ABSMID=1005 then M1005=dataitem;
if ABSMID=1006 then M1006=dataitem;
if ABSMID=1007 then M1007=dataitem;
if ABSMID=1008 then M1008=dataitem;
if ABSMID=1009 then M1009=dataitem;
if ABSMID=1010 then M1010=dataitem;
if ABSMID=1011 then M1011=dataitem;
if ABSMID=1012 then M1012=dataitem;
run;

proc sort data=saved.input out=saved.temp;
by ABSRID;
run;

data saved.temp2 (drop= x1-x36);
set saved.temp;
by ABSRID;

x1+M0801;
x2+M0802;
x3+M0803;
x4+M0804;
x5+M0805;
x6+M0806;
x7+M0807;
x8+M0808;
x9+M0809;
x10+M0810;
x11+M0811;
x12+M0812;
x13+M0901;
x14+M0902;
x15+M0903;
x16+M0904;
x17+M0905;
x18+M0906;
x19+M0907;
x20+M0908;
x21+M0909;
x22+M0910;
x23+M0911;
x24+M0912;
x25+M1001;
x26+M1002;
x27+M1003;
x28+M1004;
x29+M1005;
x30+M1006;
x31+M1007;
x32+M1008;
x33+M1009;
x34+M1010;
x35+M1011;
x36+M1012;

if last.ABSRID then do;
M0801=x1;
M0802=x2;
M0803=x3;
M0804=x4;
M0805=x5;
M0806=x6;
M0807=x7;
M0808=x8;
M0809=x9;
M0810=x10;
M0811=x11;
M0812=x12;
M0901=x13;
M0902=x14;
M0903=x15;
M0904=x16;
M0905=x17;
M0906=x18;
M0907=x19;
M0908=x20;
M0909=x21;
M0910=x22;
M0911=x23;
M0912=x24;
M1001=x25;
M1002=x26;
M1003=x27;
M1004=x28;
M1005=x29;
M1006=x30;
M1007=x31;
M1008=x32;
M1009=x33;
M1010=x34;
M1011=x35;
M1012=x36;
output;
x1=0;
x2=0;
x3=0;
x4=0;
x5=0;
x6=0;
x7=0;
x8=0;
x9=0;
x10=0;
x11=0;
x12=0;
x13=0;
x14=0;
x15=0;
x16=0;
x17=0;
x18=0;
x19=0;
x20=0;
x21=0;
x22=0;
x23=0;
x24=0;
x25=0;
x26=0;
x27=0;
x28=0;
x29=0;
x30=0;
x31=0;
x32=0;
x33=0;
x34=0;
x35=0;
x36=0;
end;
run;

/*************************************************/
/*Wide File 1 - 36 columns, one for each month */
/*************************************************/

data saved.output1;
set saved.temp2;

if M0801=0 then M0801=.;
if M0802=0 then M0802=.;
if M0803=0 then M0803=.;
if M0804=0 then M0804=.;
if M0805=0 then M0805=.;
if M0806=0 then M0806=.;
if M0807=0 then M0807=.;
if M0808=0 then M0808=.;
if M0809=0 then M0809=.;
if M0810=0 then M0810=.;
if M0811=0 then M0811=.;
if M0812=0 then M0812=.;
if M0901=0 then M0901=.;
if M0902=0 then M0902=.;
if M0903=0 then M0903=.;
if M0904=0 then M0904=.;
if M0905=0 then M0905=.;
if M0906=0 then M0906=.;
if M0907=0 then M0907=.;
if M0908=0 then M0908=.;
if M0909=0 then M0909=.;
if M0910=0 then M0910=.;
if M0911=0 then M0911=.;
if M0912=0 then M0912=.;
if M1001=0 then M1001=.;
if M1002=0 then M1002=.;
if M1003=0 then M1003=.;
if M1004=0 then M1004=.;
if M1005=0 then M1005=.;
if M1006=0 then M1006=.;
if M1007=0 then M1007=.;
if M1008=0 then M1008=.;
if M1009=0 then M1009=.;
if M1010=0 then M1010=.;
if M1011=0 then M1011=.;
if M1012=0 then M1012=.;

if M0801=999999 then M0801=0;
if M0802=999999 then M0802=0;
if M0803=999999 then M0803=0;
if M0804=999999 then M0804=0;
if M0805=999999 then M0805=0;
if M0806=999999 then M0806=0;
if M0807=999999 then M0807=0;
if M0808=999999 then M0808=0;
if M0809=999999 then M0809=0;
if M0810=999999 then M0810=0;
if M0811=999999 then M0811=0;
if M0812=999999 then M0812=0;
if M0901=999999 then M0901=0;
if M0902=999999 then M0902=0;
if M0903=999999 then M0903=0;
if M0904=999999 then M0904=0;
if M0905=999999 then M0905=0;
if M0906=999999 then M0906=0;
if M0907=999999 then M0907=0;
if M0908=999999 then M0908=0;
if M0909=999999 then M0909=0;
if M0910=999999 then M0910=0;
if M0911=999999 then M0911=0;
if M0912=999999 then M0912=0;
if M1001=999999 then M1001=0;
if M1002=999999 then M1002=0;
if M1003=999999 then M1003=0;
if M1004=999999 then M1004=0;
if M1005=999999 then M1005=0;
if M1006=999999 then M1006=0;
if M1007=999999 then M1007=0;
if M1008=999999 then M1008=0;
if M1009=999999 then M1009=0;
if M1010=999999 then M1010=0;
if M1011=999999 then M1011=0;
if M1012=999999 then M1012=0;
run;

data saved.temp3 (drop= M0801-M1012);
set saved.output1;

x2=M0801;
x3=M0802;
x4=M0803;
x5=M0804;
x6=M0805;
x7=M0806;
x8=M0807;
x9=M0808;
x10=M0809;
x11=M0810;
x12=M0811;
x13=M0812;
x14=M0901;
x15=M0902;
x16=M0903;
x17=M0904;
x18=M0905;
x19=M0906;
x20=M0907;
x21=M0908;
x22=M0909;
x23=M0910;
x24=M0911;
x25=M0912;
x26=M1001;
x27=M1002;
x28=M1003;
x29=M1004;
x30=M1005;
x31=M1006;
x32=M1007;
x33=M1008;
x34=M1009;
x35=M1010;
x36=M1011;
x37=M1012;
run;

/*************************************************/
/*Wide File 2 - Condensed, 8 columns, panels only*/
/* M1 corresponds to ABSFMTH */
/*************************************************/

data saved.output2 (keep= ABSRID ABSHID ABSFID ABSPID ABSMID ABSFMTH M1-M8);
set saved.temp3;

if ABSFMTH=0706 then a=-6;
if ABSFMTH=0707 then a=-5;
if ABSFMTH=0708 then a=-4;
if ABSFMTH=0709 then a=-3;
if ABSFMTH=0710 then a=-2;
if ABSFMTH=0711 then a=-1;
if ABSFMTH=0712 then a=0;
if ABSFMTH=0801 then a=1;
if ABSFMTH=0802 then a=2;
if ABSFMTH=0803 then a=3;
if ABSFMTH=0804 then a=4;
if ABSFMTH=0805 then a=5;
if ABSFMTH=0806 then a=6;
if ABSFMTH=0807 then a=7;
if ABSFMTH=0808 then a=8;
if ABSFMTH=0809 then a=9;
if ABSFMTH=0810 then a=10;
if ABSFMTH=0811 then a=11;
if ABSFMTH=0812 then a=12;
if ABSFMTH=0901 then a=13;
if ABSFMTH=0902 then a=14;
if ABSFMTH=0903 then a=15;
if ABSFMTH=0904 then a=16;
if ABSFMTH=0905 then a=17;
if ABSFMTH=0906 then a=18;
if ABSFMTH=0907 then a=19;
if ABSFMTH=0908 then a=20;
if ABSFMTH=0909 then a=21;
if ABSFMTH=0910 then a=22;
if ABSFMTH=0911 then a=23;
if ABSFMTH=0912 then a=24;
if ABSFMTH=1001 then a=25;
if ABSFMTH=1002 then a=26;
if ABSFMTH=1003 then a=27;
if ABSFMTH=1004 then a=28;
if ABSFMTH=1005 then a=29;
if ABSFMTH=1006 then a=30;
if ABSFMTH=1007 then a=31;
if ABSFMTH=1008 then a=32;
if ABSFMTH=1009 then a=33;
if ABSFMTH=1010 then a=34;
if ABSFMTH=1011 then a=35;
if ABSFMTH=1012 then a=36;

i1=1+a;
if i1<1 then i1=1;
i2=2+a;
if i2<1 then i2=1;
i3=3+a;
if i3<1 then i3=1;
i4=4+a;
if i4<1 then i4=1;
i5=5+a;
if i5<1 then i5=1;
i6=6+a;
if i6<1 then i6=1;
i7=7+a;
if i7<1 then i7=1;
i8=8+a;
if i8<1 then i8=1;

x1=.;
x38=.;
x39=.;
x40=.;
x41=.;
x42=.;
x43=.;
x44=.;

array x(44) x1-x44;

M1=x(i1);
M2=x(i2);
M3=x(i3);
M4=x(i4);
M5=x(i5);
M6=x(i6);
M7=x(i7);
M8=x(i8);
run;


For quarterly data items

data saved.input (keep= ABSRID ABSHID ABSFID ABSPID ABSMID ABSFMTH M0802-M1011);
set LLFS10E.LLFS10E;

/*Replace IND_06CB with the desired data item here*/
dataitem=IND_06CB;

if dataitem=0 then dataitem=999999;

if ABSMID=802 then M0802=dataitem;
if ABSMID=805 then M0805=dataitem;
if ABSMID=808 then M0808=dataitem;
if ABSMID=811 then M0811=dataitem;
if ABSMID=902 then M0902=dataitem;
if ABSMID=905 then M0905=dataitem;
if ABSMID=908 then M0908=dataitem;
if ABSMID=911 then M0911=dataitem;
if ABSMID=1002 then M1002=dataitem;
if ABSMID=1005 then M1005=dataitem;
if ABSMID=1008 then M1008=dataitem;
if ABSMID=1011 then M1011=dataitem;
run;

proc sort data=saved.input out=saved.temp;
by ABSRID;
run;

data saved.temp2 (drop= x1-x12);
set saved.temp;
by ABSRID;

x1+M0802;
x2+M0805;
x3+M0808;
x4+M0811;
x5+M0902;
x6+M0905;
x7+M0908;
x8+M0911;
x9+M1002;
x10+M1005;
x11+M1008;
x12+M1011;

if last.ABSRID then do;
M0802=x1;
M0805=x2;
M0808=x3;
M0811=x4;
M0902=x5;
M0905=x6;
M0908=x7;
M0911=x8;
M1002=x9;
M1005=x10;
M1008=x11;
M1011=x12;
output;
x1=0;
x2=0;
x3=0;
x4=0;
x5=0;
x6=0;
x7=0;
x8=0;
x9=0;
x10=0;
x11=0;
x12=0;
end;
run;

/*************************************************/
/*Wide File 1 - 36 columns, one for each month */
/*************************************************/

data saved.output1;
set saved.temp2;

if M0802=0 then M0802=.;
if M0805=0 then M0805=.;
if M0808=0 then M0808=.;
if M0811=0 then M0811=.;
if M0902=0 then M0902=.;
if M0905=0 then M0905=.;
if M0908=0 then M0908=.;
if M0911=0 then M0911=.;
if M1002=0 then M1002=.;
if M1005=0 then M1005=.;
if M1008=0 then M1008=.;
if M1011=0 then M1011=.;

if M0802=999999 then M0802=0;
if M0805=999999 then M0805=0;
if M0808=999999 then M0808=0;
if M0811=999999 then M0811=0;
if M0902=999999 then M0902=0;
if M0905=999999 then M0905=0;
if M0908=999999 then M0908=0;
if M0911=999999 then M0911=0;
if M1002=999999 then M1002=0;
if M1005=999999 then M1005=0;
if M1008=999999 then M1008=0;
if M1011=999999 then M1011=0;
run;

data saved.temp3 (drop= M0801-M1012);
set saved.output1;

x2=M0802;
x3=M0805;
x4=M0808;
x5=M0811;
x6=M0902;
x7=M0905;
x8=M0908;
x9=M0911;
x10=M1002;
x11=M1005;
x12=M1008;
x13=M1011;
run;

/*************************************************/
/*Wide File 2 - Condensed, 8 columns, panels only*/
/* M1 corresponds to ABSFMTH */
/*************************************************/

date saved.output2 (keep= ABSRID ABSHID ABSFID ABSPID ABSMID ABSFMTH M1-M8);
set saved.temp3;

if ABSFMTH=0706 then a=-1;
if ABSFMTH=0707 then a=-1;
if ABSFMTH=0708 then a=-1;
if ABSFMTH=0709 then a=0;
if ABSFMTH=0710 then a=0;
if ABSFMTH=0711 then a=0;
if ABSFMTH=0712 then a=1;
if ABSFMTH=0801 then a=1;
if ABSFMTH=0802 then a=1;
if ABSFMTH=0803 then a=2;
if ABSFMTH=0804 then a=2;
if ABSFMTH=0805 then a=2;
if ABSFMTH=0806 then a=3;
if ABSFMTH=0807 then a=3;
if ABSFMTH=0808 then a=3;
if ABSFMTH=0809 then a=4;
if ABSFMTH=0810 then a=4;
if ABSFMTH=0811 then a=4;
if ABSFMTH=0812 then a=5;
if ABSFMTH=0901 then a=5;
if ABSFMTH=0902 then a=5;
if ABSFMTH=0903 then a=6;
if ABSFMTH=0904 then a=6;
if ABSFMTH=0905 then a=6;
if ABSFMTH=0906 then a=7;
if ABSFMTH=0907 then a=7;
if ABSFMTH=0908 then a=7;
if ABSFMTH=0909 then a=8;
if ABSFMTH=0910 then a=8;
if ABSFMTH=0911 then a=8;
if ABSFMTH=0912 then a=9;
if ABSFMTH=1001 then a=9;
if ABSFMTH=1002 then a=9;
if ABSFMTH=1003 then a=10;
if ABSFMTH=1004 then a=10;
if ABSFMTH=1005 then a=10;
if ABSFMTH=1006 then a=11;
if ABSFMTH=1007 then a=11;
if ABSFMTH=1008 then a=11;
if ABSFMTH=1009 then a=12;
if ABSFMTH=1010 then a=12;
if ABSFMTH=1011 then a=12;
if ABSFMTH=1012 then a=13;

i1=1+a;
if i1<1 then i1=1;
i2=2+a;
if i2<1 then i2=1;
i3=3+a;
if i3<1 then i3=1;

x1=.;
x14=.;
x15=.;
x16=.;

array x(16) x1-x16;

M1=x(i1);
M2=x(i2);
M3=x(i3);
run;



Previous PageNext Page