Learn R Programming

intsvy (version 2.9)

intsvy.mean: 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)

Value

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

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.

See Also

pisa.mean, timss.mean, pirls.mean

Examples

Run this code
if (FALSE) {
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)
}

Run the code above in your browser using DataLab