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.
P E R F O R M I N G A N A L Y S E S C H A P T E R 9<br />
Figure 9.17<br />
SAS Control Statements <strong>for</strong> Per<strong>for</strong>ming Analyses with School-Level Variables<br />
(EXAMPLE3.SAS)<br />
options nocenter;<br />
* Read <strong>the</strong> variables from <strong>the</strong> school file <strong>and</strong> sort <strong>the</strong>m by <strong>the</strong> merge variables;<br />
data school;<br />
set bcgall1<br />
(keep=idcntry idschool bcbgcomm);<br />
proc sort data=school;<br />
by idcntry idschool;<br />
* Read <strong>the</strong> variables from <strong>the</strong> student file <strong>and</strong> sort <strong>the</strong>m by <strong>the</strong> merge variables;<br />
data student;<br />
set bsgall1<br />
(keep=idcntry idschool idgrader jkindic jkzone<br />
totwgt bimatscr );<br />
proc sort data=student;<br />
by idcntry idschool;<br />
* Merge <strong>the</strong> student <strong>and</strong> school files toge<strong>the</strong>r;<br />
data merged;<br />
merge student school;<br />
by idcntry idschool;<br />
if nmiss(bcbgcomm)=0;<br />
proc <strong>for</strong>mat library=work;<br />
value grade 1 = "Seventh Grade " 2 = "Eighth Grade" ;<br />
value comm 1 = "Community Type 1 " 2 = "Community Type2"<br />
3 = "Community Type 3 " 4 = "Community Type 4" ;<br />
value country<br />
036 = "Australia " 040 = "Austria " 056 = "Belgium (Fl) "<br />
057 = "Belgium (Fr) " 100 = "Bulgaria " 124 = "Canada "<br />
170 = "Colombia " 196 = "Cyprus " 200 = "Czech Republic "<br />
208 = "Denmark " 826 = "Engl<strong>and</strong> " 250 = "France "<br />
280 = "Germany " 300 = "Greece " 344 = "Hong Kong "<br />
348 = "Hungary " 352 = "Icel<strong>and</strong> " 364 = "Iran, Islamic Rep. "<br />
372 = "Irel<strong>and</strong> " 376 = "Israel " 380 = "Italy "<br />
392 = "Japan " 410 = "Korea " 414 = "Kuwait "<br />
428 = "Latvia (LSS) " 440 = "Lithuania " 528 = "Ne<strong>the</strong>rl<strong>and</strong>s "<br />
554 = "New Zeal<strong>and</strong> " 578 = "Norway " 608 = "Philippines "<br />
620 = "Portugal " 642 = "Romania " 643 = "Russian Federation "<br />
827 = "Scotl<strong>and</strong> " 702 = "Singapore " 201 = "Slovak Republic "<br />
890 = "Slovenia " 717 = "South Africa " 724 = "Spain "<br />
752 = "Sweden " 756 = "Switzerl<strong>and</strong> " 764 = "Thail<strong>and</strong> "<br />
840 = "United States" ;<br />
* Now use <strong>the</strong> macro JACK to get <strong>the</strong> results;<br />
%include "jack.sas";<br />
%jack (totwgt,jkzone,jkindic,75,idcntry idgrader bcbgcomm,bimatscr,merged);<br />
proc print data=final noobs;<br />
where idgrader = 2;<br />
by idcntry idgrader;<br />
var bcbgcomm N totwgt mnx mnx_se pct pct_se;<br />
<strong>for</strong>mat idcntry countryl. idgrader grade. bcbgcomm comm.;<br />
T I M S S D A T A B A S E U S E R G U I D E 9 - 3 5