Gender gap and visualisation challenge @ useR!2014

7 days to go for submissions in the DataVis contest at useR!2014 (see contest webpage).
Note that the contest is open for all R users, not only conference participants.
Submit your solution soon!

PISA dataset allows to challenge some ,,common opinions”, like are boys or girls better in math / reading. But, how to compare differences between genders? Averages are not fancy enough ;-) Let’s use weighted quantiles calculated with function wtd.quantile() from the Hmisc package.

Below we present quantile-quantile plots for results in math and reading. Each point represents a single centile. X coordinate stands for centiles of male scores while Y coordinate correspond to female scores respectively. Black line is the diagonal, points on this line correspond to equal centiles in both distributions.
Points below black line correspond to centile for which boys are doing better than girls. Points above black line correspond to centiles for which girls are doing better. For reading the story is simple, girls are doing better for all centiles, whole distribution is shifted. But for math the story is different for different countries.

[UK – distribution of math scores for boys is shifted in comparison to females]

[Finland – distribution of math scores for boys is wider, weak boys are weaker than girls but strong one are stronger than corresponding girl’s centile]

[USA – somewhere between Finland and UK]

What is the story for your country?

And the R code.

Proficiency levels @ PISA and visualisation challenge @ useR!2014

16 days to go for submissions in the DataVis contest at useR!2014 (see contest webpage).
The contest is focused on PISA data and students’ skills. The main variables that reflect pupil skills in math / reading / science are plausible values e.g. columns PV1MATH, PV1READ, PV1SCIE in the dataset.
But, these values are normalized to have mean 500 and sd 100. And it is not that easy to understand what the skill level 600 means and is 12 points in average a big difference. To overcome this PISA has introduced seven proficiency levels (from 0 to 6, see http://nces.ed.gov/pubs2014/2014024_tables.pdf) that base on plausible values with cutoffs 358, 420, 482, 545, 607, 669.
It is assumed that, for example, at level 6 ,,students can conceptualize, generalize, and utilize information based on their investigations and modeling of complex problem situations, and can use their knowledge in relatively non-standard contexts”.

So, instead of looking at means we can now take a look at fractions of students at given proficiency level. To have some fun we use sp and rworldmap and RColorBrewer packages to have country shapes instead of bars and dots that are supposed to represent pupils that take part in the study. The down side is that area does not correspond to height so it might be confusing. We add horizontal lines to expose the height.



And here is the R code

Are they happy at school? PISA data and visualisation challange @ useR!2014

I hope you have already heard about DataVis contest at useR!2014 (in case you did not, here is more information: http://www.oecd.org/pisa/pisaproducts/datavisualizationcontest.htm).
As a jury member I am not going to submit any work, but I am going to encourage you to play with the data, crunch a finding and submit interesting plot.

How easy is to download the data and create some graph?

Let’s take a look at students’ answers for questions: ‘Do you feel happy at school?’ and ‘How familiar are you with Declarative Fractions?’.

Are boys more familiar with ‘Declarative Fractions’ than girls?
(funny fact: ‘Declarative Fraction’ is a fake concept that is used in PISA to measure overconfidence)
(funny fact 2: plot familiarity with ‘Declarative Fractions’ across countries, results are very interesting)

In which countries the fraction of kids that declare that they are happy at school is the highest?

There is a lot of ‘kind of Likert’ scale questions in the PISA study, for sure there is a lot of nice stories as well.

Data visualisation challange at useR 2014 conference

Familiar with R and DataVis? Take a try in PISA data visualisation contest for useR2014 participants.
There are two contest tracks. In each you can win 700$.

More information about the contest can be found here: http://www.oecd.org/pisa/pisaproducts/datavisualizationcontest.htm.

The prizes are funded by The Organisation for Economic Co-operation and Development (OECD) and tracks are related to data from The Programme for International Student Assessment (PISA).

Note that the deadline is Sunday 29 june 2014 Pacific Daylight Time.

Below you can find an simple example how to read PISA data and plot some basic graphs.

Let’s see in which countries pupils have high average reading + math score and in which countries pupils are on average better in math than reading.

Let’s add country sizes to the plot.

I am very eager to see winning submissions.

PISA 2012, occupations and the shiny app

OECD has just released a new PISA in Focus titled “Do parents’ occupations have an impact on student performance?”.

A shiny app is an add-on to this article, you can open it from this link:
http://beta.icm.edu.pl/PISAoccupations2012/.

The app allows for comparisons of average performance in mathematics/reading/science of 15-years old pupils in PISA study across different groups of parental occupations.
Are kids of Professionals ‘on average’ performing better than kids of other professions?

You can also compare countries or regions to check if spread of occupational averages is larger or smaller here or there.

The nice thing about this article and results is that they are created entirely in R (data, results and R codes are open).

R sources of this app are available on github: https://github.com/pbiecek/PISA2012lite/tree/master/ext/PisaInFocusOccupationsRegions

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.

The PISA2009lite package is released

This post introduces a new R package named PISA2009lite. I will show how to install this package, what is inside and how to use it.

Introduction

PISA (Programme for International Student Assessment) is a worldwide study focused on measuring performance of 15-year-old school pupils. More precisely, scholastic performance on mathematics, science and reading is measured in more than 500 000 pupils from 65 countries.

First PISA study was performed in 2000, second in 2003, and then in 2006, 2009 and the last one in 2012. Data from the last study will be made public on December 2013. Data from previous studies are accessible through the PISA website http://www.oecd.org/pisa/.
Note that this data set is quite large. This is why the PISA2009lite package will use more than 220MB of your disk [data sets are compressed on disk] and much more RAM [data sets will be decompressed after [lazy]loading to R].

Let's see some numbers. In PISA 2009 study, number of examined pupils: 515 958 (437 variables for each pupil), number of examined parents: 106 287 (no, their questions are not related to scholastic performance), number of schools from which pupils were sampled: 18 641. Pretty large, complex and interesting dataset!

On the official PISA webpage there are instructions how to read data from 2000-2009 studies into SAS and SPSS statistical packages. I am transforming these dataset to R packags, to make them easier to use for R users.
Right now, PISA2009lite is mature enough to share it. There are still many things to correct/improve/add. Fell free to point them [or fix them].

This is not the first attempt to get the PISA data available for R users. On the github you can find 'pisa' package maintained by Jason Bryer (https://github.com/jbryer/pisa) with data from PISA 2009 study.
But since I need data from all PISA editions, namely 2000, 2003, 2006, 2009 and 2012 I've decided to create few new packages, that will support consistent way to access data from different PISA studies.

Open the R session

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

now PISA2009lite is ready to be loaded

You will find five data sets in this package [actually ten, I will explain this later]. These are: data from student questionnaire, school questionnaire, parent questionnaire, cognitive items and scored cognitive items.

You can do a lot of things with these data sets. And I am going to show some examples in next posts.

Country ranking in just few lines of code

But as a warmer let's use it to calculate average performance in mathematics for each country.

Note that student2009$W_FSTUWT stands for sampling weights, student2009$PV1MATH stands for first plausible value from MATH scale while student2009$CNT stands for country

And plot it.

plot of chunk unnamed-chunk-6