error_calc: calculate the prediction error of a pollyvote prediction.

Description Usage Arguments Value See Also Examples

View source: R/error_calc.R

Description

calculate the prediction error of a pollyvote prediction.

Usage

1
error_calc(object, method, ...)

Arguments

object

[pollyvote(1)]
pollyvote object to get the error calculation from.

method

[character(1)]
method name of the error calculation function of object to use.

...

additional arguments to the error calculation function.

Value

a data frame containing the result of the error calculation

See Also

Other predict: error_calc.pollyvote, predict.pollyvote

Examples

1
2
3
4
5
6
7
8
pv = create_pollyvote(perm_countries = "D")
data("polls_individual")
pv = add_data(pv, newdata = polls_individual, country = "D", region = "national", 
              source_type = "poll", election = "BTW")
data("election_result")
pv = add_election_result(pv, "BTW 2013", election_result, date = "2013-09-22")
error_calc_pred <- error_calc(pv, "prediction_election", 
                              prediction = "pollyvote", election = "BTW 2013")             

pollyvote/pollyvoter documentation built on April 4, 2018, 8:18 p.m.