readPIRLS {EdSurvey}R Documentation

Connect to PIRLS Data


Opens a connection to a PIRLS data file and returns an with information about the file and data.


readPIRLS(path, countries, forceReread = FALSE, verbose = TRUE)



a character value to the full directory path to the PIRLS extracted SPSS (.sav) set of data


a character vector of the country/countries to include using the three-digit ISO country code. A list of country codes can be found on Wikipedia at or other online sources. Consult the PIRLS User Guide to help determine what countries are included within a specific testing year of PIRLS. To select all countries, use a wildcard value of *.


a logical value to force rereading of all processed data. The default value of FALSE will speed up the readPIRLS function by using existing read-in data already processed.


a logical value to either print or suppress status message output. The default value is TRUE.


Reads in the unzipped files downloaded from the PIRLS international database(s) using the IEA Study Data Repository. Data files require the SPSS data file (.sav) format using the default filenames.

A PIRLS includes three distinct data levels:

When the getData function is called using a PIRLS, the requested data variables are inspected, and it handles any necessary data merges automatically. The school data always will be returned merged to the student data, even if only school variables are requested. If teacher variables are requested by the getData call, it will cause teacher data to be merged. Many students can be linked to many teachers, which varies widely between countries.

Please note that calling the dim function for a PIRLS will result in the row count as if the teacher dataset was merged. This row count will be considered the full data N of the, even if no teacher data were included in an analysis. The column count returned by dim will be the count of unique column variables across all three data levels.


an for a single specified country or an if multiple countries specified


Tom Fink

See Also

readNAEP, readTIMSS, getData, and downloadPIRLS


## Not run: 
nor <- readPIRLS("~/PIRLS/2011", countries = c("nor"))
gg <- getData(nor, c("itsex", "totwgt", "rrea"))
edsurveyTable(rrea ~ itsex, nor)

## End(Not run)

[Package EdSurvey version 2.7.1 Index]