Package 'intsvy'

Title: International Assessment Data Manager
Description: Provides tools for importing, merging, and analysing data from international assessment studies (TIMSS, PIRLS, PISA, ICILS, and PIAAC).
Authors: Daniel Caro <[email protected]>, Przemyslaw Biecek <[email protected]>
Maintainer: Daniel Caro <[email protected]>
License: GPL-2
Version: 2.9
Built: 2024-05-17 07:11:20 UTC
Source: https://github.com/eldafani/intsvy

Help Index


International Assessment Data Manager

Description

Provides tools for importing, merging, and analysing data from international assessment studies (TIMSS, PIRLS, PISA, and PIAAC and others)

Details

Package: intsvy
Type: Package
Version: 2.9
Date: 2024-01-16
License: GPL-2

intsvy allows useRs to work with international assessment data (e.g., TIMSS, PIRLS, PISA, ICILS, and PIAAC). Data and merge functions print variable labels and the name of participating countries in international assessments as well as import data directly into R for the variables in student, parent, school, and teacher instruments and countries selected by the useR. Analysis functions, including mean statistics, standard deviations, regression estimates, correlation coefficients, and frequency tables, calculate point estimates and standard errors that take into account the complex sample design (i.e., replicate weights) and rotated test forms (i.e., plausible achievement values).

Author(s)

Daniel Caro <[email protected]>, Przemyslaw Biecek <[email protected]>

References

PISA, PIAAC, PIRLS, and TIMSS Technical Reports


Config files for intsvy studies

Description

Each config file describes detailed study meta-data. Such meta data defined names of columns with weights, type of weighting, number of plausible values and other study parameters. Most of intsvy functions require such config objects.

Usage

pisa_conf

Format

A list with three components - input, variables and parameters.


Performance international benchmarks and proficiency levels

Description

intsvy.ben.pv calculates the percentage of students performing at or above the cut-off points (scores) given by the useR. The default are the benchmarks established by official reports.

Usage

intsvy.ben.pv(pvnames,  by, cutoff, data, atlevel=FALSE, export = FALSE, name = "output", 
  folder = getwd(), config)

Arguments

pvnames

The names of columns corresponding to the achievement plausible scores, for example, paste0("PV",1:10,"MATH") for PISA

cutoff

The cut-off points for the assessment benchmarks (e.g., cutoff= c(357.77, 420.07, 482.38, 544.68, 606.99, 669.30)).

by

The label for the grouping variable, usually the countries (i.e., by="IDCNTRYL"), but could be any other categorical variable.

data

An R object, normally a data frame, containing the data from PIRLS.

atlevel

A logical value. If TRUE, percentages at each level are calculated. Otherwise (FALSE), percentages at or above levels are reported.

export

A logical value. If TRUE, the output is exported to a file in comma-separated value format (.csv) that can be opened from LibreOffice or Excel.

name

The name of the exported file.

folder

The folder where the exported file is located.

config

Object with configuration of a given study. Should contain the slot 'prefixes' with prefixes of filenames with the student, home, school, and teacher data.

Value

pirls.ben.pv returns a data frame with the percentage of students at or above the benchmark and the corresponding standard error.

See Also

timss.ben.pv, pirls.ben.pv, pisa.ben.pv

Examples

## Not run: 
pisa.ben.pv(pvlabel= paste0("PV",1:10,"MATH") for PISA, by="CNT", 
data=pisa, atlevel = TRUE)

intsvy.ben.pv(pvnames= paste0("PV",1:10,"MATH") for PISA by="CNT", 
data=pisa, atlevel= TRUE, config=pisa_conf)

piaac.ben.pv(pvlabel= paste0("PVLIT", 1:10), by="CNTRYID", data=piaac)

intsvy.ben.pv(pvnames= paste0("PVLIT", 1:10), by="CNTRYID", data=piaac, 
config=piaac_conf)

timss.ben.pv(pvlabel= paste0("BSMMAT0", 1:5), by="IDCNTRYL", data=timss4)

intsvy.ben.pv(pvnames= paste0("BSMMAT0", 1:5), by="IDCNTRYL", data=timss4, 
config=timss4_conf)

## End(Not run)

Config files for intsvy studies

Description

intsvy.config set non standard parameters for intsvy functions. It allso allo to apply intsvy functions to new studies that are similar to PIRLS, TIMSS, PISA, PIAAC, ICILS.

Usage

intsvy.config(variables.pvlabelpref,
           variables.pvlabelsuff,
           variables.weight,
           variables.jackknifeZone,
           variables.jackknifeRep,
           parameters.cutoffs,
           parameters.cutoffs2,
           parameters.percentiles,
           parameters.weights,
           parameters.PVreps,
           parameters.varpv1,
           input.type,
           input.prefixes,
           input.student,
           input.student_colnames1,
           input.student_colnames2,
           input.student_pattern,
           input.homeinput,
           input.home_colnames,
           input.school,
           input.school_colnames,
           input.teacher,
           input.teacher_colnames,
           input.student_ids,
           input.school_ids,
           input.type_part,
           input.cnt_part, base.config = pirls_conf)

Arguments

parameters.weights

Weighting scheme. It may be "JK" for studies like PIRLS, ICLS, TIMSS, or "BRR" for studies like PISA or "mixed_piaac" for studies with mixed design like PIAAC.

parameters.cutoffs2, parameters.cutoffs

Cut offs for plausible values, either for benchmar or for logistic regression.

parameters.percentiles, parameters.PVreps

Other parameters for weighting schemes, like number of PVs.

parameters.varpv1

Logical value, TRUE if only 1 plausible value for within variance estimation.

variables.pvlabelpref, variables.pvlabelsuff, variables.weight, variables.jackknifeZone, variables.jackknifeRep

Names of variables that are used for jack-knife replicates.

input.type, input.prefixes, input.student, input.student_colnames1, input.student_colnames2, input.student_pattern, input.homeinput, input.home_colnames, input.school, input.school_colnames, input.teacher, input.teacher_colnames, input.student_ids, input.school_ids, input.type_part, input.cnt_part

Parameters to correctly read data from files downloaded from iea.nl website.

base.config

Base config structure, either pirls_conf, pisa_conf, piaac_conf, timss4_conf, timss8_conf, icils_conf.

Value

intsvy.config returns new object with parameters. It is a list with three components - input, variables and parameters.

Examples

## Not run: 
icils_conf <- intsvy.config(input.student_pattern = "^PV[0-5]CIL$" , 
                            parameters.cutoffs2 = 550, intsvy:::pirls_conf)
icils_conf

## End(Not run)

Logistic regression analysis

Description

intsvy.log performs logistic regression analysis for an observed depedent variable (NOT for plausible values)

Usage

intsvy.log(y, x, by, data, export = FALSE, name = "output", 
  folder = getwd(), config)

Arguments

y

Label for dependent variable

x

Data labels of independent variables (e.g., x = c("ASDHEHLA", "ITSEX") ).

by

The label for the grouping variable, usually the countries (i.e., by="IDCNTRYL"), but could be any other categorical variable.

data

An R object, normally a data frame, containing the data from PIRLS.

export

A logical value. If TRUE, the output is exported to a file in comma-separated value format (.csv) that can be opened from LibreOffice or Excel.

name

The name of the exported file.

folder

The folder where the exported file is located.

config

Object with configuration of a given study. Should contain the slot 'prefixes' with prefixes of filenames with the student, home, school, and teacher data.

Value

pirls.log prints a data frame with coefficients, standard errors, t-values, and odds ratios. Results are stored in a list object of class "intsvy.reg".

See Also

timss.log, pirls.log, pisa.log

Examples

## Not run: 

pisa$SKIP[!(pisa$ST09Q01 =="None" & pisa$ST115Q01 == "None")] <- 1
pisa$SKIP[pisa$ST09Q01 =="None" & pisa$ST115Q01 == "None"] <- 0

pisa$LATE[!pisa$ST08Q01=="None"] <- 1
pisa$LATE[pisa$ST08Q01=="None"] <- 0

pisa.log(y="SKIP", x="LATE", by="IDCNTRYL", data = pisa)


## End(Not run)

Logistic regression analysis with plausible values

Description

intsvy.log.pv performs logistic regression with plausible values and replicate weights.

Usage

intsvy.log.pv(pvnames, x, cutoff, by, data, export=FALSE, name= "output", 
folder=getwd(), config)

Arguments

pvnames

The names of columns corresponding to the achievement plausible scores.

x

Data labels of independent variables.

cutoff

The cut-off point at which the dependent plausible values scores are dichotomised (1 is larger than the cut-off)

by

The label for the categorical grouping variable (i.e., by="IDCNTRYL") or variables (e.g., x= c("IDCNTRYL", "ITSEX")).

data

An R object, normally a data frame, containing the data from PIRLS.

export

A logical value. If TRUE, the output is exported to a file in comma-separated value format (.csv) that can be opened from LibreOffice or Excel.

name

The name of the exported file.

folder

The folder where the exported file is located.

config

Object with configuration of a given study. Should contain the slot 'prefixes' with prefixes of filenames with the student, home, school, and teacher data.

Value

intsvy.log.pv returns a data frame with coefficients, standard errors, t-values, and odds ratios. If "by" is specified, results are reported in a list. Weights, e.g. "TOTWGT" for PIRLS, are defined in the config argument.

See Also

pisa.log.pv, pirls.log.pv, timss.log.pv

Examples

## Not run: 
intsvy.log.pv(pvnames=paste0("PV",1:10,"MATH") , cutoff= 606.99, x="ESCS", by="IDCNTRYL", 
data=pisa, config=pisa_conf)
intsvy.log.pv(pvnames=paste0("BSMMAT0", 1:5), cutoff= 550, x="ITSEX", by="IDCNTRYL", 
data=timss8g, config=timss8_conf)

## End(Not run)

Calculates mean of variable

Description

Calculates mean and standard error of observed variable (NOT one with plausible values).

Usage

intsvy.mean(variable, by, data, export = FALSE, 
name = "output", folder = getwd(), config)

Arguments

variable

The label corresponding to the observed variable, for example, "AGE_R" for age of respondent.

by

The label for the grouping variable, usually the countries (i.e., by="CNTRYID"), but could be any other categorical variable.

data

An R object, normally a data frame, containing the data from PIAAC.

export

A logical value. If TRUE, the output is exported to a file in comma-separated value format (.csv) that can be opened from LibreOffice or Excel.

name

The name of the exported file.

folder

The folder where the exported file is located.

config

Object with configuration of a given study. Should contain the slot 'prefixes' with prefixes of filenames with the student, home, school, and teacher data.

Value

intsvy.mean returns a data frame with means and standard errors.

See Also

pisa.mean, timss.mean, pirls.mean

Examples

## Not run: 
intsvy.mean(variable="READHOME", by="CNTRYID", data=piaac, config=piaac_conf)
intsvy.mean(variable="PARED", by="IDCNTRYL", data=pisa, config=pisa_conf)
intsvy.mean(variable="BSBGSLM", by='IDCNTRYL', data=timss8g, config=timss8_conf)
intsvy.mean(variable='ASBHELA', by= 'IDCNTRYL', data=pirls,config=pirls_conf)

## End(Not run)

Calculates mean achievement score

Description

The function intsvy.mean.pv uses plausible values to calculate the mean achievement score and its standard error.

Usage

intsvy.mean.pv(pvnames, by, data, export=FALSE, name= "output", folder=getwd(), config)

Arguments

pvnames

The names of columns corresponding to the achievement plausible scores, for example, paste0("PV",1:10,"MATH") for PISA.

by

The label for the grouping variable, usually the countries (e.g., by="CNTRYID"), but could be any other categorical variable.

data

An R object, normally a data frame.

export

A logical value. If TRUE, the output is exported to a file in comma-separated value format (.csv) that can be opened from LibreOffice or Excel.

name

The name of the exported file.

folder

The folder where the exported file is located.

config

Object with configuration of a given study. Should contain the slot 'prefixes' with prefixes of filenames with the student, home, school, and teacher data.

Value

intsvy.mean.pv returns a data frame with means and standard errors.

See Also

pisa.mean.pv, timss.mean.pv, pirls.mean.pv

Examples

## Not run: 
intsvy.mean.pv(pvnames = paste0("ASRREA0", 1:5), by= "IDCNTRYL", 
    data=pirls, config=pirls_conf)

intsvy.mean.pv(pvnames = paste0("PV",1:10,"MATH"), by="CNT", data=pisa, 
    config=pisa_conf)
    
intsvy.mean.pv(pvnames = paste0("BSMMAT0", 1:5), by= "IDCNTRYL", data=timss8g, 
    config=timss8_conf)
    
intsvy.mean.pv(pvnames = paste0("PVNUM", 1:10), by="CNTRYID", data=piaac, 
    config=piaac_conf)    

## End(Not run)

Calculates percentiles

Description

Calculates percentiles for plausible values

Usage

intsvy.per.pv(pvnames, by, per, data, export=FALSE, name= "output", 
  folder=getwd(), config)

Arguments

pvnames

The names of columns corresponding to the achievement plausible scores.

per

User-defined percentiles (e.g., per = c(5, 10, 25, 75, 90, 95)).

by

The label of the categorical grouping variable (e.g., by="IDCNTRYL") or variables (e.g., by=c("IDCNTRYL", "ITSEX")).

data

An R object, normally a data frame, containing the data from intsvy studies.

export

A logical value. If TRUE, the output is exported to a file in comma-separated value format (.csv) that can be opened from LibreOffice or Excel.

name

The name of the exported file.

folder

The folder where the exported file is located.

config

Object with configuration of a given study. Should contain the slot 'prefixes' with prefixes of filenames with the student, home, school, and teacher data.

Value

intsvy.per.pv returns a data frame with percentiles and associated standard errors. Default weights (e.g. "TOTWGT" in TIMSS) and percentiles are specified in the config parameter.

See Also

pisa.per.pv, pirls.per.pv, timss.per.pv

Examples

## Not run: 
    timss.per.pv(pvlabel= paste0("BSMMAT0", 1:5), 
    per = c(5, 10, 25, 50, 75, 90, 95), by="IDCNTRYL", data=timss8)
    
    intsvy.per.pv(pvnames= paste0("BSMMAT0", 1:5),  by="IDCNTRYL", 
    data=timss8, config=timss8_conf)
    
    pirls.per.pv(pvlabel= paste0("ASRREA0", 1:5), by="IDCNTRYL", data=pirls)
    
    intsvy.per.pv(pvnames= paste0("ASRREA0", 1:5), 
    per = c(5, 10, 25, 50, 75, 90, 95), by="IDCNTRYL", data=pirls, 
    config=pirls_conf)
    
    pisa.per.pv(pvlabel= paste0("PV",1:10,"MATH"), 
    per=c(10, 25, 75, 90), by="CNT", data=pisa)
    
    intsvy.per.pv(pvnames= paste0("PV",1:10,"MATH"), 
    by="CNT", data=pisa, config=pisa_conf)
  
## End(Not run)

Regression analysis without plausible values

Description

intsvy.reg performs linear regression analysis (OLS) for an observed depedent variable (NOT for plausible values)

Usage

intsvy.reg(y, x, by, data, export = FALSE, name = "output", folder = getwd(), 
         config)

Arguments

y

Label for dependent variable.

x

Data labels of independent variables.

by

The label for the grouping variable, usually the countries (i.e., by="CNTRYID"), but could be any other categorical variable.

data

An R object, normally a data frame, containing the data.

export

A logical value. If TRUE, the output is exported to a file in comma-separated value format (.csv) that can be opened from LibreOffice or Excel.

name

The name of the exported file.

folder

The folder where the exported file is located.

config

Object with configuration of a given study. Should contain the slot 'prefixes' with prefixes of filenames with the student, home, school, and teacher data.

Value

intsvy.reg returns a data frame with coefficients, standard errors and t-values. If "by" is specified, results are reported in a list. If the "by" argument is set, then the returning object is of the class "intsvy.reg" with overloaded function plot().

See Also

pisa.reg, pirls.reg, timss.reg

Examples

## Not run: 
# install pbiecek/PIAAC package from github to have access to piaac data
piaac.reg(y="AGE_R", x="GENDER_R", by="CNTRYID", data=piaac)

## End(Not run)

Regression analysis with plausible values

Description

intsvy.reg.pv performs linear regression analysis (OLS) with plausible values and replicate weights.

Usage

intsvy.reg.pv(x, pvnames, by, 
data, std=FALSE, export = FALSE, name = "output", folder = getwd(), config)

Arguments

pvnames

The names of columns corresponding to the achievement plausible scores.

x

Data labels of independent variables.

by

The label for the grouping variable, usually the countries (i.e., by="IDCNTRYL"), but could be any other categorical variable.

data

An R object, normally a data frame, containing the data from TIMSS.

std

A logical value. If TRUE standardised regression coefficients are calculated.

export

A logical value. If TRUE, the output is exported to a file in comma-separated value format (.csv) that can be opened from LibreOffice or Excel.

name

The name of the exported file.

folder

The folder where the exported file is located.

config

Object with configuration of a given study. Should contain the slot 'prefixes' with prefixes of filenames with the student, home, school, and teacher data.

Value

intsvy.reg.pv prints a data.frame with regression results (i.e., coefficients, standard errors, t-values, R-squared) and stores different regression output including residuals, replicate coefficients, variance within and between, and the regression data.frame in a list object of class "intsvy.reg".

See Also

piaac.reg.pv, pirls.reg.pv, pisa.reg.pv, timss.reg.pv

Examples

## Not run: 
intsvy.reg.pv(pvnames=paste0("PV",1:10,"MATH") , x="ST04Q01", 
by = "IDCNTRYL",data=pisa, config=pisa_conf)

intsvy.reg.pv(pvnames=paste0("PVLIT", 1:10), x="GENDER_R", by = "CNTRYID", 
data=piaac, config=piaac_conf)

intsvy.reg.pv(pvnames=paste0("BSMMAT0", 1:5), by="IDCNTRYL", x="ITSEX", 
data=timss8g, config=timss8_conf)

intsvy.reg.pv(pvnames=paste0("ASRREA0", 1:5), by="IDCNTRYL", x="ITSEX", 
data=pirls, config=pirls_conf)

## End(Not run)

Correlation matrix

Description

intsvy.rho produces a correlation matrix for observed variables (NOT for plausible values)

Usage

intsvy.rho(variables, by, data, 
export = FALSE, name = "output", folder = getwd(), config)

Arguments

variables

Data labels for the variables in the correlation matrix (e.g., variables=c("ASRREA01", "ASDAGE") )

by

The label for the grouping variable, usually the countries (i.e., by="IDCNTRYL"), but could be any other categorical variable.

data

An R object, normally a data frame, containing the data from PIRLS.

export

A logical value. If TRUE, the output is exported to a file in comma-separated value format (.csv) that can be opened from LibreOffice or Excel.

name

The name of the exported file.

folder

The folder where the exported file is located.

config

Object with configuration of a given study. Should contain the slot 'prefixes' with prefixes of filenames with the student, home, school, and teacher data.

Value

intsvy.rho returns a matrix including correlation and standard error values.

See Also

timss.rho, pirls.rho.pv, timss.rho.pv

Examples

## Not run: 
pirls.rho(variables=c("ASRREA01", "ASDAGE"), by="IDCNTRYL", data=pirls)

## End(Not run)

Two-way weighted correlation with plausible values

Description

intsvy.rho.pv calculates the correlation and standard error among two achievement variables each based on 5 plausible values or one achievement variable and an observed variable (i.e., with observed scores rather than plausible values).

Usage

intsvy.rho.pv(variable, pvnames, by, data, export=FALSE, 
name= "output", folder=getwd(), config)

Arguments

variable

A data label for the observed variable

pvnames

The names of columns corresponding to the achievement plausible scores.

by

The label for the grouping variable, usually the countries (i.e., by="IDCNTRYL"), but could be any other categorical variable.

data

An R object, normally a data frame, containing the data.

export

A logical value. If TRUE, the output is exported to a file in comma-separated value format (.csv) that can be opened from LibreOffice or Excel.

name

The name of the exported file.

folder

The folder where the exported file is located.

config

Object with configuration of a given study. Should contain the slot 'prefixes' with prefixes of filenames with the student, home, school, and teacher data.

Value

intsvy.rho returns a matrix including correlation and standard error values.

See Also

timss.rho, pirls.rho.pv, timss.rho.pv

Examples

## Not run: 
timss.rho.pv(variable="BSDGEDUP", pvlabel=paste0("BSMMAT0", 1:5), by="IDCNTRYL", data=timss)

## End(Not run)

Select and merge data

Description

intsvy.select.merge selects and merges data from different international assessment studies. It was developed and it is particularly handy for importing IEA data since original files are organised by instrument, country, grade, etc., in a large number of files. Achievement and weight variabels (all of them) are selected by default.

Usage

intsvy.select.merge(folder = getwd(), countries, student = c(), home, 
    school, teacher, config)

Arguments

folder

Directory path where the data are located. The data could be organised within folders but duplicated files should be avoided.

countries

The selected countries, supplied with the abbreviation (e.g., countries=c("AUT", "BGR") or codes (countries=c(40, 100)). If no countries are selected, all are selected.

student

The data labels for the selected student variables.

home

The data labels for the selected home background variables.

school

The data labels for the selected school variables.

teacher

The data labels for the selected teacher data.

config

Object with configuration of a given study. Should contain the slot 'prefixes' with prefixes of filenames with the student, home, school, and teacher data.

Value

intsvy.select.merge returns a data frame with the selected data from study defined in config file.

See Also

timssg4.select.merge, timssg8.select.merge, pisa.select.merge

Examples

## Not run: 
pirls <- intsvy.select.merge(folder= getwd(),
         countries= c("AUS", "AUT", "AZE", "BFR"), 
         student= c("ITSEX", "ASDAGE", "ASBGSMR"), 
         home= c("ASDHEDUP", "ASDHOCCP", "ASDHELA", "ASBHELA"),
         school= c("ACDGDAS", "ACDGCMP", "ACDG03"), 
         config = pirls_conf)
         
pirls <- intsvy.select.merge(folder= getwd(),
         countries= c(36, 40, 31, 957),
         student= c("ITSEX", "ASDAGE", "ASBGSMR"),
         home= c("ASDHEDUP", "ASDHOCCP", "ASDHELA", "ASBHELA"),
         school= c("ACDGDAS", "ACDGCMP", "ACDG03"),
         config = pirls_conf)
                            
timss8g <- intsvy.select.merge(folder= getwd(), 
           countries=c("AUS", "BHR", "ARM", "CHL"), 
           student =c("BSDGEDUP", "ITSEX", "BSDAGE", "BSBGSLM", "BSDGSLM"),
           school=c("BCBGDAS", "BCDG03"), config = timss8_conf)
           
icils <- intsvy.select.merge(folder= getwd(),
         countries=c("AUS", "POL", "SVK"),
         student =c("S_SEX", "S_TLANG", "S_MISEI"), 
         school =c("IP1G02J", "IP1G03A"),
         config = icils_conf)
         
pisa <- pisa.select.merge(folder= getwd(),
        school.file="INT_SCQ12_DEC03.sav", 
        student.file="INT_STU12_DEC03.sav",
        student= c("ST01Q01", "ST04Q01", "ESCS", "PARED"), 
        school = c("CLSIZE", "TCSHORT"), 
        countries = c("HKG", "USA", "SWE", "POL", "PER"))         

## End(Not run)

Frequency table

Description

intsvy.table produces a frequency table for a categorical variable printing percentages and standard errors.

Usage

intsvy.table(variable, by, data, config)

Arguments

variable

The data label with the variable to be analysed.

by

The label for the grouping variable, usually the countries (i.e., by="IDCNTRYL"), but could be any other categorical variable.

data

An R object, normally a data frame, containing the data from PISA.

config

Object with configuration of a given study. Should contain the slot 'prefixes' with prefixes of filenames with the student, home, school, and teacher data.

Value

intsvy.table returns a data frame with percentages and standard errors.

See Also

timss.table, pirls.table

Examples

## Not run: 
intsvy.table(variable="ASDGSLM", by="IDCNTRYL", data=timss4, 
  config = intsvy:::timss_conf)
intsvy.table(variable="ST08Q01", by="CNT", data=pisa, config=pisa_conf)

## End(Not run)

Data labels

Description

intsvy.var.labels prints and saves variable labels and names of participating countries in a text file. The function is called by timssg4.var.label, timssg8.var.label, pirls.var.label and pisa.var.label.

Usage

intsvy.var.label(folder = getwd(), name = "Variable labels", output = getwd(),
                 config)

Arguments

folder

Directory path where the data files are located. The data could be organized within folders but duplicated files should be avoided. It is assumed that data is in 'sav' files. For TIMSS, PIRLS and ICILS studies the data can be downloaded from http://rms.iea-dpc.org/.

name

Name of the output file.

output

Folder where the output file is located.

config

Object with configuration of a given study. Should contain the slot 'prefixes' with prefixes of filenames with the student, home, school, and teacher data.

Value

intsvy.var.label returns a list with variable labels for the student, home, school, and teacher data (if applied).

See Also

timssg4.var.label, timssg8.var.label, pirls.var.label, pisa.var.label

Examples

## Not run: 
intsvy.var.label(folder= getwd(), config = pirls_conf)
intsvy.var.label(folder= getwd(), config = timss8_conf)
intsvy.var.label(folder= getwd(), config = icils_conf)
intsvy.var.label(folder= getwd(), config = piaac_conf)

## End(Not run)

PIAAC proficiency levels

Description

Calculates percentage of population at each proficiency level defined by PIAAC. Or at proficiency levels provided by the user.

Usage

piaac.ben.pv(pvlabel, by, data, cutoff, atlevel, export=FALSE, 
    name= "output", folder=getwd())

Arguments

pvlabel

The names of columns corresponding to the achievement plausible scores.

by

The label for the grouping variable, usually the countries (i.e., by="CNTRYID"), but could be any other categorical variable.

cutoff

The cut-off points for the assessment benchmarks (e.g., cutoff= c(357.77, 420.07, 482.38, 544.68, 606.99, 669.30)).

data

An R object, normally a data frame, containing the data from PIAAC.

atlevel

A logical value. If TRUE, percentages at each level are calculated. Otherwise (FALSE), percentages at or above levels are reported.

export

A logical value. If TRUE, the output is exported to a file in comma-separated value format (.csv) that can be opened from LibreOffice or Excel.

name

The name of the exported file.

folder

The folder where the exported file is located.

Value

piaac.ben.pv returns a data frame with the percentage of students at each proficiency level and its corresponding standard error.

The total weight, "TOTWGT" and the cut-off points or benchmarks are defined in the config object.

See Also

timss.ben.pv, pirls.ben.pv, pisa.ben.pv

Examples

## Not run: 
#Table A2.5
#Percentage of adults scoring at each proficiency level in numeracy
piaac.ben.pv(pvlabel= paste0("PVNUM", 1:10), by="CNTRYID", data=piaac)
#Table A2.1
#Percentage of adults scoring at each proficiency level in literacy
piaac.ben.pv(pvlabel= paste0("PVLIT", 1:10), by="CNTRYID", data=piaac)

## End(Not run)

Calculates mean of variable in PIAAC data

Description

Calculates the mean of an observed variable (NOT one with plausible values) and its standard error.

Usage

piaac.mean(variable, by, data, export = FALSE, 
name = "output", folder = getwd())

Arguments

variable

The label corresponding to the observed variable, for example, "AGE_R" for age of respondent.

by

The label for the grouping variable, usually the countries (i.e., by="CNTRYID"), but could be any other categorical variable.

data

An R object, normally a data frame, containing the data from PIAAC.

export

A logical value. If TRUE, the output is exported to a file in comma-separated value format (.csv) that can be opened from LibreOffice or Excel.

name

The name of the exported file.

folder

The folder where the exported file is located.

Value

piaac.mean returns a data frame with means and standard errors.

See Also

pisa.mean, timss.mean, pirls.mean

Examples

## Not run: 
# install pbiecek/PIAAC package from github to have access to piaac data
piaac.mean(variable="AGE_R", by="CNTRYID", data=piaac)

## End(Not run)

Calculates mean achievement score for PIAAC data

Description

piaac.mean.pv uses ten plausible values to calculate the mean achievement score and its standard error

Usage

piaac.mean.pv(pvlabel, by, data, export = FALSE, name = "output", folder = getwd())

Arguments

pvlabel

The names of columns corresponding to the achievement plausible scores.

by

The label for the grouping variable, usually the countries (i.e., by="CNTRYID"), but could be any other categorical variable.

data

An R object, normally a data frame, containing the data from PIAAC.

export

A logical value. If TRUE, the output is exported to a file in comma-separated value format (.csv) that can be opened from LibreOffice or Excel.

name

The name of the exported file.

folder

The folder where the exported file is located.

Value

piaac.mean.pv returns a data frame with the mean values and standard errors.

See Also

pisa.mean.pv, timss.mean.pv, pirls.mean.pv

Examples

## Not run: 
# install pbiecek/PIAAC package from github to have access to piaac data
piaac.mean.pv(pvlabel = paste0("PVLIT", 1:10), by = "CNTRYID", data = piaac)
piaac.mean.pv(pvlabel = paste0("PVNUM", 1:10), by=c("CNTRYID", "GENDER_R"), data=piaac)

## End(Not run)

Regression analysis for PIAAC

Description

piaac.reg performs linear regression analysis (OLS) for an observed depedent variable (NOT for plausible values)

Usage

piaac.reg(y, x, by, data, export = FALSE, name = "output", folder = getwd())

Arguments

y

Label for dependent variable.

x

Data labels of independent variables.

by

The label for the grouping variable, usually the countries (i.e., by="CNTRYID"), but could be any other categorical variable.

data

An R object, normally a data frame, containing the data from PIAAC.

export

A logical value. If TRUE, the output is exported to a file in comma-separated value format (.csv) that can be opened from LibreOffice or Excel.

name

The name of the exported file.

folder

The folder where the exported file is located.

Value

piaac.reg returns a data frame with coefficients, standard errors and t-values. If "by" is specified, results are reported in a list. If the "by" argument is set, then the returning object is of the class "intsvy.reg" with overloaded function plot().

See Also

pisa.reg, pirls.reg, timss.reg

Examples

## Not run: 
# install pbiecek/PIAAC package from github to have access to piaac data
piaac.reg(y="AGE_R", x="GENDER_R", by="CNTRYID", data=piaac)

## End(Not run)

Regression analysis with plausible values for PIAAC

Description

piaac.reg.pv performs linear regression analysis (OLS) with plausible values and replicate weights.

Usage

piaac.reg.pv(x, pvlabel, by, data, 
export = FALSE, name = "output", std=FALSE, folder = getwd())

Arguments

x

Data labels of independent variables.

pvlabel

The names of columns corresponding to the achievement plausible scores.

by

The label for the grouping variable, usually the countries (i.e., by="CNTRYID"), but could be any other categorical variable.

data

An R object, normally a data frame, containing the data from PIAAC.

export

A logical value. If TRUE, the output is exported to a file in comma-separated value format (.csv) that can be opened from LibreOffice or Excel.

name

The name of the exported file.

std

A logical value. If TRUE standardised regression coefficients are calculated.

folder

The folder where the exported file is located.

Value

piaac.reg.pv returns a data frame with coefficients, standard errors and t-values. If "by" is specified, results are reported in a list. If the "by" argument is set, then the returning object is of the class "intsvy.reg" with overloaded function plot().

See Also

pisa.reg.pv, timss.reg.pv, pirls.reg.pv

Examples

## Not run: 
# install pbiecek/PIAAC package from github to have access to piaac data
piaac.reg.pv(pvlabel=paste0("PVLIT", 1:10), x="GENDER_R", by = "CNTRYID", data=piaac)

## End(Not run)

Frequency table

Description

piaac.table produces a frequency table for a categorical variable printing percentages and standard errors.

Usage

piaac.table(variable, by, data, export = FALSE, name = "output", folder = getwd())

Arguments

variable

The data label with the variable to be analysed.

by

The label for the grouping variable, usually the countries (i.e., by="CNTRYID"), but could be any other categorical variable.

data

An R object, normally a data frame, containing the data from PIAAC.

export

A logical value. If TRUE, the output is exported to a file in comma-separated value format (.csv) that can be opened from LibreOffice or Excel.

name

The name of the exported file.

folder

The folder where the exported file is located.

Value

piaac.table returns a data frame with percentages and standard errors.

See Also

pisa.table, timss.table, pirls.table

Examples

## Not run: 
# install pbiecek/PIAAC package from github to have access to piaac data
piaac.table(variable="I_Q06A", by="CNTRYID", data=piaac)
piaac.table(variable="GENDER_R", by="CNTRYID", data=piaac)

## End(Not run)

PIRLS international benchmarks

Description

pirls.ben.pv calculates the percentage of students performing at or above the cut-off points (scores) given by the useR. The default are the benchmarks established by PIRLS/TIMSS.

Usage

pirls.ben.pv(pvlabel, by, cutoff, data, atlevel=FALSE, 
export = FALSE, name = "output", folder = getwd())

Arguments

pvlabel

The names of columns corresponding to the achievement plausible scores.

cutoff

The cut-off points for the assessment benchmarks (e.g., cutoff = c(400, 475, 550, 625).

by

The label for the grouping variable, usually the countries (i.e., by="IDCNTRYL"), but could be any other categorical variable.

data

An R object, normally a data frame, containing the data from PIRLS.

atlevel

A logical value. If TRUE, percentages at each level are calculated. Otherwise (FALSE), percentages at or above levels are reported.

export

A logical value. If TRUE, the output is exported to a file in comma-separated value format (.csv) that can be opened from LibreOffice or Excel.

name

The name of the exported file.

folder

The folder where the exported file is located.

Value

pirls.ben.pv returns a data frame with the percentage of students at or above the benchmark and the corresponding standard error.

The total weight, "TOTWGT" and the cut-off points or benchmarks are defined in the config object.

See Also

timss.ben.pv, pisa.ben.pv

Examples

## Not run: 
pirls.ben.pv(pvlabel= paste0("ASRREA0", 1:5), by="IDCNTRYL",  data=pirls)

## End(Not run)

Logistic regression analysis

Description

pirls.log performs logistic regression analysis for an observed depedent variable (NOT for plausible values)

Usage

pirls.log(y, x, by, data, export = FALSE, 
name = "output", folder = getwd())

Arguments

y

Label for dependent variable

x

Data labels of independent variables (e.g., x = c("ASDHEHLA", "ITSEX") ).

by

The label for the grouping variable, usually the countries (i.e., by="IDCNTRYL"), but could be any other categorical variable.

data

An R object, normally a data frame, containing the data from PIRLS.

export

A logical value. If TRUE, the output is exported to a file in comma-separated value format (.csv) that can be opened from LibreOffice or Excel.

name

The name of the exported file.

folder

The folder where the exported file is located.

Value

pirls.log prints a data frame with coefficients, standard errors, t-values, and odds ratios. Results are stored in a list object of class "intsvy.reg".

See Also

timss.log, pisa.log

Examples

## Not run: 

pisa$SKIP[!(pisa$ST09Q01 =="None" & pisa$ST115Q01 == "None")] <- 1
pisa$SKIP[pisa$ST09Q01 =="None" & pisa$ST115Q01 == "None"] <- 0

pisa$LATE[!pisa$ST08Q01=="None"] <- 1
pisa$LATE[pisa$ST08Q01=="None"] <- 0

pisa.log(y="SKIP", x="LATE", by="IDCNTRYL", data = pisa)


## End(Not run)

Logistic regression analysis with plausible values

Description

pirls.log.pv performs logistic regression with plausible values and replicate weights.

Usage

pirls.log.pv(pvlabel, x, cutoff, by, 
           data, export=FALSE, name= "output", folder=getwd())

Arguments

pvlabel

The names of columns corresponding to the achievement plausible scores.

x

Data labels of independent variables.

cutoff

The cut-off point at which the dependent plausible values scores are dichotomised (1 is larger than the cut-off)

by

The label for the categorical grouping variable (i.e., by="IDCNTRYL") or variables (e.g., x= c("IDCNTRYL", "ITSEX")).

data

An R object, normally a data frame, containing the data from PIRLS.

export

A logical value. If TRUE, the output is exported to a file in comma-separated value format (.csv) that can be opened from LibreOffice or Excel.

name

The name of the exported file.

folder

The folder where the exported file is located.

Value

pirls.log.pv returns a data frame with coefficients, standard errors, t-values, and odds ratios. If "by" is specified, results are reported in a list.

See Also

pisa.log.pv, timss.log.pv

Examples

## Not run: 
timss.log.pv(pvlabel="paste0("BSMMAT0", 1:5), cutoff= 550, 
x=c("ITSEX", "BSBGSLM"), by="IDCNTRYL", data=timss8g)

intsvy.log.pv(pvlabel=paste0("BSMMAT0", 1:5), cutoff= 550, 
x="ITSEX", by="IDCNTRYL", data=timss8g, config=timss8_conf)

## End(Not run)

Calculates mean of variable

Description

Calculates the mean of an observed variable (NOT one with plausible values) and its standard error.

Usage

pirls.mean(variable, by, data, 
export = FALSE, name = "output", folder = getwd())

Arguments

variable

The label corresponding to the observed variable, for example, "ASDAGE", for the age of the student.

by

The label for the grouping variable, usually the countries (i.e., by="IDCNTRYL"), but could be any other categorical variable.

data

An R object, normally a data frame, containing the data from PIRLS.

export

A logical value. If TRUE, the output is exported to a file in comma-separated value format (.csv) that can be opened from LibreOffice or Excel.

name

The name of the exported file.

folder

The folder where the exported file is located.

Value

pirls.mean returns a data frame with means and standard errors.

See Also

timss.mean, pisa.mean

Examples

## Not run: 
pirls.mean(variable='ASBHELA', by= 'IDCNTRYL', data=pirls)

## End(Not run)

Calculates mean achievement score

Description

pirls.mean.pv uses five plausible values to calculate the mean achievement score and its standard error

Usage

pirls.mean.pv(pvlabel, by,  
data, export = FALSE, name = "output", folder = getwd())

Arguments

pvlabel

The names of columns corresponding to the achievement plausible scores, for example, paste0("ASRREA0", 1:5).

by

The label for the grouping variable, usually the countries (i.e., by="IDCNTRYL"), but could be any other categorical variable.

data

An R object, normally a data frame.

export

A logical value. If TRUE, the output is exported to a file in comma-separated value format (.csv) that can be opened from LibreOffice or Excel.

name

The name of the exported file.

folder

The folder where the exported file is located.

Value

pirls.mean.pv returns a data frame with the mean values and standard errors.

See Also

timss.mean.pv, pisa.mean.pv

Examples

## Not run: 
pirls.mean.pv(pvlabel= paste0("ASRREA0", 1:5), by= "IDCNTRYL", data=pirls)
pirls.mean.pv(pvlabel= paste0("ASRREA0", 1:5), by= c("IDCNTRYL", "ITSEX"), data=pirls)

## End(Not run)

PIRLS percentiles

Description

Calculates percentiles for plausible values

Usage

pirls.per.pv(pvlabel, by, per, data, export=FALSE, 
  name= "output", folder=getwd())

Arguments

pvlabel

The names of columns corresponding to the achievement plausible scores.

per

User-defined percentiles (e.g., per = c(5, 10, 25, 75, 90, 95)).

by

The label of the categorical grouping variable (e.g., by="IDCNTRYL") or variables (e.g., by=c("IDCNTRYL", "ITSEX")).

data

An R object, normally a data frame, containing the data from PIRLS.

export

A logical value. If TRUE, the output is exported to a file in comma-separated value format (.csv) that can be opened from LibreOffice or Excel.

name

The name of the exported file.

folder

The folder where the exported file is located.

Value

pirls.per.pv returns a data frame with percentiles and associated standard errors. Default weights (e.g. "TOTWGT" in TIMSS) and percentiles are specified in the config parameter.

See Also

pisa.per.pv, timss.per.pv

Examples

## Not run: 
    pirls.per.pv(pvlabel=paste0("ASRREA0", 1:5), 
    per = c(5, 10, 25, 50, 75, 90, 95), by="IDCNTRYL", data=pirls)
  
## End(Not run)

Regression analysis

Description

pirls.reg performs linear regression analysis (OLS) for an observed depedent variable (NOT for plausible values)

Usage

pirls.reg(y, x, by, data, export = FALSE, 
name = "output", folder = getwd())

Arguments

y

Label for dependent variable

x

Data labels of independent variables (e.g., x = c("ASDHEHLA", "ITSEX") ).

by

The label for the grouping variable, usually the countries (i.e., by="IDCNTRYL"), but could be any other categorical variable.

data

An R object, normally a data frame, containing the data from PIRLS.

export

A logical value. If TRUE, the output is exported to a file in comma-separated value format (.csv) that can be opened from LibreOffice or Excel.

name

The name of the exported file.

folder

The folder where the exported file is located.

Value

pirls.reg prints a data.frame with regression results (i.e., coefficients, standard errors, t-values, R-squared) and stores different regression output including residuals and replicate coefficients in a list object of class "intsvy.reg".

See Also

timss.reg

Examples

## Not run: 

# Recode ASBGBOOK
table(as.numeric(pirls$ASBGBOOK), pirls$ASBGBOOK)
pirls$BOOK[as.numeric(pirls$ASBGBOOK)==1] <- 5
pirls$BOOK[as.numeric(pirls$ASBGBOOK)==2] <- 18
pirls$BOOK[as.numeric(pirls$ASBGBOOK)==3] <- 63
pirls$BOOK[as.numeric(pirls$ASBGBOOK)==4] <- 151
pirls$BOOK[as.numeric(pirls$ASBGBOOK)==5] <- 251
table(pirls$BOOK)

pirls.reg(y= "BOOK", x= "ITSEX", by="IDCNTRYL", data=pirls)

## End(Not run)

Regression analysis with plausible values

Description

pirls.reg.pv performs linear regression analysis (OLS) with plausible values and replicate weights.

Usage

pirls.reg.pv(x, pvlabel, by, 
data, std=FALSE, export = FALSE, name = "output", folder = getwd())

Arguments

x

Data labels of independent variables (e.g., x = c("ASDHEHLA", "ITSEX") ).

pvlabel

The names of columns corresponding to the achievement plausible scores.

by

The label for the grouping variable, usually the countries (i.e., by="IDCNTRYL"), but could be any other categorical variable.

data

An R object, normally a data frame, containing the data from PIRLS.

std

A logical value. If TRUE standardised regression coefficients are calculated.

export

A logical value. If TRUE, the output is exported to a file in comma-separated value format (.csv) that can be opened from LibreOffice or Excel.

name

The name of the exported file.

folder

The folder where the exported file is located.

Value

pirls.reg.pv prints a data.frame with regression results (i.e., coefficients, standard errors, t-values, R-squared) and stores different regression output including residuals, replicate coefficients, variance within and between, and the regression data.frame in a list object of class "intsvy.reg".

See Also

timss.reg.pv, pisa.reg.pv

Examples

## Not run: 
pirls$SEX[pirls$ITSEX=="BOY"]=1
pirls$SEX[pirls$ITSEX=="GIRL"]=0
pirls.reg.pv(pvlabel= paste0("ASRREA0", 1:5), by="IDCNTRYL", x="SEX", data=pirls)

## End(Not run)

Correlation matrix

Description

pirls.rho produces a correlation matrix for observed variables (NOT for plausible values)

Usage

pirls.rho(variables, by, data, 
export = FALSE, name = "output", folder = getwd())

Arguments

variables

Data labels for the variables in the correlation matrix (e.g., variables=c("ASRREA01", "ASDAGE") )

by

The label for the grouping variable, usually the countries (i.e., by="IDCNTRYL"), but could be any other categorical variable.

data

An R object, normally a data frame, containing the data from PIRLS.

export

A logical value. If TRUE, the output is exported to a file in comma-separated value format (.csv) that can be opened from LibreOffice or Excel.

name

The name of the exported file.

folder

The folder where the exported file is located.

Value

pirls.rho returns a matrix including correlation and standard error values.

See Also

timss.rho, pirls.rho.pv, timss.rho.pv

Examples

## Not run: 
pirls.rho(variables=c("ASRREA01", "ASDAGE"), by="IDCNTRYL", data=pirls)

## End(Not run)

Two-way weighted correlation with plausible values

Description

pirls.rho.pv calculates the correlation and standard error among two achievement variables each based on 5 plausible values or one achievement variable and an observed variable (i.e., with observed scores rather than plausible values).

Usage

pirls.rho.pv(variable, pvlabel, by, 
data, export = FALSE, name = "output", folder = getwd())

Arguments

variable

A data label for the observed variable (e.g., variable="ASDAGE")

pvlabel

The names of columns corresponding to the achievement plausible scores.

by

The label for the grouping variable, usually the countries (i.e., by="IDCNTRYL"), but could be any other categorical variable.

data

An R object, normally a data frame, containing the data from PIRLS.

export

A logical value. If TRUE, the output is exported to a file in comma-separated value format (.csv) that can be opened from LibreOffice or Excel.

name

The name of the exported file.

folder

The folder where the exported file is located.

Value

pirls.rho.pv returns a matrix with correlations and standard errors.

See Also

timss.rho.pv, pirls.rho, timss.rho

Examples

## Not run: 
pirls.rho.pv(variable="BSDGEDUP", pvlabel=paste0("BSMMAT0", 1:5), by="IDCNTRYL", data=timss)

## End(Not run)

Select and merge data

Description

pirls.select.merge selects and merges data from PIRLS. Achievement and weight variabels (all of them) are selected by default.

Usage

pirls.select.merge(folder = getwd(), countries, student = c(), 
    home, school, teacher)

Arguments

folder

Directory path where the data are located. The data could be organized within folders but it should not be duplicated.

countries

The selected countries, supplied with the abbreviation (e.g., countries=c("AUT", "BGR") or codes (countries=c(40, 100)). If no countries are selected, all are selected.

student

The data labels for the selected student variables.

home

The data labels for the selected home background variables.

school

The data labels for the selected school variables.

teacher

The data labels for the selected teacher data.

Value

pirls.select.merge returns a data frame with the selected data from PIRLS.

See Also

timssg4.select.merge, timssg8.select.merge, pisa.select.merge

Examples

## Not run: 
pirls <- pirls.select.merge(folder= getwd(),
                countries= c(36, 40, 31, 957),
                student= c("ITSEX", "ASDAGE", "ASBGSMR"),
                home= c("ASDHEDUP", "ASDHOCCP", "ASDHELA", "ASBHELA"),
                school= c("ACDGDAS", "ACDGCMP", "ACDG03"))

## End(Not run)

Frequency table

Description

pirls.table produces a frequency table for a categorical variable printing percentages and standard errors. Information about weight is extracted from intsvy:::pirls_conf.

Usage

pirls.table(variable, by, data, 
export = FALSE, name = "output", folder = getwd())

Arguments

variable

The data label with the variable to be analysed.

by

The label for the grouping variable, usually the countries (i.e., by="IDCNTRYL"), but could be any other categorical variable.

data

An R object, normally a data frame, containing the data from PIRLS.

export

A logical value. If TRUE, the output is exported to a file in comma-separated value format (.csv) that can be opened from LibreOffice or Excel.

name

The name of the exported file.

folder

The folder where the exported file is located.

Value

pirls.table returns a data frame with percentages and standard errors.

See Also

timss.table, pisa.table

Examples

## Not run: 
pirls.table(variable="ASDHELA", by="IDCNTRYL", data=pirls)

## End(Not run)

Data labels

Description

pirls.var.labels prints and saves variable labels and names of participating countries in a text file

Usage

pirls.var.label(folder = getwd(), name = "Variable labels", output = getwd())

Arguments

folder

Directory path where the PIRLS data are located. The data could be organized within folders but it should not be duplicated.

name

Name of output file.

output

Folder where output file is located.

Value

pirls.var.label returns a list with variable labels for the student, home, school, and teacher data.

See Also

timssg4.var.label, timssg8.var.label, pisa.var.label

Examples

## Not run: 
pirls.var.label(folder= getwd())

## End(Not run)

PISA proficiency levels

Description

Calculates percentage of students at each proficiency level defined by PISA. Or at proficiency levels provided by the useR.

Usage

pisa.ben.pv(pvlabel, by, cutoff, data, atlevel=FALSE, 
export=FALSE, name= "output", folder=getwd())

Arguments

pvlabel

The names of columns corresponding to the achievement plausible scores.

cutoff

The cut-off points for the assessment benchmarks (e.g., cutoff= c(357.77, 420.07, 482.38, 544.68, 606.99, 669.30)).

by

The label for the grouping variable, usually the countries (i.e., by="IDCNTRYL"), but could be any other categorical variable.

data

An R object, normally a data frame, containing the data from PISA.

atlevel

A logical value. If TRUE, percentages at each level are calculated. Otherwise (FALSE), percentages at or above levels are reported.

export

A logical value. If TRUE, the output is exported to a file in comma-separated value format (.csv) that can be opened from LibreOffice or Excel.

name

The name of the exported file.

folder

The folder where the exported file is located.

Value

pisa.ben.pv returns a data frame with the percentage of students at each proficiency level and its corresponding standard error.

The total weight, "TOTWGT" and the cut-off points or benchmarks are defined in the config object.

See Also

timss.ben.pv, pirls.ben.pv

Examples

## Not run: 
pisa.ben.pv(pvlabel= paste0("PV",1:10,"MATH"), by="IDCNTRYL", atlevel=TRUE, data=pisa)

## End(Not run)

Logistic regression analysis

Description

pisa.log performs logistic regression analysis (OLS) for an observed depedent variable (NOT for plausible values)

Usage

pisa.log(y, x, by, data, export=FALSE, name= "output", folder=getwd())

Arguments

y

Label for dependent variable.

x

Data labels of independent variables.

by

The label for the grouping variable, usually the countries (i.e., by="CNT"), but could be any other categorical variable.

data

An R object, normally a data frame, containing the data from PISA.

export

A logical value. If TRUE, the output is exported to a file in comma-separated value format (.csv) that can be opened from LibreOffice or Excel.

name

The name of the exported file.

folder

The folder where the exported file is located.

Value

pisa.log prints a data.frame with regression results (i.e., coefficients, standard errors, t-values, R-squared) and stores replicate estimates and other regression output in a list object of class "intsvy.reg".

See Also

pirls.log, timss.log

Examples

## Not run: 

pisa$SKIP[!(pisa$ST09Q01 =="None" & pisa$ST115Q01 == "None")] <- 1
pisa$SKIP[pisa$ST09Q01 =="None" & pisa$ST115Q01 == "None"] <- 0

pisa$LATE[!pisa$ST08Q01=="None"] <- 1
pisa$LATE[pisa$ST08Q01=="None"] <- 0

pisa.log(y="SKIP", x="LATE", by="IDCNTRYL", data = pisa)


## End(Not run)

Logistic regression analysis with plausible values

Description

pisa.log.pv performs logistic regression with plausible values and replicate weights.

Usage

pisa.log.pv(pvlabel, x, by, cutoff,  
      data, export=FALSE, name= "output", folder=getwd())

Arguments

pvlabel

The names of columns corresponding to the achievement plausible scores.

x

Data labels of independent variables.

cutoff

The cut-off point at which the dependent plausible values scores are dichotomised (1 is larger than the cut-off)

by

The label for the categorical grouping variable (i.e., by="IDCNTRYL") or variables (e.g., x= c("IDCNTRYL", "ST79Q03")).

data

An R object, normally a data frame, containing the data from PISA.

export

A logical value. If TRUE, the output is exported to a file in comma-separated value format (.csv) that can be opened from LibreOffice or Excel.

name

The name of the exported file.

folder

The folder where the exported file is located.

Value

pisa.log.pv returns a data frame with coefficients, standard errors, t-values, and odds ratios. If "by" is specified, results are reported in a list.

See Also

timss.log.pv, pirls.log.pv

Examples

## Not run: 
timss.log.pv(pvlabel=paste0("BSMMAT0", 1:5), cutoff= 550, 
x=c("ITSEX", "BSBGSLM"), by="IDCNTRYL", data=timss8g)

intsvy.log.pv(pvlabel=paste0("BSMMAT0", 1:5), cutoff= 550, x="ITSEX", 
by="IDCNTRYL", data=timss8g, config=timss8_conf)


## End(Not run)

Calculates mean of variable

Description

Calculates the mean of an observed variable (NOT one with plausible values) and its standard error.

Usage

pisa.mean(variable, by, data, export = FALSE, 
name = "output", folder = getwd())

Arguments

variable

The label corresponding to the observed variable, for example, ""ESCS"", for the student SES.

by

The label for the grouping variable, usually the countries (i.e., by="IDCNTRYL"), but could be any other categorical variable.

data

An R object, normally a data frame, containing the data from PISA.

export

A logical value. If TRUE, the output is exported to a file in comma-separated value format (.csv) that can be opened from LibreOffice or Excel.

name

The name of the exported file.

folder

The folder where the exported file is located.

Value

pisa.mean returns a data frame with means and standard errors.

See Also

timss.mean, pirls.mean, piaac.mean

Examples

## Not run: 
pisa.mean(variable="ESCS", by="IDCNTRYL", data=pisa)
pisa.mean(variable="PARED", by="IDCNTRYL", data=pisa)

pisa.mean(variable="BELONG", by="IDCNTRYL", data=pisa)
pisa.mean(variable="BELONG", by=c("IDCNTRYL", "ST04Q01"), data=pisa)


## End(Not run)

Calculates mean achievement score

Description

pisa.mean.pv uses five plausible values to calculate the mean achievement score and its standard error

Usage

pisa.mean.pv(pvlabel, by, data, export = FALSE, name = "output", 
     folder = getwd())

Arguments

pvlabel

The names of columns corresponding to the achievement plausible scores, for example, paste0("PV",1:10,"MATH").

by

The label for the grouping variable, usually the countries (i.e., by="IDCNTRYL"), but could be any other categorical variable.

data

An R object, normally a data frame.

export

A logical value. If TRUE, the output is exported to a file in comma-separated value format (.csv) that can be opened from LibreOffice or Excel.

name

The name of the exported file.

folder

The folder where the exported file is located.

Value

pisa.mean.pv returns a data frame with the mean values and standard errors.

See Also

timss.mean.pv, pirls.mean.pv, piaac.mean.pv

Examples

## Not run: 
pisa.mean.pv(pvlabel = paste0("PV",1:10,"MATH"), by = "IDCNTRYL", data = pisa)
pisa.mean.pv(pvlabel = paste0("PV",1:10,"MATH"), by = c("IDCNTRYL", "ST04Q01"), data = pisa)
pisa.mean.pv(pvlabel = "paste0("PV",1:10,"MATH"), by = "IDCNTRYL", data = pisa)

## End(Not run)

PISA percentiles

Description

Calculates percentiles for plausible values.

Usage

pisa.per.pv(pvlabel, by, per, data, export=FALSE, name= "output", 
  folder=getwd())

Arguments

pvlabel

The names of columns corresponding to the achievement plausible scores.

per

User-defined percentiles (e.g., per = c(5, 10, 25, 75, 90, 95)).

by

The label of the categorical grouping variable (e.g., by="IDCNTRYL") or variables (e.g., by=c("IDCNTRYL", "ST79Q03")).

data

An R object, normally a data frame, containing the data from PISA.

export

A logical value. If TRUE, the output is exported to a file in comma-separated value format (.csv) that can be opened from LibreOffice or Excel.

name

The name of the exported file.

folder

The folder where the exported file is located.

Value

pisa.per.pv returns a data frame with percentiles and associated standard errors. Default weights (e.g. "TOTWGT" in TIMSS) and percentiles are specified in the config parameter.

See Also

timss.per.pv, pirls.per.pv

Examples

## Not run: 
pisa.per.pv(pvlabel=paste0("PV",1:10,"MATH"), per=c(10, 25, 75, 90), by="IDCNTRYL", data=pisa)
  
## End(Not run)

Regression analysis

Description

pisa.reg performs linear regression analysis (OLS) for an observed depedent variable (NOT for plausible values)

Usage

pisa.reg(y, x, by, data, export = FALSE, name = "output", folder = getwd())

Arguments

y

Label for dependent variable.

x

Data labels of independent variables.

by

The label for the grouping variable, usually the countries (i.e., by="IDCNTRYL"), but could be any other categorical variable.

data

An R object, normally a data frame, containing the data from PISA.

export

A logical value. If TRUE, the output is exported to a file in comma-separated value format (.csv) that can be opened from LibreOffice or Excel.

name

The name of the exported file.

folder

The folder where the exported file is located.

Value

pisa.reg prints a data.frame with regression results (i.e., coefficients, standard errors, t-values, R-squared) and stores different regression output including residuals and replicate coefficients in a list object of class "intsvy.reg".

See Also

pirls.reg, timss.reg, piaac.reg

Examples

## Not run: 
pisa.reg(y="BELONG", x="ST04Q01", by="IDCNTRYL", data=pisa)

## End(Not run)

Regression analysis with plausible values

Description

pisa.reg.pv performs linear regression analysis (OLS) with plausible values and replicate weights.

Usage

pisa.reg.pv(x, pvlabel, by, data, 
export = FALSE, name = "output", folder = getwd(), std=FALSE)

Arguments

x

Data labels of independent variables.

pvlabel

The names of columns corresponding to the achievement plausible scores.

by

The label for the grouping variable, usually the countries (i.e., by="IDCNTRYL"), but could be any other categorical variable.

data

An R object, normally a data frame, containing the data from PISA.

export

A logical value. If TRUE, the output is exported to a file in comma-separated value format (.csv) that can be opened from LibreOffice or Excel.

name

The name of the exported file.

folder

The folder where the exported file is located.

std

A logical value. If TRUE standardised regression coefficients are calculated.

Value

pisa.reg.pv prints a data.frame with regression results (i.e., coefficients, standard errors, t-values, R-squared) and stores different regression output including residuals, replicate coefficients, variance within and between, and the regression data.frame in a list object of class "intsvy.reg".

See Also

timss.reg.pv, pirls.reg.pv, piaac.reg.pv

Examples

## Not run: 
pisa.reg.pv(pvlabel=paste0("PV",1:10,"MATH"), x="ST04Q01", by = "IDCNTRYL", data=pisa)

## End(Not run)

Correlation matrix

Description

pisa.rho produces a correlation matrix for observed variables (NOT for plausible values)

Usage

pisa.rho(variables, by, data, export=FALSE, name= "output", folder=getwd())

Arguments

variables

Data labels for the variables in the correlation matrix (e.g., variables=c("TCHBEHTD", "TCHBEHSO"))

by

The label for the grouping variable, usually the countries (i.e., by="IDCNTRYL"), but could be any other categorical variable.

data

An R object, normally a data frame, containing the data from PISA.

export

A logical value. If TRUE, the output is exported to a file in comma-separated value format (.csv) that can be opened from LibreOffice or Excel.

name

The name of the exported file.

folder

The folder where the exported file is located.

Value

pisa.rho returns a matrix including correlation and standard error values.

See Also

timss.rho, pirls.rho, pirls.rho.pv, timss.rho.pv

Examples

## Not run: 
pisa.rho(variables=c("COGACT", "TCHBEHTD", "TCHBEHSO", "CLSMAN" ), by="IDCNTRYL", data=pisa)

## End(Not run)

Select and merge data

Description

pisa.select.merge selects and merges data from PISA. Achievement and weight variables (all of them) are selected by default.

Usage

pisa.select.merge(folder=getwd(), student.file, parent.file=c(), school.file=c(), 
countries, student=c(), parent, school)

Arguments

folder

Directory path where the PISA data are located, if all the data are located in the same folder.

student.file

Student file name if 'folder' is provided, otherwise full path name of student dataset (required argument).

parent.file

Parent file name if 'folder' is provided, otherwise full path name of parent dataset.

school.file

School file name if 'folder' is provided, otherwise full path name of school dataset.

countries

The selected countries, supplied with the abbreviation (e.g., countries=c("DEU", "NOR") or codes. If no countries are selected, all are selected.

student

The data labels for the selected student variables.

parent

The data labels for the selected parental variables.

school

The data labels for the selected school variables.

Value

pisa.select.merge returns a data frame with the selected data from PISA.

See Also

timssg4.select.merge, timssg8.select.merge, pirls.select.merge

Examples

## Not run: 
pisa <- pisa.select.merge(folder=getwd(),
        school.file="INT_SCQ12_DEC03.sav",
        student.file="INT_STU12_DEC03.sav",
        parent.file="INT_PAQ12_DEC03.sav",
        student= c("IMMIG", "ESCS", "ST04Q01", "ST61Q04", "ST62Q01", "ST08Q01"),
        parent = c("PARINVOL", "PARSUPP"),
        school = c("STRATIO", "SCHAUTON", "CLSIZE"),
        countries = c("HKG", "USA", "SWE", "POL", "PER"))

## End(Not run)

Frequency table

Description

pisa.table produces a frequency table for a categorical variable printing percentages and standard errors.

Usage

pisa.table(variable, by, data, export = FALSE, name = "output", folder = getwd())

Arguments

variable

The data label with the variable to be analysed.

by

The label for the grouping variable, usually the countries (i.e., by="IDCNTRYL"), but could be any other categorical variable.

data

An R object, normally a data frame, containing the data from PISA.

export

A logical value. If TRUE, the output is exported to a file in comma-separated value format (.csv) that can be opened from LibreOffice or Excel.

name

The name of the exported file.

folder

The folder where the exported file is located.

Value

pisa.table returns a data frame with percentages and standard errors.

See Also

timss.table, pirls.table

Examples

## Not run: 
pisa.table(variable="ST01Q01", by="IDCNTRYL", data=pisa)
pisa.table(variable="ST08Q01", by="IDCNTRYL", data=pisa)

## End(Not run)

Data labels

Description

pisa.var.labels prints and saves variable labels and names of participating countries in a text file

Usage

pisa.var.label(folder=getwd(), student.file, parent.file=c(), school.file=c(), 
name="Variable labels", output=getwd())

Arguments

folder

Directory path where the PISA data are located, if all the data are located in the same folder.

student.file

Student file name if 'folder' is provided, otherwise full path name of student dataset (required argument).

parent.file

Parent file name if 'folder' is provided, otherwise full path name of parent dataset.

school.file

School file name if 'folder' is provided, otherwise full path name of school dataset.

name

Name of output file.

output

Folder where output file is located.

Value

pisa.var.label returns a list with variable labels for the student, parent, and school data.

See Also

timssg4.var.label, timssg8.var.label, pirls.var.label

Examples

## Not run: 
pisa.var.label(folder=getwd(), school.file="INT_SCQ12_DEC03.sav", 
student.file="INT_STU12_DEC03.sav", parent.file="INT_PAQ12_DEC03.sav")

## End(Not run)

Graphical representation of means in groups

Description

Functions pisa.mean, pisa.mean.pv, piaac.mean, piaac.mean.pv produce object of the class intsvy.mean. The function plot.intsvy.mean presents these means graphically.

Usage

## S3 method for class 'intsvy.mean'
plot(x, se = TRUE, sort = FALSE, ...)

Arguments

x

An object of the class intsvy.mean returned by pisa.mean, pisa.mean.pv, piaac.mean or piaac.mean.pv functions.

se

If TRUE add whiskers for standard errors.

sort

If TRUE groups are sorted along averages.

...

Not used. Required for cran-check.

Value

Returns object of ggplot class with dotplot. Works for one way, two-way and three-way effects.

See Also

plot.intsvy.table, plot.intsvy.reg

Examples

## Not run: 
# Country averages
head(pmeansNC <- piaac.mean.pv(pvlabel="NUM", by="CNTRYID", data=piaac, export=FALSE))

# plotting country average NUM performance 
plot(pmeansNC) + ggtitle("Country performance in NUM")
# without se bars, not good idea
plot(pmeansNC, se=FALSE)
# sorted, thats better
plot(pmeansNC, sort=TRUE)

# Country averages for different age groups
head(pmeansNCA <- piaac.mean.pv(pvlabel="NUM", by=c("CNTRYID", "AGEG10LFS"), 
                        data=piaac, export=FALSE))
#
# plotting country average within 
# age groups NUM performance 
plot(pmeansNCA, sort=TRUE)

# Country averages for different age and gender groups (changed order)
head(pmeansNCGA <- piaac.mean.pv(pvlabel="NUM", by=c("CNTRYID", "GENDER_R", "AGEG10LFS"), 
                         data=piaac, export=FALSE))
#
# plotting country average within 
# age and gender groups NUM performance 
plot(na.omit(pmeansNCGA), sort=TRUE)


## End(Not run)

Graphical representation of regression models in groups

Description

Functions pisa.reg, pisa.reg.pv, piaac.reg and piaac.reg.pv produce object of the class intsvy.reg. The function plot.intsvy.reg presents this list of regression models graphically.

Usage

## S3 method for class 'intsvy.reg'
plot(x, ..., vars, se = TRUE, sort = FALSE)

Arguments

x

An object of the class intsvy.reg returned by pisa.reg, pisa.reg.pv, piaac.reg and piaac.reg.pv functions.

...

Other arguments

vars

Variable labels of coefficients to be plotted. If none selected all coefficients are plotted including the R-squared

se

If TRUE add whiskers for standard errors.

sort

If TRUE groups are sorted in alphabetical order.

Value

Returns object of ggplot class with barplot. As with other ggplot objects the plus sign "+" can be used outside this function to modify graph parameters of the returning ggplot object. Works for one way, two-way and three-way contingency tables.

See Also

plot.intsvy.table, plot.intsvy.mean

Examples

## Not run: 
# Independent variables
x.vars <- c("ESCS", "COGACT", "TCHBEHTD", "TCHBEHSO")
# Model estimation
my.mod <- pisa.reg.pv(pvlabel="MATH", x=x.vars, by="IDCNTRYL", data=pisa12)
# Plot
plot(gen.mod, vars = c("COGACT", "TCHBEHTD", "TCHBEHSO"), sort=TRUE)

## End(Not run)

Graphical representation of frequency tables

Description

Functions pisa.table and piaac.table produce object of the class intsvy.table. The function plot.intsvy.table presents this table graphically.

Usage

## S3 method for class 'intsvy.table'
plot(x, se=FALSE, stacked=FALSE, centered = FALSE, midpoint = NA, ...)

Arguments

x

An object of the class intsvy.table returned by pisa.table or piaac.table functions.

se

If TRUE add whiskers for standard errors (only for stacked=FALSE).

stacked

If TRUE plot bars stacked one over another.

centered

If TRUE then bars will be centered around midpoint.

midpoint

A single number, which specifies the segment around which bars are centered. By default it's the middle segment calculated as (n.levels + 1)/2. If n.levels is odd then bars are centered around the beginning of the selected segment. If n.levels is even then bars are centered around the middle of the selected segment.

...

Not used. Required for cran-check.

Value

Returns object of ggplot class with barplot. Works for one way, two-way and three-way contingency tables.

See Also

plot.intsvy.mean, plot.intsvy.reg

Examples

## Not run: 
# install pbiecek/PIAAC package from github to have access to piaac data
# age distribution in whole dataset
(ptable <- piaac.table(variable="AGEG10LFS", data=piaac))

# age distribution in whole dataset
plot(ptable)
plot(ptable, centered=TRUE)

# age distribution within countries
head(ptableC <- piaac.table(variable="AGEG10LFS", by="CNTRYID", data=piaac))

# age distribution within countries
plot(ptableC, stacked=TRUE)
plot(na.omit(ptableC), centered=TRUE)

# age distribution within countries and gender segments
head(ptableCA <- piaac.table(variable="AGEG10LFS", by=c("CNTRYID", "GENDER_R"), data=piaac))

# age distribution within countries and gender segments
plot(na.omit(ptableCA), stacked=TRUE)
plot(na.omit(ptableCA), centered=TRUE)


## End(Not run)

TIMSS international benchmarks

Description

timss.ben.pv calculates the percentage of students performing at or above the cut-off points (scores) given by the useR. The default are the benchmarks established by PIRLS/TIMSS

Usage

timss.ben.pv(pvlabel, by,  cutoff, data, atlevel=FALSE,
export = FALSE, name = "output", folder = getwd())

Arguments

pvlabel

The names of columns corresponding to the achievement plausible scores.

cutoff

The cut-off points for the assessment benchmarks (e.g., cutoff = c(400, 475, 550, 625)).

by

The label for the grouping variable, usually the countries (i.e., by="IDCNTRYL"), but could be any other categorical variable.

data

An R object, normally a data frame, containing the data from TIMSS.

atlevel

A logical value. If TRUE, percentages at each level are calculated. Otherwise (FALSE), percentages at or above levels are reported.

export

A logical value. If TRUE, the output is exported to a file in comma-separated value format (.csv) that can be opened from LibreOffice or Excel.

name

The name of the exported file.

folder

The folder where the exported file is located.

Value

timss.ben.pv returns a data frame with the percentage of students at or above the benchmark and the corresponding standard error.

The total weight, "TOTWGT" and the cut-off points or benchmarks are defined in the config object.

See Also

pirls.ben.pv, pisa.ben.pv

Examples

## Not run: 
timss.ben.pv(pvlabel= paste0("BSMMAT0", 1:5), by="IDCNTRYL", 
cutoff = c(400, 475, 550, 625), data=timss8g)

timss.ben.pv(pvlabel= paste0("BSMMAT0", 1:5), by="IDCNTRYL", data=timss4g)

## End(Not run)

Logistic regression analysis

Description

timss.log performs logistic regression analysis for an observed depedent variable (NOT for plausible values)

Usage

timss.log(y, x, by, data, export = FALSE, 
name = "output", folder = getwd())

Arguments

y

Label for dependent variable

x

Data labels of independent variables (e.g., x = c("ASDHEHLA", "ITSEX") ).

by

The label for the grouping variable, usually the countries (i.e., by="IDCNTRYL"), but could be any other categorical variable.

data

An R object, normally a data frame, containing the data from PIRLS.

export

A logical value. If TRUE, the output is exported to a file in comma-separated value format (.csv) that can be opened from LibreOffice or Excel.

name

The name of the exported file.

folder

The folder where the exported file is located.

Value

timss.log prints a data frame with coefficients, standard errors, t-values, and odds ratios. Results are stored in a list object of class "intsvy.reg".

See Also

pirls.log, pisa.log

Examples

## Not run: 

pisa$SKIP[!(pisa$ST09Q01 =="None" & pisa$ST115Q01 == "None")] <- 1
pisa$SKIP[pisa$ST09Q01 =="None" & pisa$ST115Q01 == "None"] <- 0

pisa$LATE[!pisa$ST08Q01=="None"] <- 1
pisa$LATE[pisa$ST08Q01=="None"] <- 0

pisa.log(y="SKIP", x="LATE", by="IDCNTRYL", data = pisa)


## End(Not run)

Logistic regression analysis with plausible values

Description

timss.log.pv performs logistic regression with plausible values and replicate weights.

Usage

timss.log.pv(pvlabel, x, by, cutoff, 
           data, export=FALSE, name= "output", folder=getwd())

Arguments

pvlabel

The names of columns corresponding to the achievement plausible scores.

x

Data labels of independent variables.

cutoff

The cut-off point at which the dependent plausible values scores are dichotomised (1 is larger than the cut-off)

by

The label for the categorical grouping variable (i.e., by="IDCNTRYL") or variables (e.g., x= c("IDCNTRYL", "ITSEX")).

data

An R object, normally a data frame, containing the data from TIMSS.

export

A logical value. If TRUE, the output is exported to a file in comma-separated value format (.csv) that can be opened from LibreOffice or Excel.

name

The name of the exported file.

folder

The folder where the exported file is located.

Value

timss.log.pv returns a data frame with coefficients, standard errors, t-values, and odds ratios. If "by" is specified, results are reported in a list.

See Also

pisa.log.pv, pirls.log.pv

Examples

## Not run: 
timss.log.pv(pvlabel=paste0("BSMMAT0", 1:5), cutoff= 550, 
x=c("ITSEX", "BSBGSLM"), by="IDCNTRYL", data=timss8g)

intsvy.log.pv(pvlabel=paste0("BSMMAT0", 1:5), cutoff= 550, x="ITSEX", 
by="IDCNTRYL", data=timss8g, config=timss8_conf)

## End(Not run)

Calculates mean of variable

Description

Calculates the mean of an observed variable (NOT one with plausible values) and its standard error.

Usage

timss.mean(variable, by, data, 
export = FALSE, name = "output", folder = getwd())

Arguments

variable

The label corresponding to the observed variable, for example, "ASDAGE", for the age of the student.

by

The label for the grouping variable, usually the countries (i.e., by="IDCNTRYL"), but could be any other categorical variable.

data

An R object, normally a data frame, containing the data from TIMSS.

export

A logical value. If TRUE, the output is exported to a file in comma-separated value format (.csv) that can be opened from LibreOffice or Excel.

name

The name of the exported file.

folder

The folder where the exported file is located.

Value

timss.mean returns a data frame with means and standard errors.

See Also

pirls.mean, pisa.mean

Examples

## Not run: 
timss.mean(variable='ASBGSLM', by='IDCNTRYL', data=timss4g)
timss.mean(variable='BSBGSLM', by='IDCNTRYL', data=timss8g)

## End(Not run)

Calculates mean achievement score

Description

timss.mean.pv uses five plausible values to calculate the mean achievement score and its standard error

Usage

timss.mean.pv(pvlabel, by, data, 
export = FALSE, name = "output", folder = getwd())

Arguments

pvlabel

The names of columns corresponding to the achievement plausible scores, for example, paste0("BSMMAT0", 1:5).

by

The label for the grouping variable, usually the countries (i.e., by="IDCNTRYL"), but could be any other categorical variable.

data

An R object, normally a data frame.

export

A logical value. If TRUE, the output is exported to a file in comma-separated value format (.csv) that can be opened from LibreOffice or Excel.

name

The name of the exported file.

folder

The folder where the exported file is located.

Value

timss.mean.pv returns a data frame with the mean values and standard errors.

See Also

pirls.mean.pv, pisa.mean.pv

Examples

## Not run: 
timss.mean.pv(pvlabel= paste0("BSMMAT0", 1:5), by= "IDCNTRYL", data=timss4g)
timss.mean.pv(pvlabel= paste0("BSMMAT0", 1:5), by= c("IDCNTRYL", "ITSEX"), data=timss8g)

## End(Not run)

TIMSS percentiles

Description

Calculates percentiles for plausible values

Usage

timss.per.pv(pvlabel, by, per, data, export=FALSE, name= "output", 
  folder=getwd())

Arguments

pvlabel

The names of columns corresponding to the achievement plausible scores.

per

User-defined percentiles (e.g., per = c(5, 10, 25, 75, 90, 95)).

by

The label of the categorical grouping variable (e.g., by="IDCNTRYL") or variables (e.g., by=c("IDCNTRYL", "ITSEX")).

data

An R object, normally a data frame, containing the data from TIMSS.

export

A logical value. If TRUE, the output is exported to a file in comma-separated value format (.csv) that can be opened from LibreOffice or Excel.

name

The name of the exported file.

folder

The folder where the exported file is located.

Value

timss.per.pv returns a data frame with percentiles and associated standard errors. Default weights (e.g. "TOTWGT" in TIMSS) and percentiles are specified in the config parameter.

See Also

pisa.per.pv, pirls.per.pv

Examples

## Not run: 
timss.per.pv(pvlabel=paste0("BSMMAT0", 1:5), 
per = c(5, 10, 25, 50, 75, 90, 95), by="IDCNTRYL", data=timssg8)
  
## End(Not run)

Regression analysis

Description

timss.reg performs linear regression analysis (OLS) for an observed depedent variable (NOT for plausible values)

Usage

timss.reg(y, x, by, data, 
export = FALSE, name = "output", folder = getwd())

Arguments

y

Label for dependent variable.

x

Data labels of independent variables.

by

The label for the grouping variable, usually the countries (i.e., by="IDCNTRYL"), but could be any other categorical variable.

data

An R object, normally a data frame, containing the data from TIMSS.

export

A logical value. If TRUE, the output is exported to a file in comma-separated value format (.csv) that can be opened from LibreOffice or Excel.

name

The name of the exported file.

folder

The folder where the exported file is located.

Value

timss.reg prints a data.frame with regression results (i.e., coefficients, standard errors, t-values, R-squared) and stores different regression output including residuals and replicate coefficients in a list object of class "intsvy.reg".

See Also

pirls.reg

Examples

## Not run: 
timss.reg(y="BSDAGE", x="ITSEX", by="IDCNTRYL", data=timss8g)

## End(Not run)

Regression analysis with plausible values

Description

timss.reg.pv performs linear regression analysis (OLS) with plausible values and replicate weights.

Usage

timss.reg.pv(x, pvlabel, by, 
data, std=FALSE, export = FALSE, name = "output", folder = getwd())

Arguments

x

Data labels of independent variables.

pvlabel

The names of columns corresponding to the achievement plausible scores.

by

The label for the grouping variable, usually the countries (i.e., by="IDCNTRYL"), but could be any other categorical variable.

data

An R object, normally a data frame, containing the data from TIMSS.

std

A logical value. If TRUE standardised regression coefficients are calculated.

export

A logical value. If TRUE, the output is exported to a file in comma-separated value format (.csv) that can be opened from LibreOffice or Excel.

name

The name of the exported file.

folder

The folder where the exported file is located.

Value

timss.reg.pv prints a data.frame with regression results (i.e., coefficients, standard errors, t-values, R-squared) and stores different regression output including residuals, replicate coefficients, variance within and between, and the regression data.frame in a list object of class "intsvy.reg".

See Also

pirls.reg.pv, pisa.reg.pv

Examples

## Not run: 
timss8g$SEX[timss8g$ITSEX=="BOY"]=1
timss8g$SEX[timss8g$ITSEX=="GIRL"]=0
timss.reg.pv(pvlabel= paste0("BSMMAT0", 1:5), by=c("IDCNTRYL"), x="SEX", data=timss8g)

## End(Not run)

Correlation matrix

Description

timss.rho produces a correlations matrix for observed variables (NOT for plausible values)

Usage

timss.rho(variables, by, data, 
export = FALSE, name = "output", folder = getwd())

Arguments

variables

Data labels for the variables in the correlation matrix.

by

The label for the grouping variable, usually the countries (i.e., by="IDCNTRYL"), but could be any other categorical variable.

data

An R object, normally a data frame, containing the data from TIMSS.

export

A logical value. If TRUE, the output is exported to a file in comma-separated value format (.csv) that can be opened from LibreOffice or Excel.

name

The name of the exported file.

folder

The folder where the exported file is located.

Value

timss.rho returns a matrix including correlation and standard error values.

See Also

pirls.rho, pirls.rho.pv, timss.rho.pv

Examples

## Not run: 
timss.rho(variables=c("BSMMAT01", "BSDGEDUP"), data=timss)

## End(Not run)

Two-way weighted correlation with plausible values

Description

timss.rho.pv calculates the correlation and standard error among two achievement variables each based on 5 plausible values or one achievement variable and an observed variable (i.e., with observed scores rather than plausible values).

Usage

timss.rho.pv(variable, pvlabel, by,  
data, export = FALSE, name = "output", folder = getwd())

Arguments

variable

A data label for the observed variable

pvlabel

The names of columns corresponding to the achievement plausible scores.

by

The label for the grouping variable, usually the countries (i.e., by="IDCNTRYL"), but could be any other categorical variable.

data

An R object, normally a data frame, containing the data from TIMSS.

export

A logical value. If TRUE, the output is exported to a file in comma-separated value format (.csv) that can be opened from LibreOffice or Excel.

name

The name of the exported file.

folder

The folder where the exported file is located.

Value

timss.rho.pv returns a matrix with correlations and standard errors.

See Also

pirls.rho.pv, pirls.rho, timss.rho

Examples

## Not run: 
timss.rho.pv(variable="BSDGEDUP", pvlabel=paste0("BSMMAT0", 1:5), by="IDCNTRYL", data=timss)

## End(Not run)

Frequency table

Description

timss.table produces a frequency table for a categorical variable printing percentages and standard errors. Information about weight is extracted from intsvy:::pirls_conf.

Usage

timss.table(variable, by, data, 
export = FALSE, name = "output", folder = getwd())

Arguments

variable

The data label with the variable to be analysed.

by

The label for the grouping variable, usually the countries (i.e., by="IDCNTRYL"), but could be any other categorical variable.

data

An R object, normally a data frame, containing the data from TIMSS.

export

A logical value. If TRUE, the output is exported to a file in comma-separated value format (.csv) that can be opened from LibreOffice or Excel.

name

The name of the exported file.

folder

The folder where the exported file is located.

Value

timss.table returns a data frame with percentages and standard errors.

See Also

pirls.table, pisa.table

Examples

## Not run: 
timss.table(variable="ASDGSLM", by="IDCNTRYL", data=timss4g)
timss.table(variable="BSDGSLM", by="IDCNTRYL", data=timss8g)

## End(Not run)

Select and merge data

Description

timssg4.select.merge selects and merges data from TIMSS G4. Achievement and weight variables (all of them) are selected by default.

Usage

timssg4.select.merge(folder = getwd(), countries, student = c(), home, school, teacher)

Arguments

folder

Directory path where the data are located. The data could be organized within folders but it should not be duplicated.

countries

The selected countries, supplied with the abbreviation (e.g., countries=c("AUT", "BGR") or codes (countries=c(40, 100)). If no countries are selected, all are selected.

student

The data labels for the selected student variables.

home

The data labels for the selected home background variables.

school

The data labels for the selected school variables.

teacher

The data labels for the selected teacher variables.

Value

timssg4.select.merge returns a data frame with the selected data from TIMSS G4.

See Also

timssg8.select.merge, pirls.select.merge, pisa.select.merge

Examples

## Not run: 
timss4g <- timssg4.select.merge(folder=getwd(),
          countries=c("AUS", "BHR", "ARM", "CHL"),
          student =c("ITSEX", "ASDAGE", "ASBGSLM", "ASDGSLM"),
          home = c("ASDHEDUP", "ASDHENA"),
          school =c("ACDG03", "ACDGENS"))

## End(Not run)

Data labels

Description

timssg4.var.labels prints and saves variable labels and names of participating countries in a text file

Usage

timssg4.var.label(folder = getwd(), name = "Variable labels", output = getwd())

Arguments

folder

Directory path where the TIMSS G4 data are located. The data could be organized within folders but it should not be duplicated.

name

Name of output file.

output

Folder where output file is located.

Value

timssg4.var.label returns a list with variable labels for the student, home, school, and teacher data.

See Also

timssg8.var.label, pirls.var.label, pisa.var.label

Examples

## Not run: 
timssg4.var.label(folder= getwd())

## End(Not run)

Select and merge data

Description

timssg8.select.merge selects and merges data from TIMSS G8.

Usage

timssg8.select.merge(folder = getwd(), countries, student = c(), school, 
math.teacher, science.teacher)

Arguments

folder

Directory path where the data are located. The data could be organized within folders but it should not be duplicated.

countries

The selected countries, supplied with the abbreviation (e.g., countries=c("AUT", "BGR") or codes (countries=c(40, 100)). If no countries are selected, all are selected.

student

The data labels for the selected student variables.

school

The data labels for the selected school variables.

math.teacher

The data labels for the selected math teacher variables.

science.teacher

The data labels for the selected science teacher variables.

Value

timssg8.select.merge returns a data frame with the selected data from TIMSS G8.

See Also

timssg4.select.merge, pirls.select.merge, pisa.select.merge

Examples

## Not run: 
timss8g <- timssg8.select.merge(folder=getwd(),
                                 countries=c("AUS", "BHR", "ARM", "CHL"),
                                 student =c("BSDGEDUP", "ITSEX", "BSDAGE", "BSBGSLM", "BSDGSLM"), 
                                 school =c("BCBGDAS", "BCDG03"))

## End(Not run)

Data labels

Description

timssg8.var.labels prints and saves variable labels and names of participating countries in a text file

Usage

timssg8.var.label(folder = getwd(), name = "Variable labels", output = getwd())

Arguments

folder

Directory path where the TIMSS G8 data are located. The data could be organized within folders but it should not be duplicated.

name

Name of output file.

output

Folder where output file is located.

Value

timssg8.var.label returns a list with variable labels for the student, home, school, and teacher data.

See Also

timssg4.var.label, pirls.var.label, pisa.var.label

Examples

## Not run: 
timssg8.var.label(folder= getwd())

## End(Not run)