summary2 {EdSurvey} | R Documentation |
Summarize edsurvey.data.frame Variables
Description
Summarizes edsurvey.data.frame
variables.
Usage
summary2(
data,
variable,
weightVar = attr(getAttributes(data, "weights"), "default"),
dropOmittedLevels = FALSE,
omittedLevels = deprecated()
)
Arguments
data |
an |
variable |
character vector of variable names |
weightVar |
character weight variable name. Default is the default weight of |
dropOmittedLevels |
a logical value. When set to |
omittedLevels |
this argument is deprecated. Use |
Value
summary of weighted or unweighted statistics of a given variable in an edsurvey.data.frame
For categorical variables, the summary results are a crosstab of all variables and include the following:
[variable name] |
level of the variable in the column name that the row regards. There is one column per element of |
N |
number of cases for each category. Weighted N also is produced if users choose to produce weighted statistics. |
Percent |
percentage of each category. Weighted percent also is produced if users choose to produce weighted statistics. |
SE |
standard error of the percentage statistics |
For continuous variables, the summary results are by variable and include the following:
Variable |
name of the variable the row regards |
N |
total number of cases (both valid and invalid cases) |
Min. |
smallest value of the variable |
1st Qu. |
first quantile of the variable |
Median |
median value of the variable |
Mean |
mean of the variable |
3rd Qu. |
third quantile of the variable |
Max. |
largest value of the variable |
SD |
standard deviation or weighted standard deviation |
NA's |
number of |
Zero weights |
number of zero weight cases if users choose to produce weighted statistics |
If the weight option is chosen, the function produces weighted percentile and standard deviation. Refer to the vignette titled Statistical Methods Used in EdSurvey and the vignette titled Methods Used for Estimating Percentiles in EdSurvey for how the function calculates these statistics (with and without plausible values).
Author(s)
Paul Bailey and Trang Nguyen
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"))
# print out summary of weighted statistics of a continuous variable
summary2(data=sdf, variable="composite")
# print out summary of weighted statistics of a variable, including omitted levels
summary2(data=sdf, variable="b017451", omittedLevels = FALSE)
# make a crosstab
summary2(data=sdf, variable=c("b017451", "dsex"), omittedLevels = FALSE)
# print out summary of unweighted statistics of a variable
summary2(data=sdf, variable="composite", weightVar = NULL)
## End(Not run)