Learn R Programming

EdSurvey (version 4.0.7)

isWeight: Weight Test

Description

Returns logical values indicating whether a vector of variables is a weight for an edsurvey.data.frame, a light.edsurvey.data.frame, or an edsurvey.data.frame.list.

Usage

isWeight(var, data)

Value

a logical vector of values indicating if each element of var

is a weight

Arguments

var

a character vector of variables

data

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

Author

Michael Lee and Paul Bailey

Details

Note that this function returns TRUE only when the var element is the name of the weight used for making estimates but not if it is one of the individual jackknife replicates.

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"))

# TRUE
isWeight(var="origwt", data=sdf)

# FALSE
isWeight(var="dsex", data=sdf)
}

Run the code above in your browser using DataLab