bal {quantification} | R Documentation |
The balance approach
Description
bal
implements the balance approach for the quantification of qualitative survey data. A description of the method can be found in Batchelor (1986).
Usage
bal(y.series, survey.up, survey.same, survey.down, forecast.horizon,
first.period = 1, last.period = (length(survey.up) - forecast.horizon),
growth.limit = NA, suppress.warnings = FALSE)
Arguments
y.series |
a numerical vector containing the variable whose change is the subject of the qualitative survey question. If, for example the survey asks participants to assess whether inflation will increase, decrease or stay the same, |
survey.up |
a numerical vector containing the number or the share of survey respondents expecting the variable contained in |
survey.same |
a numerical vector containing the number or the share of survey respondents expecting the variable contained in |
survey.down |
a numerical vector containing the number or the share of survey respondents expecting the variable contained in |
forecast.horizon |
a numeric value defining the number of periods the survey question looks in to the future. If the data in |
first.period |
an optional numeric value indexing the first period for which survey data in |
last.period |
an optional numeric value indexing the last period for which survey data in |
growth.limit |
serves to limit the effect of outliers when expectations are quantified under the assumption that survey respondents form expectations on the percentage change of |
suppress.warnings |
a logical value indicating if runtime warnings shall be displayed ( |
Details
bal
provides two alternative versions of quantified expectations, depending on the assumed expectation formation process of survey respondents. The basic common assumption of the balance method is that survey participants are asked to assess whether variable y
will go up or down or stay the same. Survey respondents can now form expectations on either the absolute or the relative change of y
which differ because the scaling factors (thetas) used to scale the difference between the shares of 'up' and the 'down' respondents are calculated differently in each case. The bal
function calculates both versions.
The survey result vectors survey.up
, survey.down
and survey.same
as well as the variable y.series
must be of the same length and must cover the forecasted horizon (i.e. last.period
+ forecast.horizon
\le
length(survey.up)
).
Data in survey.up
, survey.down
and survey.same
outside the survey period interval [first.period, last.period]
are ignored. Similiarly, y.series
data with a period index greater than last.period
is ignored.
survey.up
, survey.down
and survey.same
need not sum up to 100%
or 1
(which may happen, for example, if the survey has a 'Don't know' answer option).
Value
-
y.e.mean.abs
: a numeric vector containing the quantified mean expectations of the variabley
, assuming that survey respondents form expectations on the absolute change iny
. For all periods which are not in scope of the survey the value isNA
. -
y.e.mean.perc
: a numeric vector containing the quantified mean expectations of the variabley
, assuming that survey respondents form expectations on the relative change iny
. For all periods which are not in scope of the survey the value isNA
. -
delta.y.e.mean.abs
: a numeric vector containing the quantified mean absolute change of the variabley
, assuming that survey respondents form expectations on the absolute change iny
. For all periods which are not in scope of the survey the value isNA
. -
delta.y.e.mean.perc
: a numeric vector containing the quantified mean percentage change of the variabley
, assuming that survey respondents form expectations on the relative change iny
. For all periods which are not in scope of the survey the value isNA
. -
delta.y.e.sd.abs
: a numeric vector containing the standard deviation of the absolute change expectation for variabley
in the population. Assumes that survey respondents form expectations on the absolute change iny
. For all periods which are not in scope of the survey the value isNA
. -
delta.y.e.sd.perc
: a numeric vector containing the standard deviation of the absolute change expectation for variabley
in the population. Assumes that survey respondents form expectations on the relative change iny
. For all periods which are not in scope of the survey the value isNA
. -
theta.abs
: a numeric vector containing the estimated factor which scales the difference between the shares of 'up' respondents and 'down' respondents assuming that survey respondents form expectations on the absolute change in variabley
. For all periods which are not in scope of the survey the value isNA
. -
theta.perc
: a numeric vector containing the estimated factor which scales the difference between the shares of 'up' respondents and 'down' respondents assuming that survey respondents form expectations on the relative change in variabley
. For all periods which are not in scope of the survey the value isNA
. -
nob
: a numeric value showing the number of periods for which expectations have been quantified. -
mae.abs
: a numeric value showing the mean absolute error (MAE) of expectations when survey respondents form expectations on the absolute change in variabley
. -
rmse.abs
: a numeric value showing the root mean squared error (RMSE) of expectations when survey respondents form expectations on the absolute change in variabley
. -
mae.perc
: a numeric value showing the mean absolute error (MAE) of expectations when survey respondents form expectations on the relative change in variabley
. -
rmse.perc
: a numeric value showing the root mean squared error (RMSE) of expectations when survey respondents form expectations on the relative change in variabley
.
Please cite as:
Zuckarelli, Joachim (2014). Quantification of qualitative survey data in R.
R package version 1.0.0. http://CRAN.R-project.org/package=quantification
Author(s)
Joachim Zuckarelli, joachim@zuckarelli.de
References
Batchelor, R.A. (1984), Quantitative vs. qualitative measures of inflation expectations, Oxford Bulletin of Economics and Statistics 48 (2), 99–120.
See Also
quantification-package
, cp
, ra
, ce
Examples
## Data preparation: generate a sample dataset with inflation and survey data
inflation<-c(1.7, 1.9, 2, 1.9, 2, 2.1, 2.1, 2.1, 2.4, 2.3, 2.4)
answer.up<-c(67, 75.1, 76.4, 72.4, 69.7, 49.7, 45.2, 31.6, 14.9, 19.3, 19.2)
answer.same<-c(30.1, 19.6, 19.5, 21.3, 20.1, 33.1, 34.4, 33.5, 44.6, 38.1, 35.3)
answer.down<-c(2.9, 5.3, 4.1, 6.3, 10.2, 17.2, 20.4, 34.9, 40.5, 42.6, 45.5)
## Call bal for quantification
quant.bal<-bal(inflation, answer.up, answer.same, answer.down, first.period=5,
last.period=7, forecast.horizon=4)