The PISA2003lite package is released. Let’s explore!

Today I’m going to show how to install PISA2003lite, what is inside and how to use this R package. Datasets from this package will be used to compare student performance in four math sub-areas across different countries.
At the end of the day we will find out in which areas top performers from different countries are stronger and in which they are weaker.

In the post ,,The PISA2009lite is released” an R package PISA2009lite with data from PISA 2009 was introduced. The same approach was applied to convert data from PISA 2003 into an R package. PISA (Programme for International Student Assessment) is a worldwide study focused on measuring scholastic performance on mathematics, science and reading of 15-year-old school pupils.
The study performed in 2003 was focused on mathematics. Note, that PISA 2012 was focused on mathematics as well, so it will be very interesting to compare results between both studies [when only date from PISA 2012 data become public].

The package PISA2003lite is on github, so to install it you just need

You will find three data sets in this package. These are: data from student questionnaire, school questionnaire and cognitive items.

Let's plot something! What about strong and weak sides in particular MATH sub-areas?
In this dataset the overall performance is represented by five plausible values: PV1MATH, PV2MATH, PV3MATH, PV4MATH, PV5MATH. But for each student also performance in four sub-scales is measured. These sub-scales are: Space and Shape, Change and Relationships, Uncertainty and Quantity (plausible values: PVxMATHx, x=1..5, y=1..4).

Let's find out how good are top performers in each country in different sub-scales.
For every country, let's calculate the 95% quantile of performance in every subscale.

Just few more lines to add the proper row- and col- names.

And here are results. Table looks nice, but there is so many numbers.
Let's use PCA to reduce dimensionality of the data.

plot of chunk unnamed-chunk-5

Quite interesting!
It looks like first PCA coordinate is an average over all sub-scales. Thus on the plot above the further left, the better are top performers in all sub-scales.
But the second PCA coordinate differentiates between countries in which top performers are better in 'Space and Shape' [top] versus ‚Uncertainty’ [bottom]. Compare this plot with the table above, and you will see that for Czech Republic, Slovak Republic, Russian Federation the 'Space and Shape' is the strongest side of top performers.
On the other side Sweden, USA, Norway, Ireland score higher in ‚Uncertainty’.

As you may easily check, that results are pretty similar if you focus on averages or performers from the bottom tail.

Which direction is better? Of course it depends. But since ,,change is the only sure thing'', understanding of uncertainty might be useful.

7 thoughts on “The PISA2003lite package is released. Let’s explore!”

  1. Thank you, this is interesting and potentially useful, but I run into trouble with the reference to PISA2009lite:

    > library(PISA2009lite)
    > rownames(res) if (length(find.package(„PISA2009lite”, quiet = TRUE)) == 0) install_github(„PISA2009lite”, „pbiecek”)

    # * installing *source* package ‚PISA2009lite’ …
    # ** data
    # *** moving datasets to lazyload DB
    # Error : cannot allocate buffer
    # ERROR: lazydata failed for package ‚PISA2009lite’
    # * removing ‚C:/Users/Mark/Documents/R/win-library/3.0/PISA2009lite’

    And on 2nd attempt:
    # Installing github repo(s) PISA2009lite/master from pbiecek
    # Downloading from
    # Error in function (type, msg, asError = TRUE) :
    # SSL read: error:00000000:lib(0):func(0):reason(0), errno 10054

    Having intalled PISA2003lite to lazyload DB, it seems PISA2009lite is too large to be allocated.

    I’ve tried to load student2009lite having closed the PISA2003lite project, but even that won’t work on with 12GB RAM (on a new Windows 8, 3.4GHz i7 machine).

    Perhaps using student2009dict is a shortcut, but a student2003dict is really required to avoid reliance on student2009lite? Or another approach to select subsets of data from each edition PISA.

    1. @mark: sorry for confusion.
      The entry was published two months ago and after that PISA2003lite package has changed a bit. I hope this is what caused the problem.
      I’ve updated the blog entry.
      The presented examples should be much faster and [most important] should work with current version of PISA2003lite.
      Pls let me know if there will be any further problems.

  2. i’m almost done writing code to analyze pisa in monetdb + r. this will prevent ram from overloading and correctly calculate standard errors (as published by oecd). here’s my (unfinished) code..

    note the first script will download the 2000, 2003, 2006, and 2009 data sets directly into user intervention required. after that, you should be able to analyze it like any other multiply-imputed object in the survey package 🙂

    send me a note offline?

    1. @Anthony: I was considering SQLite but found out that it is easier for end user to download just one big rda file once. But monetdb looks like interesting alternative to speedup the processing.
      Sending the letter in few minutes.
      And looks great!

  3. Dear SmarterPoland,

    I got a very similar error, like this when I was installing PISA2009lite


    * installing *source* package ‚PISA2009lite’ …
    ** data
    ** moving datasets to lazyload DB
    Error : cannot allocate buffer
    ERROR: lazydata failed for package ‚PISA2009lite’
    * removing ‚C:/root/R/R-2.15.3/library/PISA2009lite’
    Error: Command failed (1)
    In addition: Warning message:
    package ‘’ is not available (for R version 2.15.3)


    What would you think is the cause of the buffer error? How much is the memory of your laptop and what is the R version of yours? Thank you!

Dodaj komentarz

Twój adres email nie zostanie opublikowany. Pola, których wypełnienie jest wymagane, są oznaczone symbolem *