readNAEP {EdSurvey} | R Documentation |
Opens a connection to an NAEP data file residing
on the disk and returns an edsurvey.data.frame
with
information about the file and data.
readNAEP(
path,
defaultWeight = "origwt",
defaultPvs = "composite",
omittedLevels = c("Multiple", NA, "Omitted"),
frPath = NULL
)
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 location of the |
The function uses the frPath
file layout (.fr2) data to read in the
fixed-width data file (.dat) and builds the edsurvey.data.frame
.
NAEP 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.
An edsurvey.data.frame
containing the following elements:
userConditions |
a list containing all user conditions set using the |
defaultConditions |
the default conditions to be applied to the |
data |
an |
dataSch |
an |
dataTch |
not applicable for NAEP data; returns |
weights |
a list containing the weights found on the |
pvvar |
a list containing the plausible values found on the |
subject |
the subject of the dataset contained in the |
year |
the year of assessment of the dataset contained in the |
assessmentCode |
the code of the dataset contained in the |
dataType |
the type of data (whether student or school) contained in the |
gradeLevel |
the grade of the dataset contained in the |
achievementLevels |
default NAEP achievement cutoff scores |
omittedLevels |
the levels of the factor variables that will be omitted from the |
fileFormat |
a |
fileFormatSchool |
a |
fileFormatTeacher |
not applicable for NAEP data; returns |
survey |
the type of survey data contained in the |
Tom Fink and Ahmad Emad
## Not run:
# read in the example data (generated, not real student data)
sdf <- readNAEP(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)