readNAEP {EdSurvey} | R Documentation |
Connect to NAEP Data
Description
Opens a connection to a Main NAEP, or Long-Term Trend NAEP data file residing
on the disk. Returns an edsurvey.data.frame
with
information about the file and data.
Usage
readNAEP(
path,
defaultWeight = "origwt",
defaultPvs = "composite",
omittedLevels = c("Multiple", NA, "Omitted"),
frPath = NULL,
xmlPath = NULL
)
Arguments
path |
a character value indicating the full filepath location and name of the (.dat) data file |
defaultWeight |
a character value that indicates the default weight
specified in the resulting |
defaultPvs |
a character value that indicates the default plausible value
specified in the resulting |
omittedLevels |
a character vector indicating which factor levels/labels
should be excluded. When set to the default value of
|
frPath |
a character value indicating the file location of the |
xmlPath |
a character value indicating the file path of the |
Details
The frPath
file layout information will take precedence over the xmlPath
file when the xmlPath
is not explicitly set, or when the xmlPath
file cannot be located.
The readNAEP
function includes both scaled scores and theta scores, with the latter having names ending in \_theta
.
When a NAEP administration includes a linking error variable those variables are included and end in _linking
.
When present, simply use the _linking
version of a variable to get a standard error estimate that includes linking error.
This function supports both the Main NAEP data files, and Long-Term Trend NAEP data files. A table outlining the differences can be found on the NAEP Nations Report Card website.
Value
An edsurvey.data.frame
for a NAEP data file.
Author(s)
Tom Fink and Ahmad Emad
See Also
Examples
## Not run:
# read in the example data (generated, not real student data)
sdf <- readNAEP(path=system.file("extdata/data", "M36NT2PM.dat", package = "NAEPprimer"))
sdf
# To read in an NCES file first set the directory to the /Data subfolder,
# then read in the appropriate .dat file:
setwd("location/of/Data")
sdf <- readNAEP(path="M36NT2PM.dat")
# Or read in the .dat file directly through the folder pathway:
sdf <- readNAEP(path="location/of/Data/M36NT2PM.dat")
## End(Not run)