get file "C:\PISA2003\PISA2003.sav". FREQ country cnt. * Get best estimate of math achievement score. Fre ST34Q01 to ST34Q14. compute pvmathtt=mean (pv1math to pv5math). * Get quintiles of math achievement. freq pvmathtt /format=notable /ntiles=5. recode pvmathtt (low thru 391.60308= 1) (391.60308 thru 455.55384=2) (455.55384 thru 511.01418=3)( 511.01418 thru 573.48496=4) (573.48496 thru hi=5) into mathquint. freq mathquint. * Find out which countries have sufficient cases at each math quintile for CatPCA. Cross cnt by mathquint. * Excluding Liechtenstein (438) all countries have at least 59 cases in each math quintile. * get distribution of missing values for q34 * these will form the operational definition of task refusal. count missq34=st34q01 to st34q14 (miss). freq missq34. * 5029 cases all q34 items were missing. recode missq34 (14=1)(else=0) into missq34all. recode missq34 (0=0)(else=1)into missq34some. cross country by missq34all. cross mathquint by missq34all /cells=row. means missq34all, missq34some missq34 by mathquint /stat=anova. * Get measure of response quality. compute sdq34=sd(st34q01 TO st34q14). means sdq34 by mathquint /stat=anova. * Create aggregate file. sort cases by country,mathquint. * Get country and countrybymathquintile totals. aggregate outfile="C:\PISA2003\aggcountry34.sav" /break=country /ncases=nu /missq34=mean(missq34) /sdq34=mean(sdq34). aggregate /outfile="C:\PISA2003\aggq34.sav" /break=country,mathquint /ncases=nu /missq34=mean(missq34) /sdq34=mean(sdq34). * For some bewildering reason, SPSS shows us the aggregated file, but when we tried to savew it, it saved the original data, even though only the aggregated file was visible So we copied the visible file into Excel and then converted to to SPSS. GET DATA /TYPE=XLS /FILE='C:\Sage\PISA2003\aggq34.xls' /SHEET=name 'Sheet1' /CELLRANGE=full /READNAMES=on /ASSUMEDSTRWIDTH=32767. DATASET NAME DataSet1 WINDOW=FRONT. SAVE OUTFILE='C:\Sage\PISA2003\aggq34.sav' /COMPRESSED. *Create new aggregate file without the totals rows. TEMP. SELECT IF (NOT MISS(matlev)). SAVE OUTFILE "C:\PISA2003\ijer.sav". SELECT IF (MISS(matlev)). RENAME VAR (sdq34=sdq34tot). VAR LAB sdq34tot "Standard deviation of q34 items for the country". SAVE OUTFILE "C:\PISA2003\temp.sav" /KEEP=country2 sdq34tot. GET FILE "C:\victor\joerg\ijer.sav". MATCH FILES FILE=* /TABLE= "C:\PISA2003\temp.sav" BY country2. SAVE OUTFILE "C:\PISA2003\ijer.sav". COMPUTE sdq34stand=sdq34-sdq34tot. WEIGHT BY meanwt. MEAN sdq34stand BY matlev /STAT=ANOVA. temp. select if (mathlev=5). CATPCA VARIABLES=ST34Q01 to ST34Q14 /ANALYSIS=ST34Q01 to ST34Q14 (WEIGHT=1,LEVEL=ORDI) /MISSING=ST34Q01ST34Q01 to ST34Q14 (LISTWISE) /DIMENSION=3 /NORMALIZATION=VPRINCIPAL /MAXITER=100 /CRITITER=.00001 /PRINT=LOADING QUANT( ST34Q01 to ST34Q14) /PLOT=LOADING (20) . temp. select if (mathlev=4). CATPCA VARIABLES=ST34Q01 to ST34Q14 /ANALYSIS=ST34Q01 to ST34Q14 (WEIGHT=1,LEVEL=ORDI) /MISSING=ST34Q01ST34Q01 to ST34Q14 (LISTWISE) /DIMENSION=3 /NORMALIZATION=VPRINCIPAL /MAXITER=100 /CRITITER=.00001 /PRINT=LOADING QUANT( ST34Q01 to ST34Q14) /PLOT=LOADING (20) . temp. select if (mathlev=3). CATPCA VARIABLES=ST34Q01 to ST34Q14 /ANALYSIS=ST34Q01 to ST34Q14 (WEIGHT=1,LEVEL=ORDI) /MISSING=ST34Q01ST34Q01 to ST34Q14 (LISTWISE) /DIMENSION=3 /NORMALIZATION=VPRINCIPAL /MAXITER=100 /CRITITER=.00001 /PRINT=LOADING QUANT( ST34Q01 to ST34Q14) /PLOT=LOADING (20) . temp. select if (mathlev=2). CATPCA VARIABLES=ST34Q01 to ST34Q14 /ANALYSIS=ST34Q01 to ST34Q14 (WEIGHT=1,LEVEL=ORDI) /MISSING=ST34Q01ST34Q01 to ST34Q14 (LISTWISE) /DIMENSION=3 /NORMALIZATION=VPRINCIPAL /MAXITER=100 /CRITITER=.00001 /PRINT=LOADING QUANT( ST34Q01 to ST34Q14) /PLOT=LOADING (20) . temp. select if (mathlev=1). CATPCA VARIABLES=ST34Q01 to ST34Q14 /ANALYSIS=ST34Q01 to ST34Q14 (WEIGHT=1,LEVEL=ORDI) /MISSING=ST34Q01ST34Q01 to ST34Q14 (LISTWISE) /DIMENSION=3 /NORMALIZATION=VPRINCIPAL /MAXITER=100 /CRITITER=.00001 /PRINT=LOADING QUANT( ST34Q01 to ST34Q14) /PLOT=LOADING (20) . * Run PCA on optimally quantified 3-dimensional CatPCA. TEMP. SELECT IF (mathlev=0). SAVE OUTFILE="C:\PISA2003\Canlev0.sav". GET FILE ="C:\PISA2003\Canlev6.sav". FREQ mathlevel. RECODE st34q01 (1=-0.42904) (2=-0.25094) (3=0.573569) (4=4.518736) /st34q02 (1=-1.61461) (2=0.173006) (3=1.107144) (4=1.107144) /st34q03 (1=-0.89592) (2=-0.14613) (3=0.712682) (4=4.521095) /st34q04 (1=-0.51308) (2=-0.00221) (3=0.737001) (4=6.685076) /st34q05 (1=-2.13476) (2=-0.06278) (3=0.790257) (4=0.89889) /st34q06 (1=-1.66349) (2=-0.37784) (3=0.3898) (4=1.693025) /st34q07 (1=-0.70195) (2=-0.53693) (3=0.114789) (4=2.553593) /st34q08 (1=-1.7682) (2=0.344599) (3=0.899055) (4=0.899055) /st34q09 (1=-0.58269) (2=-0.50128) (3=-0.06507) (4=2.829049) /st34q10 (1=-1.49515) (2=0.486702) (3=1.076549) (4=1.279104) /st34q11 (1=-2.42461) (2=-0.20893) (3=0.713207) (4=0.969933) /st34q12 (1=-0.46318) (2=-0.25534) (3=0.20666) (4=5.186241) /st34q13 (1=-0.33563) (2=-0.33563) (3=0.239665) (4=4.707223) /st34q14 (1=-2.45907) (2=-0.06332) (3=0.685347) (4=0.685347). FACTOR VAR=st34q01 TO st34q14 /CRIT=FACTORS(3) /ROT=VARI. GET FILE ="C:\VICTOR\Joerg\Canlev0.sav". RECODE st34q01 (1= -0.32993 ) (2= -0.32993 ) (3= -0.18416 ) (4= 3.258007 ) /st34q02 (1= -0.41912 ) (2= -0.37877 ) (3= -0.19091 ) (4= 3.247926 ) /st34q03 (1= -0.33772 ) (2= -0.32185 ) (3= -0.27151 ) (4= 3.219671 ) /st34q04 (1= -0.36936 ) (2= -0.36936 ) (3= -0.17837 ) (4= 3.130796 ) /st34q05 (1= -0.5811 ) (2= -0.42465 ) (3= -0.13897 ) (4= 2.693886 ) /st34q06 (1= -0.7083 ) (2= -0.7083 ) (3= -0.43117 ) (4= 1.750479 ) /st34q07 (1= -0.6203 ) (2= -0.43499 ) (3= -0.24289 ) (4= 2.514254 ) /st34q08 (1= -0.50205 ) (2= -0.40883 ) (3= -0.16448 ) (4= 2.909179 ) /st34q09 (1= -0.38145 ) (2= -0.35755 ) (3= -0.21531 ) (4= 3.096868 ) /st34q10 (1= -0.41137 ) (2= -0.41137 ) (3= -0.28192 ) (4= 2.695316 ) /st34q11 (1= -0.36209 ) (2= -0.36209 ) (3= -0.24668 ) (4= 3.136634 ) /st34q12 (1= -0.32956 ) (2= -0.32956 ) (3= -0.19241 ) (4= 3.391169 ) /st34q13 (1= -0.42536 ) (2= -0.33191 ) (3= -0.0414 ) (4= 3.416835 ) /st34q14 (1= -0.43002 ) (2= -0.43002 ) (3= -0.27929 ) (4= 2.667678 ). FACTOR VAR=st34q01 TO st34q14 /CRIT=FACTORS(3) /ROT=VARI. GET FILE "C:\PISA2003\q34Agg.sav". COMPUTE permiss=100*NMiss/Ncases. COMPUTE vardiff=varcatpca-varpca. COMPUTE ratioE1E2=catpcaE1/catPCAE2. COMPUTE logGNPpc=ln (percapGNP). COMPUTE validN=Ncases-Nmiss. VAR LAB country "Three-character country abbreviation" percapGNP "2003 World Bank per capita GNP" country3 'Type of country' logGNPpc "2003 World Bank per capita GNP logarithm naturales" matlev "Level of math achievement" NCases "Number of cases at each math level (within country)" NMiss "Number of missing cases at each math level (within country)" CatPCAE1 "First eigenvalue from CatPCA" CatPCAE2 "Second eigenvalue from CatPCA" VarCatPCA "Variance accounted for by first two dimensions using CatPCA" VarPCA "Variance accounted for by first two dimensions using PCA" PerMiss "Percentage of missing cases at each math level" ratioE1E2 "Ratio of first CatPCA eigenvalue to second one" . VAL LAB country3 1 'Western' 2 'Transistion' 3 'Underdeveloped'. Fre var=country3. MISS VAL matlev (-1). MEANS percapgpa BY country. COMPUTE meanwt=266*validN/252462. mean VarCatPCA VarPCA LOGGNPpc by matlev. corr matlev to vardiff. TEMP. SELECT IF (matlev GE 0 and country3=3). weight by meanwt. CORRELATIONS /VARIABLES=CatPCAE1 CatPCAE2 VarCatPCA VarPCA ratioE1E2 permiss vardiff matlev logGNPpc percapGNP /PRINT=TWOTAIL NOSIG /MISSING=PAIRWISE . Compute checkvar= 100*(catpcae1 + catpcae2)/14 - varcatpca. des validN. list country matlev checkvar catpcae1 catpcae2 varcatpca. * Get mean of cognitive complexity variables across countries for levels of math achievement. weight by meanwt. MEAN catPCAe1 catpcae2 ratioe1e2 varcatpca varpca BY matlev /STAT=ANOVA. * Centre missing values on country mean. WEIGHT OFF. TEMP. SELECT IF (MISS(matlev)). COMPUTE meanmiss=100*nmiss/ncases. LIST country2 meanmiss. RECODE country2 (1=4.83) (2=5.05) (3=8.54) (4=14.35) ( 5=18.76) ( 6=5.89) ( 7=12.00) ( 8=2.24) ( 9=6.05) (10=9.74) (11=6.96) (12=2.05) (13=3.11) (14=4.21) (15=8.70) (16=5.57) (17=3.45) (18=2.49) (19=1.08) (20=4.78) (21=8.90) (22=4.32) (23=10.00) (24=7.69) (25=4.83) (26=10.38) (27=3.72) (28=4.86) (29=5.93) (30=3.59) (31=5.29) (32=8.09) (33=9.28) (34=3.21) (35=20.96) (36=12.58) (37=6.66) (38=15.53) (39=4.99) (40=12.05)INTO meanmiss. DATASET DECLARE countryaggq34. AGGREGATE /OUTFILE='countryaggq34' /PRESORTED /BREAK=COUNTRY /missq34 = MEAN(missq34) /sdq34 = MEAN(sdq34) /N_BREAK=NU.