Learn R Programming

EdSurvey (version 1.0.6)

hasPlausibleValue: Return a value indicating whether this variable has associated plausible values.

Description

Return a value indicating if this variable has associated plausible values in an edsurvey.data.frame or light.edsurvey.data.frame.

Usage

hasPlausibleValue(var, data)

Arguments

var

character indicating the variable in question.

data

an edsurvey.data.frame or a light.edsurvey.data.frame.

Value

A boolean (or vector when var is a vector) indicating if each element of var has plausible values associated with it.

Details

Note that this function returns TRUE only when the variable passed to it is the name for a set of plausible values, but not if it is an individual plausible value from such a set. Thus, on the NAEP primer, composite has plausible values (and so TRUE would be returned by this function), but any of the plausible values or variable names defined on the actual data (such as "mrpcm1" or "dsex") are not.

Examples

Run this code
# NOT RUN {
# read in the example data (generated, not real student data)
sdf <- readNAEP(system.file("extdata/data", "M36NT2PM.dat", package = "NAEPprimer"))

# True
hasPlausibleValue(var="composite", data=sdf)

# False
hasPlausibleValue(var="dsex", data=sdf)
# }

Run the code above in your browser using DataLab