getAllItems {EdSurvey}R Documentation

Retrieve IRT Item Variable Names

Description

Retrieves the IRT item variable names associated with construct names for use with mml.sdf function.

Usage

getAllItems(sdf, construct = NULL)

Arguments

sdf

an edsurvey.data.frame or light.edsurvey.data.frame containing IRT information. Supports NAEP and TIMSS 2011, 2015, and 2019 studies only.

construct

a character value (or vector) for which to return the associated item variable names. Default value is NULL which returns all IRT item variable names. Use the showPlausibleValues function to view construct details.

Value

a character vector of the items names associated for the values in construct.

Note

if construct is a vector, all item names will be returned for those constructs. Use getAllItems with getData when creating a light.edsurvey.data.frame, see example for use.

Author(s)

Tom Fink, Sun-Joo Lee, Eric Buehler, and Paul Bailey

See Also

mml.sdf

Examples

## Not run: 
  #TIMSS Example
  t15 <- readTIMSS("~/TIMSS/2015", "usa", 4)
  
  showPlausibleValues(t15) #view constructs in console
  
  #ensure we have all data needed for mml.sdf on light.edsurvey.data.frame
  #must be specified ahead of time.  the 'getAllItems' function makes this easy
  mathItems <- getAllItems(t15, "mmat") #get mathematics items
  sciItems <- getAllItems(t15, "ssci") #get science items
  allItems <- getAllItems(t15, construct = "NULL")
  
  wgtVar <- "totwgt"
  psustr <- c(getPSUVar(t15, wgtVar), getStratumVar(t15, wgtVar))
  lsdf <- getData(data = t15,
                  varnames = c("ROWID", "mmat", mathItems, psustr, wgtVar),
                  omittedLevels = FALSE,
                  addAttributes = TRUE) #builds light.edsurvey.data.frame
  
  #as a light.edsurvey.data.frame all elements must be present
  mml.sdf(mmat ~ 1, lsdf, weightVar = "totwgt")
  
  #as edsurvey.data.frame elements retrieved automatically for user
  mml.sdf(mmat ~ 1, t15, weightVar = "totwgt") 
  
  #NAEP example
  sdf <- readNAEP(system.file("extdata/data", "M36NT2PM.dat", package = "NAEPprimer"))
  
  allItems <- getAllItems(sdf, construct = NULL)
  algebraItems <- getAllItems(sdf, construct = "algebra")

## End(Not run)

[Package EdSurvey version 4.0.4 Index]