The return type depends on if the class of the data
argument is an
edsurvey.data.frame
or an edsurvey.data.frame.list
. Both
include the call (called call
), a list called labels
,
an object named percentage
that shows the percentage in groupA
and groupB
, and an object
that shows the gap called results
.
The labels include the following elements:
definitionthe definitions of the groups
nFullDatathe n-size for the full dataset (before applying the definition)
nUsedthe n-size for the data after the group is subsetted and other
restrictions (such as omitted values) are applied
nPSUthe number of PSUs used in calculation--only returned when
returnNumberOfPSU
=
TRUE
The percentages are computed according to the vignette titled
https://www.air.org/sites/default/files/EdSurvey-Statistics.pdfStatistical Methods Used in EdSurvey
in the section
Estimation of Weighted Percentages When Plausible Values Are Not Present.
The standard errors are calculated according to
Estimation of the Standard Error of Weighted Percentages When Plausible Values Are Not Present, Using the Jackknife Method.
Standard errors of differences are calculated as the square root of the typical
variance formula
Var(A-B) = Var(A) + Var(B) - 2 Cov(A,B)
where the covariance term is calculated as described in the vignette titled
https://www.air.org/sites/default/files/EdSurvey-Statistics.pdfStatistical Methods Used in EdSurvey
in the section
Estimation of Covariances. These degrees of freedom are available only
with the jackknife variance estimation. The degrees of freedom used for hypothesis testing
are always set to the number of jackknife replicates in the data.
the data argument is an edsurvey.data.frame
When the data argument is an edsurvey.data.frame,
gap returns an S3 object of class gap.
The percentage object is a numeric vector with the following elements:
pctAthe percentage of respondents in groupA
compared with the whole sample in data
pctAsethe standard error on the percentage of respondents in
groupA
dofAdegrees of freedom appropriate for a t-test involving pctA
.
This value is returned only if
returnSimpleDoF
=
TRUE
.
pctBthe percentage of respondents in groupB
.
pctBsethe standard error on the percentage of respondents in
groupB
dofBdegrees of freedom appropriate for a t-test involving pctA
.
This value is returned only if
returnSimpleDoF
=
TRUE
.
diffABthe value of pctA
minus pctB
covABthe covariance of pctA
and pctB
; used in
calculating diffABse
.
diffABsethe standard error of pctA
minus pctB
diffABpValuethe p-value associated with the t-test used
for the hypothesis test that diffAB
is zero
dofABdegrees of freedom used in calculating
diffABpValue
The results object is a numeric data frame with the following elements:
estimateAthe mean estimate of groupA
(or the percentage estimate
if achievementLevel
or targetLevel
is specified)
estimateAsethe standard error of estimateA
dofAdegrees of freedom appropriate for a t-test involving meanA
.
This value is returned only if
returnSimpleDoF
=
TRUE
.
estimateBthe mean estimate of groupB
(or the percentage estimate
if achievementLevel
or targetLevel
is specified)
estimateBsethe standard error of estimateB
dofBdegrees of freedom appropriate for a t-test involving meanB
.
This value is returned only if
returnSimpleDoF
=
TRUE
.
diffABthe value of estimateA
minus estimateB
covABthe covariance of estimateA
and estimateB
. Used in
calculating diffABse
.
diffABsethe standard error of diffAB
diffABpValuethe p-value associated with the t-test used
for the hypothesis test that diffAB
is zero.
dofABdegrees of freedom used for the t-test on diffAB
If the gap was in achievement levels or percentiles and more
than one percentile or achievement level is requested,
then an additional column
labeled percentiles or achievementLevel is included
in the results object. When results has a single row and when returnVarEstInputs
is TRUE, the additional elements varEstInputs and
pctVarEstInputs also are returned. These can be used for calculating
covariances with varEstToCov.
the data argument is an edsurvey.data.frame.list
When the data argument is an edsurvey.data.frame.list,
gap returns an S3 object of class gapList.
The results object in the edsurveyResultList is
a data.frame. Each row regards a particular dataset from the
edsurvey.data.frame, and a reference dataset is dictated by
the referenceDataIndex argument.
The percentage object is a data.frame with the following elements:
covsa data frame with a column for each column in the covs
. See previous
section for more details.
...all elements in the percentage
object in the
previous section
diffAAthe difference in pctA
between the reference data
and this dataset. Set to NA
for the
reference dataset.
covAAthe covariance of pctA
in the reference data and
pctA
on this row. Used in
calculating diffAAse
.
diffAAsethe standard error for diffAA
diffAApValuethe p-value associated with the t-test used
for the hypothesis test that diffAA
is zero
diffBBthe difference in pctB
between the reference data
and this dataset. Set to NA
for the
reference dataset.
covBBthe covariance of pctB
in the reference data and
pctB
on this row. Used in
calculating diffAAse
.
diffBBsethe standard error for diffBB
diffBBpValuethe p-value associated with the t-test used
for the hypothesis test that diffBB
is zero
diffABABthe value of diffAB
in the reference dataset
minus the value of diffAB
in this dataset. Set
to NA
for the reference dataset.
covABABthe covariance of diffAB
in the reference data and
diffAB
on this row. Used in
calculating diffABABse
.
diffABABsethe standard error for diffABAB
diffABABpValuethe p-value associated with the t-test used
for the hypothesis test that diffABAB
is zero
The results object is a data.frame with the following elements:
...all elements in the results
object in the
previous section
diffAAthe value of groupA
in the reference dataset minus
the value in this dataset. Set to NA
for the
reference dataset.
covAAthe covariance of meanA
in the reference data and
meanA
on this row. Used in
calculating diffAAse
.
diffAAsethe standard error for diffAA
diffAApValuethe p-value associated with the t-test used
for the hypothesis test that diffAA
is zero
diffBBthe value of groupB
in the reference dataset minus
the value in this dataset. Set to NA
for the
reference dataset.
covBBthe covariance of meanB
in the reference data and
meanB
on this row. Used in
calculating diffBBse
.
diffBBsethe standard error for diffBB
diffBBpValuethe p-value associated with the t-test used
for the hypothesis test that diffBB
is zero
diffABABthe value of diffAB
in the reference dataset
minus the value of diffAB
in this dataset. Set
to NA
for the reference dataset.
covABABthe covariance of diffAB
in the reference data and
diffAB
on this row. Used in
calculating diffABABse
.
diffABABsethe standard error for diffABAB
diffABABpValuethe p-value associated with the t-test used
for the hypothesis test that diffABAB
is zero
sameSurveya logical value indicating if this line uses the same
survey as the reference line. Set to NA
for the
reference line.