Type: | Package |
Title: | Total Survey Error (Independent Samples) |
Version: | 0.1.0 |
Maintainer: | Joshua Miller <joshlmiller@msn.com> |
Description: | Calculates total survey error (TSE) for one or more surveys, using both scale-dependent and scale-independent metrics. Package works directly from the data set, with no hand calculations required: just upload a properly structured data set (see TESTIND and its documentation), properly input column names (see functions documentation), and run your functions. For more on TSE, see: Weisberg, Herbert (2005, ISBN:0-226-89128-3); Biemer, Paul (2010) <doi:10.1093/poq/nfq058>; Biemer, Paul et.al. (2017, ISBN:9781119041672); etc. |
Note: | 'TSEind' is a companion package to 'TSE'. Both calculate TSE for your surveys, but use 'TSEind' if your surveys and the "gold standard" survey have independent samples, and use 'TSE' if your surveys and the "gold standard" survey have paired samples. |
Imports: | stats |
Depends: | R (≥ 3.5) |
License: | GPL-2 | GPL-3 [expanded from: GPL (≥ 2)] |
Encoding: | UTF-8 |
LazyData: | true |
RoxygenNote: | 6.1.1 |
Suggests: | knitr, rmarkdown |
NeedsCompilation: | no |
Packaged: | 2019-07-12 01:45:11 UTC; JOSHUA |
Author: | Joshua Miller [aut, cre] |
Repository: | CRAN |
Date/Publication: | 2019-07-19 09:20:02 UTC |
Full scale-dependent statistics (MAE, MSE, RMSE, MSLE, and RMSLE)
Description
Calculates MAE, MSE, RMSE, MSLE, and RMSLE when Actual# and Survey# have independent samples
Usage
FULLSDi(Actual1, Survey1, ...)
Arguments
Actual1 |
data from a "gold standard" survey; data are assumed to be the "actual" response, without survey error |
Survey1 |
data from another survey, but with survey error; function will calculate MAE, MSE, RMSE, MSLE, and RMSLE for this survey |
... |
used for additional surveys with survey error, survey 2 through survey # |
Value
Matrix with MAE, MSE, RMSE, MSLE, and RMSLE values for survey 1 through survey #
Note
Make sure to properly order inputs, per the example: for each survey, inputs must be paired as Actual#, Survey#, and each pair given in sequential order
Examples
FULLSDi(Actual1=TESTIND$A1, Survey1=TESTIND$S1, Actual2=TESTIND$A1, Survey2=TESTIND$S2,
Actual3=TESTIND$A2, Survey3=TESTIND$S3)
Full scale-independent statistics (MAPE, SMAPE, RAE, RSE, and RRSE)
Description
Calculates MAPE, SMAPE, RAE, RSE, and RRSE when Actual# and Survey# have independent samples
Usage
FULLSIi(Actual1, Survey1, ...)
Arguments
Actual1 |
data from a "gold standard" survey; data are assumed to be the "actual" response, without survey error |
Survey1 |
data from another survey, but with survey error; function will calculate MAPE, SMAPE, RAE, RSE, and RRSE for this survey |
... |
used for additional surveys with survey error, survey 2 through survey # |
Value
Matrix with MAPE, SMAPE, RAE, RSE, and RRSE values for survey 1 through survey #
Note
Make sure to properly order inputs, per the example: for each survey, inputs must be paired as Actual#, Survey#, and each pair given in sequential order
Examples
FULLSIi(Actual1=TESTIND$A1, Survey1=TESTIND$S1, Actual2=TESTIND$A1, Survey2=TESTIND$S2,
Actual3=TESTIND$A2, Survey3=TESTIND$S3)
Mean absolute error (MAE)
Description
Calculates MAE when Actual# and Survey# have independent samples
Usage
MAEi(Actual1, Survey1, ...)
Arguments
Actual1 |
data from a "gold standard" survey; data are assumed to be the "actual" response, without survey error |
Survey1 |
data from another survey, but with survey error; function will calculate MAE for this survey |
... |
used for additional surveys with survey error, survey 2 through survey # |
Value
Matrix with MAE values for survey 1 through survey #
Note
Make sure to properly order inputs, per the example: for each survey, inputs must be paired as Actual#, Survey#, and each pair given in sequential order
Examples
MAEi(Actual1=TESTIND$A1, Survey1=TESTIND$S1, Actual2=TESTIND$A1, Survey2=TESTIND$S2,
Actual3=TESTIND$A2, Survey3=TESTIND$S3)
Mean absolte percentage error (MAPE)
Description
Calculates MAPE when Actual# and Survey# have independent samples
Usage
MAPEi(Actual1, Survey1, ...)
Arguments
Actual1 |
data from a "gold standard" survey; data are assumed to be the "actual" response, without survey error |
Survey1 |
data from another survey, but with survey error; function will calculate MAPE for this survey |
... |
used for additional surveys with survey error, survey 2 through survey # |
Value
Matrix with MAPE values for survey 1 through survey #
Note
Make sure to properly order inputs, per the example: for each survey, inputs must be paired as Actual#, Survey#, and each pair given in sequential order
Examples
MAPEi(Actual1=TESTIND$A1, Survey1=TESTIND$S1, Actual2=TESTIND$A1, Survey2=TESTIND$S2,
Actual3=TESTIND$A2, Survey3=TESTIND$S3)
Mean squared error (MSE) with bias-variance decomposition
Description
Calculates MSE with bias-variance decomposition when Actual# and Survey# have independent samples
Usage
MSEi(Actual1, Survey1, ...)
Arguments
Actual1 |
data from a "gold standard" survey; data are assumed to be the "actual" response, without survey error |
Survey1 |
data from another survey, but with survey error; function will calculate MSE with bias-variance decomposition for this survey |
... |
used for additional surveys with survey error, survey 2 through survey # |
Value
Matrix with MSE, bias^2, and variance values for survey 1 through survey #
Note
Make sure to properly order inputs, per the example: for each survey, inputs must be paired as Actual#, Survey#, and each pair given in sequential order
Examples
MSEi(Actual1=TESTIND$A1, Survey1=TESTIND$S1, Actual2=TESTIND$A1, Survey2=TESTIND$S2,
Actual3=TESTIND$A2, Survey3=TESTIND$S3)
Mean squared logarithmic error (MSLE)
Description
Calculates MSLE when Actual# and Survey# have independent samples
Usage
MSLEi(Actual1, Survey1, ...)
Arguments
Actual1 |
data from a "gold standard" survey; data are assumed to be the "actual" response, without survey error |
Survey1 |
data from another survey, but with survey error; function will calculate MSLE for this survey |
... |
used for additional surveys with survey error, survey 2 through survey # |
Value
Matrix with MSLE values for survey 1 through survey #
Note
Make sure to properly order inputs, per the example: for each survey, inputs must be paired as Actual#, Survey#, and each pair given in sequential order
Examples
MSLEi(Actual1=TESTIND$A1, Survey1=TESTIND$S1, Actual2=TESTIND$A1, Survey2=TESTIND$S2,
Actual3=TESTIND$A2, Survey3=TESTIND$S3)
Relative absolute error (RAE)
Description
Calculates RAE when Actual# and Survey# have independent samples
Usage
RAEi(Actual1, Survey1, ...)
Arguments
Actual1 |
data from a "gold standard" survey; data are assumed to be the "actual" response, without survey error |
Survey1 |
data from another survey, but with survey error; function will calculate RAE for this survey |
... |
used for additional surveys with survey error, survey 2 through survey # |
Value
Matrix with RAE values for survey 1 through survey #
Note
Make sure to properly order inputs, per the example: for each survey, inputs must be paired as Actual#, Survey#, and each pair given in sequential order
Examples
RAEi(Actual1=TESTIND$A1, Survey1=TESTIND$S1, Actual2=TESTIND$A1, Survey2=TESTIND$S2,
Actual3=TESTIND$A2, Survey3=TESTIND$S3)
Root mean squared error (MAE)
Description
Calculates RMSE when Actual# and Survey# have independent samples
Usage
RMSEi(Actual1, Survey1, ...)
Arguments
Actual1 |
data from a "gold standard" survey; data are assumed to be the "actual" response, without survey error |
Survey1 |
data from another survey, but with survey error; function will calculate RMSE for this survey |
... |
used for additional surveys with survey error, survey 2 through survey # |
Value
Matrix with RMSE values for survey 1 through survey #
Note
Make sure to properly order inputs, per the example: for each survey, inputs must be paired as Actual#, Survey#, and each pair given in sequential order
Examples
RMSEi(Actual1=TESTIND$A1, Survey1=TESTIND$S1, Actual2=TESTIND$A1, Survey2=TESTIND$S2,
Actual3=TESTIND$A2, Survey3=TESTIND$S3)
Root mean squared logarithmic error (RMSLE)
Description
Calculates RMSLE when Actual# and Survey# have independent samples
Usage
RMSLEi(Actual1, Survey1, ...)
Arguments
Actual1 |
data from a "gold standard" survey; data are assumed to be the "actual" response, without survey error |
Survey1 |
data from another survey, but with survey error; function will calculate RMSLE for this survey |
... |
used for additional surveys with survey error, survey 2 through survey # |
Value
Matrix with RMSLE values for survey 1 through survey #
Note
Make sure to properly order inputs, per the example: for each survey, inputs must be paired as Actual#, Survey#, and each pair given in sequential order
Examples
RMSLEi(Actual1=TESTIND$A1, Survey1=TESTIND$S1, Actual2=TESTIND$A1, Survey2=TESTIND$S2,
Actual3=TESTIND$A2, Survey3=TESTIND$S3)
Root relative squared error (RRSE)
Description
Calculates RRSE when Actual# and Survey# have independent samples
Usage
RRSEi(Actual1, Survey1, ...)
Arguments
Actual1 |
data from a "gold standard" survey; data are assumed to be the "actual" response, without survey error |
Survey1 |
data from another survey, but with survey error; function will calculate RRSE for this survey |
... |
used for additional surveys with survey error, survey 2 through survey # |
Value
Matrix with RRSE values for survey 1 through survey #
Note
Make sure to properly order inputs, per the example: for each survey, inputs must be paired as Actual#, Survey#, and each pair given in sequential order
Examples
RRSEi(Actual1=TESTIND$A1, Survey1=TESTIND$S1, Actual2=TESTIND$A1, Survey2=TESTIND$S2,
Actual3=TESTIND$A2, Survey3=TESTIND$S3)
Relative squared error (RSE)
Description
Calculates RSE when Actual# and Survey# have independent samples
Usage
RSEi(Actual1, Survey1, ...)
Arguments
Actual1 |
data from a "gold standard" survey; data are assumed to be the "actual" response, without survey error |
Survey1 |
data from another survey, but with survey error; function will calculate RSE for this survey |
... |
used for additional surveys with survey error, survey 2 through survey # |
Value
Matrix with RSE values for survey 1 through survey #
Note
Make sure to properly order inputs, per the example: for each survey, inputs must be paired as Actual#, Survey#, and each pair given in sequential order
Examples
RSEi(Actual1=TESTIND$A1, Survey1=TESTIND$S1, Actual2=TESTIND$A1, Survey2=TESTIND$S2,
Actual3=TESTIND$A2, Survey3=TESTIND$S3)
Symmetric mean absolte percentage error (SMAPE)
Description
Calculates SMAPE when Actual# and Survey# have independent samples
Usage
SMAPEi(Actual1, Survey1, ...)
Arguments
Actual1 |
data from a "gold standard" survey; data are assumed to be the "actual" response, without survey error |
Survey1 |
data from another survey, but with survey error; function will calculate SMAPE for this survey |
... |
used for additional surveys with survey error, survey 2 through survey # |
Value
Matrix with SMAPE values for survey 1 through survey #
Note
Make sure to properly order inputs, per the example: for each survey, inputs must be paired as Actual#, Survey#, and each pair given in sequential order
Examples
SMAPEi(Actual1=TESTIND$A1, Survey1=TESTIND$S1, Actual2=TESTIND$A1, Survey2=TESTIND$S2,
Actual3=TESTIND$A2, Survey3=TESTIND$S3)
A data set created by merging 1) data from a "gold standard" survey and 2) data from other surveys of the same universe. Data from the "gold standard" survey are assumed to be the survey universe's "actual" response; data from the other surveys have survey error which the functions in 'TSEind' can calculate. Data are organized by survey (columns) and survey question (rows), and their values are the aggregate, "topline" responses to the survey questions which can range from 1 to 99 (the scale used by each survey question).
Description
A data set created by merging 1) data from a "gold standard" survey and 2) data from other surveys of the same universe. Data from the "gold standard" survey are assumed to be the survey universe's "actual" response; data from the other surveys have survey error which the functions in 'TSEind' can calculate. Data are organized by survey (columns) and survey question (rows), and their values are the aggregate, "topline" responses to the survey questions which can range from 1 to 99 (the scale used by each survey question).
Usage
TESTIND
Format
A data frame with 10 rows and 6 variables
- Q
survey questions, numbered 1 through 10
- A1, A2
data from "gold standard" survey; A1 is the "actual" data for all 10 survey questions, A2 is the "actual" data for all survey questions except Q2 (in function examples, A2 is paired with S3 which is missing data for Q2
- S1, S2, S3
data from other surveys; S3 is missing data for Q2
Source
Example data generated by author