Learn R Programming

ILSAstats (version 0.4.5)

prepILSA: Prepare ILSA Data

Description

Modifies ILSA data to meet official participation cases, selects columns and transforms data into simple data frames converting missing values to NAs.

Usage

prepILSA(
  df,
  study = NULL,
  year = NULL,
  specification = NULL,
  fixN = TRUE,
  columns = NULL
)

Arguments

df

a data frame.

study

an optional character vector indicating the ILSA name, for a list of available ILSA, check autoILSA. If NULL, the ILSA name will be determined by the column names in the data frame.

year

a numeric vector indicating the ILSA name, for a list of available cycles, check autoILSA.

specification

a character value indicating extra specification like grade (e.g., "G8" for TIMSS) or subject (e.g., "Math" for TIMSSADVANCED).

fixN

a logical value indicating if data should be "fixed" to meet official criteria. For example, reducing the sample for certain countries in TIMSS 1995. Default is TRUE.

columns

a character vector indicating which columns should be selected. If NULL, all columns will be selected.

Examples

Run this code

data(timss99)

head(timss99)

newdata <- prepILSA(df = timss99, columns = paste0("BSMMAT0",1:5),fixN = FALSE)

head(newdata)

Run the code above in your browser using DataLab