User Guide for the TIMSS International Database.pdf - TIMSS and ...
User Guide for the TIMSS International Database.pdf - TIMSS and ...
User Guide for the TIMSS International Database.pdf - TIMSS and ...
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
C H A P T E R 9 P E R F O R M I N G A N A L Y S E S<br />
9.3.2 SPSS Macro <strong>for</strong> Computing Mean <strong>and</strong> Percents with<br />
Corresponding St<strong>and</strong>ard Errors (JACK.SPS)<br />
The CD containing <strong>the</strong> <strong>TIMSS</strong> <strong>International</strong> <strong>Database</strong> also contains an SPSS macro program<br />
called JACK.SPS. This macro can be used to compute weighted percents <strong>and</strong> means within<br />
categories. Although <strong>the</strong> user can compute weighted percent <strong>and</strong> mean estimates using o<strong>the</strong>r<br />
basic SPSS comm<strong>and</strong>s, <strong>the</strong> macro JACK.SPS also computes <strong>the</strong> JRR error estimate <strong>for</strong> <strong>the</strong>se<br />
means <strong>and</strong> percents. The control code <strong>for</strong> <strong>the</strong> macro JACK.SPS is presented in Figure 9.7.<br />
Figure 9.7<br />
SPSS Macro <strong>for</strong> Computing Mean <strong>and</strong> Percents with Corresponding JRR St<strong>and</strong>ard<br />
Errors (JACK.SPS)<br />
set mprint=on.<br />
define jack (cvar = !charend('/') /<br />
dvar = !charend('/') /<br />
njkr = !charend('/') /<br />
jkz = !charend('/') /<br />
jki = !charend('/') /<br />
wgt = !charend('/') ) .<br />
weight off.<br />
sort cases by !cvar .<br />
compute k = 1.<br />
compute wgtx = !wgt * !dvar.<br />
vector rwgt(!njkr).<br />
vector rwgtx(!njkr).<br />
loop #i = 1 to !njkr.<br />
if (!jkz = #i <strong>and</strong> !jki = 0) rwgt(#i) = !wgt * 0.<br />
if (!jkz = #i <strong>and</strong> !jki = 1) rwgt(#i) = !wgt * 2.<br />
if (!jkz #i ) rwgt(#i) = !wgt * 1.<br />
compute rwgtx(#i) = rwgt(#i) * !dvar.<br />
end loop.<br />
!let !nway = tmpjck1<br />
aggregate outfile = !nway<br />
/ presorted<br />
/ break = !cvar k<br />
/ !wgt rwgt1 to !concat(rwgt,!njkr) wgtx rwgtx1 to !concat(rwgtx,!njkr)<br />
= sum(!wgt rwgt1 to !concat(rwgt,!njkr) wgtx rwgtx1 to !concat(rwgtx,!njkr))<br />
/ n = n(!wgt).<br />
!let !cvar1 = !null<br />
!do !i !in(!cvar)<br />
!let !cvar1 = !concat(!i,!blank(1),!cvar1)<br />
!doend<br />
!let !cvar2a = !concat(!cvar1,!blank(1),k)<br />
!let !cvar2b = !concat(!tail(!cvar1),!blank(1),k)<br />
!do !i !in(!cvar2a)<br />
!if (!cvar2b = !null) !<strong>the</strong>n !break<br />
!ifend<br />
get file = !nway.<br />
compute k = 1.<br />
!let !seq = !index(!cvar1,!i)<br />
9 - 1 6 T I M S S D A T A B A S E U S E R G U I D E