trends: Reading and listening achievement test data obtained from...

trendsR Documentation

Description

This data set contains fictional achievement scores of 13524 students in two domains (reading, listening) in the long format.

Usage

data(trends)

Format

'data.frame': 404281 obs. of 17 variables:

year

Year of evaluation

idstud

Student identifier

idclass

Class identifier

wgt

individual student weight

jkzone

jackknife zone (primary sampling unit)

jkrep

jackknife replicate

country

The country an examinee stems from

language

spoken language at home

ses

student's socio economical status

sex

student's sex

domain

The domain the variable belongs to

booklet

booklet identifier. equal booklet identifiers indicate equal booklets across years (assessment cycles)

block

block identifier

task

task identifier

item

item identifier

format

item format

pos

position of the block within the booklet

value

The response of the student to the item (0=incorrect; 1=correct)

Source

Simulated data

Examples

data(trends)
# number of students per year, country and domain
by(data=trends, INDICES = trends[,"year"], FUN = function(x) { tapply(x[,"idstud"], x[,c("country", "domain")], FUN = function(y){length(unique(y))})})
# number of items per year, country and domain
by(data=trends, INDICES = trends[,"year"], FUN = function(x) { tapply(x[,"item"], x[,c("country", "domain")], FUN = function(y){length(unique(y))})})

# no overlapping student IDs between assessment cycles
ids <- by(data=trends, INDICES = trends[,"year"], FUN = function (x) {unique(x[,"idstud"])})
length(intersect(ids[[1]], ids[[2]]))
length(intersect(ids[[1]], ids[[3]]))
length(intersect(ids[[2]], ids[[3]]))

# sampling weights substantially differ between countries due to stratified sampling
eatTools::roundDF(do.call("rbind",  by(data=trends, INDICES = trends[,c("year", "country")], FUN = function (x) {data.frame ( x[1,c("year", "country")], eatTools::descr(x[!duplicated(x[,"idstud"]),"wgt"])[,c("Minimum", "Maximum", "Mean", "Median", "SD")], stringsAsFactors = FALSE)})), digits = 3)

# which booklets occur in which assessment cycles?
# see, for example: Bo01 only occurs 2010; Bo02 occurs 2010, 2015, and 2022; Bo83 occurs 2015 and 2020
reshape2::dcast(do.call("rbind", by(data=trends, INDICES = trends[,"year"], FUN = function (x) {data.frame ( x[1,"year", drop=FALSE], table(x[!duplicated(x[,"idstud"]),"booklet"]), stringsAsFactors = FALSE)})), year~Var1, value.var = "Freq")

# which reading tasks occur in which assessment cycles?
# see, for example: T01 occurs 2010, 2015, and 2022; T27 only occurs 2020
reshape2::dcast(do.call("rbind", by(data=subset(trends,domain=="reading"), INDICES = subset(trends,domain=="reading")[,"year"], FUN = function (x) {data.frame ( x[1,"year", drop=FALSE], table(x[!duplicated(x[,"idstud"]),"task"]), stringsAsFactors = FALSE)})), year~Var1, value.var = "Freq")

# students nested in classes?
lme4::isNested(trends[,"idstud"], trends[,"idclass"])
# items nested in tasks?
lme4::isNested(trends[,"item"], trends[,"task"])
# tasks nested in blocks? no, few tasks occur in more than one block
lme4::isNested(trends[,"task"], trends[,"block"])
# tasks nested in blocks for specific years?
by(data=trends, INDICES = trends[,"year"], FUN = function (y) {lme4::isNested(y[,"task"], y[,"block"]) })
# blocks nested in booklets?
lme4::isNested(trends[,"block"], trends[,"booklet"])

weirichs/eatModel documentation built on Jan. 26, 2025, 4:01 p.m.