Type: | Package |
Title: | Total Survey Error |
Version: | 0.1.0 |
Maintainer: | Joshua Miller <joshlmiller@msn.com> |
Description: | Calculates total survey error (TSE) for one or more surveys, using common scale-dependent and/or scale-independent metrics. On TSE, see: Weisberg, Herbert (2005, ISBN:0-226-89128-3); Biemer, Paul (2010) <doi:10.1093/poq/nfq058>. |
Note: | Package TSE works directly from the data set – no hand calculations required. Just upload a properly structured data set (see TESTNUMB and its documentation), properly input column names (see examples in the functions documentation), and run your functions. |
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-06-19 12:21:48 UTC; JOSHUA |
Author: | Joshua Miller [aut, cre] |
Repository: | CRAN |
Date/Publication: | 2019-06-20 09:10:03 UTC |
Calculate average mean absolute error (aMAE)
Description
Calculates average mean absolute error (aMAE) for one or more surveys
Usage
AVEMAE(Actuals1 = data.frame(), Observed1 = data.frame(), ...)
Arguments
Actuals1 |
= data from a "gold standard" survey; objects are variable columns from "gold standard" survey that corruspond to variable columns Observed1 |
Observed1 |
= data from survey 1; objects are variable columns from survey 1 that corruspond to variable columns from Actuals1 |
... |
= "gold standard" data/survey # data for additional surveys |
Details
aMAE for survey # => mean value of the MAEs for specified variables in survey # => mean value of MAEs for objects in Observed#=data.frame()
Value
Average mean absolute error (aMAE)
Note
Make sure to properly order inputs, per the example: Actuals1=data.frame() objects and corrusponding Observed1=data.frame() objects must be given in the same order as each other; and ... must be given in numbered pairs of Actuals#, Observed#, and those pairs given in sequence of their #s.
Examples
AVEMAE(Actuals1=data.frame(TESTNUMB$AQ1, TESTNUMB$AQ2),
Observed1=data.frame(TESTNUMB$O1Q1, TESTNUMB$O1Q2),
Actuals2=data.frame(TESTNUMB$AQ1, TESTNUMB$AQ2),
Observed2=data.frame(TESTNUMB$O2Q1, TESTNUMB$O2Q2),
Actuals3=data.frame(TESTNUMB$AQ1, TESTNUMB$AQ2),
Observed3=data.frame(TESTNUMB$O3Q1, TESTNUMB$O3Q2))
Calculate average mean absolute percentage error (aMAPE)
Description
Calculates average mean absolute percentage error (aMAPE) for one or more surveys
Usage
AVEMAPE(Actuals1 = data.frame(), Observed1 = data.frame(), ...)
Arguments
Actuals1 |
= data from a "gold standard" survey; objects are variable columns from "gold standard" survey that corruspond to variable columns Observed1 |
Observed1 |
= data from survey 1; objects are variable columns from survey 1 that corruspond to variable columns from Actuals1 |
... |
= "gold standard" data/survey # data for additional surveys |
Details
aMAPE for survey # => mean value of the MAPEs for specified variables in survey # => mean value of MAPEs for objects in Observed#=data.frame()
Value
Average mean absolute percentage error (aMAPE)
Note
Make sure to properly order inputs, per the example: Actuals1=data.frame() objects and corrusponding Observed1=data.frame() objects must be given in the same order as each other; and ... must be given in numbered pairs of Actuals#, Observed#, and those pairs given in sequence of their #s.
Examples
AVEMAPE(Actuals1=data.frame(TESTNUMB$AQ1, TESTNUMB$AQ2),
Observed1=data.frame(TESTNUMB$O1Q1, TESTNUMB$O1Q2),
Actuals2=data.frame(TESTNUMB$AQ1, TESTNUMB$AQ2),
Observed2=data.frame(TESTNUMB$O2Q1, TESTNUMB$O2Q2),
Actuals3=data.frame(TESTNUMB$AQ1, TESTNUMB$AQ2),
Observed3=data.frame(TESTNUMB$O3Q1, TESTNUMB$O3Q2))
Calculate average mean squared error (aMSE) with bias-variance decomposition
Description
Calculates average mean squared error (aMSE) with bias-variance decomposition for one or more surveys
Usage
AVEMSE(Actuals1 = data.frame(), Observed1 = data.frame(), ...)
Arguments
Actuals1 |
= data from a "gold standard" survey; objects are variable columns from "gold standard" survey that corruspond to variable columns Observed1 |
Observed1 |
= data from survey 1; objects are variable columns from survey 1 that corruspond to variable columns from Actuals1 |
... |
= "gold standard" data/survey # data for additional surveys |
Details
aMSE for survey # => mean value of the MSEs for specified variables in survey # => mean value of MSEs for objects in Observed#=data.frame()
Value
Average mean squared error (aMSE) with bias-variance decomposition
Note
Make sure to properly order inputs, per the example: Actuals1=data.frame() objects and corrusponding Observed1=data.frame() objects must be given in the same order as each other; and ... must be given in numbered pairs of Actuals#, Observed#, and those pairs given in sequence of their #s.
Examples
AVEMSE(Actuals1=data.frame(TESTNUMB$AQ1, TESTNUMB$AQ2),
Observed1=data.frame(TESTNUMB$O1Q1, TESTNUMB$O1Q2),
Actuals2=data.frame(TESTNUMB$AQ1, TESTNUMB$AQ2),
Observed2=data.frame(TESTNUMB$O2Q1, TESTNUMB$O2Q2),
Actuals3=data.frame(TESTNUMB$AQ1, TESTNUMB$AQ2),
Observed3=data.frame(TESTNUMB$O3Q1, TESTNUMB$O3Q2))
Calculate average mean squared logarithmic error (aMSLE)
Description
Calculates average mean squared logarithmic error (aMSLE) for one or more surveys
Usage
AVEMSLE(Actuals1 = data.frame(), Observed1 = data.frame(), ...)
Arguments
Actuals1 |
= data from a "gold standard" survey; objects are variable columns from "gold standard" survey that corruspond to variable columns Observed1 |
Observed1 |
= data from survey 1; objects are variable columns from survey 1 that corruspond to variable columns from Actuals1 |
... |
= "gold standard" data/survey # data for additional surveys |
Details
aMSLE for survey # => mean value of the MSLEs for specified variables in survey # => mean value of MSLEs for objects in Observed#=data.frame()
Value
Average mean squared logarithmic error (aMSLE)
Note
Make sure to properly order inputs, per the example: Actuals1=data.frame() objects and corrusponding Observed1=data.frame() objects must be given in the same order as each other; and ... must be given in numbered pairs of Actuals#, Observed#, and those pairs given in sequence of their #s.
Examples
AVEMSLE(Actuals1=data.frame(TESTNUMB$AQ1, TESTNUMB$AQ2),
Observed1=data.frame(TESTNUMB$O1Q1, TESTNUMB$O1Q2),
Actuals2=data.frame(TESTNUMB$AQ1, TESTNUMB$AQ2),
Observed2=data.frame(TESTNUMB$O2Q1, TESTNUMB$O2Q2),
Actuals3=data.frame(TESTNUMB$AQ1, TESTNUMB$AQ2),
Observed3=data.frame(TESTNUMB$O3Q1, TESTNUMB$O3Q2))
Calculate average relative absolute error (aRAE)
Description
Calculates average relative absolute error (aRAE) for one or more surveys
Usage
AVERAE(Actuals1 = data.frame(), Observed1 = data.frame(), ...)
Arguments
Actuals1 |
= data from a "gold standard" survey; objects are variable columns from "gold standard" survey that corruspond to variable columns Observed1 |
Observed1 |
= data from survey 1; objects are variable columns from survey 1 that corruspond to variable columns from Actuals1 |
... |
= "gold standard" data/survey # data for additional surveys |
Details
aRAE for survey # => mean value of the RAEs for specified variables in survey # => mean value of RAEs for objects in Observed#=data.frame()
Value
Average relative absolute error (aRAE)
Note
Make sure to properly order inputs, per the example: Actuals1=data.frame() objects and corrusponding Observed1=data.frame() objects must be given in the same order as each other; and ... must be given in numbered pairs of Actuals#, Observed#, and those pairs given in sequence of their #s.
Examples
AVERAE(Actuals1=data.frame(TESTNUMB$AQ1, TESTNUMB$AQ2),
Observed1=data.frame(TESTNUMB$O1Q1, TESTNUMB$O1Q2),
Actuals2=data.frame(TESTNUMB$AQ1, TESTNUMB$AQ2),
Observed2=data.frame(TESTNUMB$O2Q1, TESTNUMB$O2Q2),
Actuals3=data.frame(TESTNUMB$AQ1, TESTNUMB$AQ2),
Observed3=data.frame(TESTNUMB$O3Q1, TESTNUMB$O3Q2))
Calculate average root mean squared error (aRMSE)
Description
Calculates average root mean squared error (aRMSE) for one or more surveys
Usage
AVERMSE(Actuals1 = data.frame(), Observed1 = data.frame(), ...)
Arguments
Actuals1 |
= data from a "gold standard" survey; objects are variable columns from "gold standard" survey that corruspond to variable columns Observed1 |
Observed1 |
= data from survey 1; objects are variable columns from survey 1 that corruspond to variable columns from Actuals1 |
... |
= "gold standard" data/survey # data for additional surveys |
Details
aRMSE for survey # => mean value of the RMSEs for specified variables in survey # => mean value of RMSEs for objects in Observed#=data.frame()
Value
Average root mean squared error (aRMSE)
Note
Make sure to properly order inputs, per the example: Actuals1=data.frame() objects and corrusponding Observed1=data.frame() objects must be given in the same order as each other; and ... must be given in numbered pairs of Actuals#, Observed#, and those pairs given in sequence of their #s.
Examples
AVERMSE(Actuals1=data.frame(TESTNUMB$AQ1, TESTNUMB$AQ2),
Observed1=data.frame(TESTNUMB$O1Q1, TESTNUMB$O1Q2),
Actuals2=data.frame(TESTNUMB$AQ1, TESTNUMB$AQ2),
Observed2=data.frame(TESTNUMB$O2Q1, TESTNUMB$O2Q2),
Actuals3=data.frame(TESTNUMB$AQ1, TESTNUMB$AQ2),
Observed3=data.frame(TESTNUMB$O3Q1, TESTNUMB$O3Q2))
Calculate average root mean squared logarithmic error (aRMSLE)
Description
Calculates average root mean squared logarithmic error (aRMSLE) for one or more surveys
Usage
AVERMSLE(Actuals1 = data.frame(), Observed1 = data.frame(), ...)
Arguments
Actuals1 |
= data from a "gold standard" survey; objects are variable columns from "gold standard" survey that corruspond to variable columns Observed1 |
Observed1 |
= data from survey 1; objects are variable columns from survey 1 that corruspond to variable columns from Actuals1 |
... |
= "gold standard" data/survey # data for additional surveys |
Details
aRMSLE for survey # => mean value of the RMSLEs for specified variables in survey # => mean value of RMSLEs for objects in Observed#=data.frame()
Value
Average root mean squared logarithmic error (aRMSLE)
Note
Make sure to properly order inputs, per the example: Actuals1=data.frame() objects and corrusponding Observed1=data.frame() objects must be given in the same order as each other; and ... must be given in numbered pairs of Actuals#, Observed#, and those pairs given in sequence of their #s.
Examples
AVERMSLE(Actuals1=data.frame(TESTNUMB$AQ1, TESTNUMB$AQ2),
Observed1=data.frame(TESTNUMB$O1Q1, TESTNUMB$O1Q2),
Actuals2=data.frame(TESTNUMB$AQ1, TESTNUMB$AQ2),
Observed2=data.frame(TESTNUMB$O2Q1, TESTNUMB$O2Q2),
Actuals3=data.frame(TESTNUMB$AQ1, TESTNUMB$AQ2),
Observed3=data.frame(TESTNUMB$O3Q1, TESTNUMB$O3Q2))
Calculate average root relative squared error (aRRSE)
Description
Calculates average root relative squared error (aRRSE) for one or more surveys
Usage
AVERRSE(Actuals1 = data.frame(), Observed1 = data.frame(), ...)
Arguments
Actuals1 |
= data from a "gold standard" survey; objects are variable columns from "gold standard" survey that corruspond to variable columns Observed1 |
Observed1 |
= data from survey 1; objects are variable columns from survey 1 that corruspond to variable columns from Actuals1 |
... |
= "gold standard" data/survey # data for additional surveys |
Details
aRRSE for survey # => mean value of the RRSEs for specified variables in survey # => mean value of RRSEs for objects in Observed#=data.frame()
Value
Average root relative squared error (aRRSE)
Note
Make sure to properly order inputs, per the example: Actuals1=data.frame() objects and corrusponding Observed1=data.frame() objects must be given in the same order as each other; and ... must be given in numbered pairs of Actuals#, Observed#, and those pairs given in sequence of their #s.
Examples
AVERRSE(Actuals1=data.frame(TESTNUMB$AQ1, TESTNUMB$AQ2),
Observed1=data.frame(TESTNUMB$O1Q1, TESTNUMB$O1Q2),
Actuals2=data.frame(TESTNUMB$AQ1, TESTNUMB$AQ2),
Observed2=data.frame(TESTNUMB$O2Q1, TESTNUMB$O2Q2),
Actuals3=data.frame(TESTNUMB$AQ1, TESTNUMB$AQ2),
Observed3=data.frame(TESTNUMB$O3Q1, TESTNUMB$O3Q2))
Calculate average relative squared error (aRSE)
Description
Calculates average relative squared error (aRSE) for one or more surveys
Usage
AVERSE(Actuals1 = data.frame(), Observed1 = data.frame(), ...)
Arguments
Actuals1 |
= data from a "gold standard" survey; objects are variable columns from "gold standard" survey that corruspond to variable columns Observed1 |
Observed1 |
= data from survey 1; objects are variable columns from survey 1 that corruspond to variable columns from Actuals1 |
... |
= "gold standard" data/survey # data for additional surveys |
Details
aRSE for survey # => mean value of the RSEs for specified variables in survey # => mean value of RSEs for objects in Observed#=data.frame()
Value
Average relative squared error (aRSE)
Note
Make sure to properly order inputs, per the example: Actuals1=data.frame() objects and corrusponding Observed1=data.frame() objects must be given in the same order as each other; and ... must be given in numbered pairs of Actuals#, Observed#, and those pairs given in sequence of their #s.
Examples
AVERSE(Actuals1=data.frame(TESTNUMB$AQ1, TESTNUMB$AQ2),
Observed1=data.frame(TESTNUMB$O1Q1, TESTNUMB$O1Q2),
Actuals2=data.frame(TESTNUMB$AQ1, TESTNUMB$AQ2),
Observed2=data.frame(TESTNUMB$O2Q1, TESTNUMB$O2Q2),
Actuals3=data.frame(TESTNUMB$AQ1, TESTNUMB$AQ2),
Observed3=data.frame(TESTNUMB$O3Q1, TESTNUMB$O3Q2))
Calculate average symmetric mean absolute percentage error (aSMAPE)
Description
Calculates average symmetric mean absolute percentage error (aSMAPE) for one or more surveys
Usage
AVESMAPE(Actuals1 = data.frame(), Observed1 = data.frame(), ...)
Arguments
Actuals1 |
= data from a "gold standard" survey; objects are variable columns from "gold standard" survey that corruspond to variable columns Observed1 |
Observed1 |
= data from survey 1; objects are variable columns from survey 1 that corruspond to variable columns from Actuals1 |
... |
= "gold standard" data/survey # data for additional surveys |
Details
aSMAPE for survey # => mean value of the SMAPEs for specified variables in survey # => mean value of SMAPEs for objects in Observed#=data.frame()
Value
Average symmetric mean absolute percentage error (aSMAPE)
Note
Make sure to properly order inputs, per the example: Actuals1=data.frame() objects and corrusponding Observed1=data.frame() objects must be given in the same order as each other; and ... must be given in numbered pairs of Actuals#, Observed#, and those pairs given in sequence of their #s.
Examples
AVESMAPE(Actuals1=data.frame(TESTNUMB$AQ1, TESTNUMB$AQ2),
Observed1=data.frame(TESTNUMB$O1Q1, TESTNUMB$O1Q2),
Actuals2=data.frame(TESTNUMB$AQ1, TESTNUMB$AQ2),
Observed2=data.frame(TESTNUMB$O2Q1, TESTNUMB$O2Q2),
Actuals3=data.frame(TESTNUMB$AQ1, TESTNUMB$AQ2),
Observed3=data.frame(TESTNUMB$O3Q1, TESTNUMB$O3Q2))
Calculate full scale-dependent statistics
Description
Calculates full scale-dependent statistics for one or more surveys
Usage
FULLSD(Actuals1 = data.frame(), Observed1 = data.frame(), ...)
Arguments
Actuals1 |
= data from a "gold standard" survey; objects are variable columns from "gold standard" survey that corruspond to variable columns Observed1 |
Observed1 |
= data from survey 1; objects are variable columns from survey 1 that corruspond to variable columns from Actuals1 |
... |
= "gold standard" data/survey # data for additional surveys |
Value
Full scale-dependent statistics
Note
Make sure to properly order inputs, per the example: Actuals1=data.frame() objects and corrusponding Observed1=data.frame() objects must be given in the same order as each other; and ... must be given in numbered pairs of Actuals#, Observed#, and those pairs given in sequence of their #s.
Examples
FULLSD(Actuals1=data.frame(TESTNUMB$AQ1, TESTNUMB$AQ2),
Observed1=data.frame(TESTNUMB$O1Q1, TESTNUMB$O1Q2),
Actuals2=data.frame(TESTNUMB$AQ1, TESTNUMB$AQ2),
Observed2=data.frame(TESTNUMB$O2Q1, TESTNUMB$O2Q2),
Actuals3=data.frame(TESTNUMB$AQ1, TESTNUMB$AQ2),
Observed3=data.frame(TESTNUMB$O3Q1, TESTNUMB$O3Q2))
Calculate full scale-independent statistics
Description
Calculates full scale-independent statistics for one or more surveys
Usage
FULLSI(Actuals1 = data.frame(), Observed1 = data.frame(), ...)
Arguments
Actuals1 |
= data from a "gold standard" survey; objects are variable columns from "gold standard" survey that corruspond to variable columns Observed1 |
Observed1 |
= data from survey 1; objects are variable columns from survey 1 that corruspond to variable columns from Actuals1 |
... |
= "gold standard" data/survey # data for additional surveys |
Value
Full scale-independent statistics
Note
Make sure to properly order inputs, per the example: Actuals1=data.frame() objects and corrusponding Observed1=data.frame() objects must be given in the same order as each other; and ... must be given in numbered pairs of Actuals#, Observed#, and those pairs given in sequence of their #s.
Examples
FULLSI(Actuals1=data.frame(TESTNUMB$AQ1, TESTNUMB$AQ2),
Observed1=data.frame(TESTNUMB$O1Q1, TESTNUMB$O1Q2),
Actuals2=data.frame(TESTNUMB$AQ1, TESTNUMB$AQ2),
Observed2=data.frame(TESTNUMB$O2Q1, TESTNUMB$O2Q2),
Actuals3=data.frame(TESTNUMB$AQ1, TESTNUMB$AQ2),
Observed3=data.frame(TESTNUMB$O3Q1, TESTNUMB$O3Q2))
A data set created by merging four smaller data sets. Three of those smaller data sets are data from three surveys (O1, O2, O3); the other is data from a "gold standard" survey (A1). All four smaller data sets consist of the same three variables (Q1, Q2, Q3): responses to the same three questions, asked by each survey from the same 10 respondents (ID), along the same 1-99 response scale.
Description
A data set created by merging four smaller data sets. Three of those smaller data sets are data from three surveys (O1, O2, O3); the other is data from a "gold standard" survey (A1). All four smaller data sets consist of the same three variables (Q1, Q2, Q3): responses to the same three questions, asked by each survey from the same 10 respondents (ID), along the same 1-99 response scale.
Usage
TESTNUMB
Format
A data frame with 10 rows and 13 variables
- ID, AQ1, AQ2, AQ3, O1Q1, O1Q2, O1Q3, O2Q1, O2Q2, O2Q3, O3Q1, O3Q2, O3Q3
sets of three variables from each of four surveys, merged together
Source
Example data generated by author