analyze the trends in international mathematics and science study (timss) with r

June 9, 2015

(This article was first published on asdfree by anthony damico, and kindly contributed to R-bloggers)

an underexplored chest of international quantitative aptitude testing, the trends in international mathematics and science study (timss) would make any pearson stockholder smile.  examining the mathematical mastery of more than 600,000 students from over sixty countries, this survey would illuminate an aggressive analyst (that’s you) about any and everything you’d ever want to know about how your country’s grade schoolers compare to the mathemagicians in finland and south korea.  created in amsterdam by the international association for the evaluation of educational achievement (iea) and administered in boston by boston college (bc) alongside its bookwormish little brother pirls, this microdata has everything you could possibly want to know about the learning and retention of fourth and eighth graders in algebra and chemistry class.  this new github repository contains three scripts:

download import and design.R

  • loop through and download every available extract onto your local disk
  • convert and import each individual country-level data set into an r-readable format bamn
  • construct replicate-weighted survey designs equivalent to the unfathomably inefficient sas, spss, and the horrific iea idb analyzer provided by the otherwise delightful data administrators

analysis examples.R

  • run the well-documented block of code reviewing most of the syntax configurations you’ll need for the lion’s share of your research


click here to view these three scripts

for more detail about the trends in international mathematics and science study (timss), visit:


before analyzing your first record of microdata, confirm you don’t actually want to invest your energies on the programme for international student assessment (pisa).

r users have published this toolkit specifically for timss, pirls, pisa, and piaac, but i am skeptical that learning a framework separate from the survey package is worth your time if you ever wish to analyze surveys other than this narrow set of four.  these surveys each have plausible value variables which are computationally equivalent to any other multiply-imputed item.  since the survey package smartly collaborates with mitools, just use the system that you already know and be done with it.  but if you don’t know either survey or intsvy, decide based on this:  intsvy works on four data sets, the survey package works on all of the microdata listed here, notably including those intsvy four.  my example syntax uses the more broadly applicable set of tools, but that doesn’t mean there isn’t anything to learn from sniffing around the intsvy documentation.

confidential to sas, spss, stata, and sudaan users: you just jumped out of an airplane with a bungee cord instead of a parachute.  time to trade in your equipment.  time to transition to r.  😀

To leave a comment for the author, please follow the link and comment on their blog: asdfree by anthony damico. offers daily e-mail updates about R news and tutorials on topics such as: Data science, Big Data, R jobs, visualization (ggplot2, Boxplots, maps, animation), programming (RStudio, Sweave, LaTeX, SQL, Eclipse, git, hadoop, Web Scraping) statistics (regression, PCA, time series, trading) and more...

If you got this far, why not subscribe for updates from the site? Choose your flavor: e-mail, twitter, RSS, or facebook...

Comments are closed.


Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)