Learn R Programming

EdSurvey (version 4.0.7)

updatePlausibleValue: Update Plausible Value Variable Names

Description

Changes the name used to refer to a set of plausible values from oldVar to newVar in an edsurvey.data.frame, a light.edsurvey.data.frame, or an edsurvey.data.frame.list.

Usage

updatePlausibleValue(oldVar, newVar, data)

Value

an object of the same class as the data argument, with the name of the plausible value updated from oldVar to newVar

Arguments

oldVar

a character value indicating the existing name of the variable

newVar

a character value indicating the new name of the variable

data

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

Author

Michael Lee and Paul Bailey

See Also

getPlausibleValue and showPlausibleValues

Examples

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

# get the PVs before
showPlausibleValues(data=sdf)
sdf2 <- updatePlausibleValue(oldVar="composite", newVar="overall", data=sdf)
showPlausibleValues(data=sdf2)
lm1 <- lm.sdf(formula=overall ~ b017451, data=sdf2)
summary(lm1)
}

Run the code above in your browser using DataLab