compute_score {globaltrends}R Documentation

Compute keyword-country search score

Description

The function computes search scores for object keywords. Search volumes for control and object batches are mapped to the same base. Next, search volumes for object batches are divided by the sum of search volumes for the respective control batch. compute_voi computes volume of internationalization (VOI) as global search scores.

Usage

compute_score(object, control = 1, locations = gt.env$countries)

## S3 method for class 'numeric'
compute_score(object, control = 1, locations = gt.env$countries)

## S3 method for class 'list'
compute_score(object, control = 1, locations = gt.env$countries)

compute_voi(object, control = 1)

Arguments

object

Object batch for which the data is downloaded. Object of type numeric or object of type list containing single objects of type numeric.

control

Control batch for which the data is downloaded. Object of type numeric. Defaults to 1.

locations

List of countries or regions for which the data is downloaded. Refers to lists generated in start_db. Defaults to countries.

Details

The search score computation proceeds in four steps. First, the function aggregates all search volumes to monthly data. Then, it applies some optional time series adjustments: seasonally adjusted forecast::seasadj and trend only stats::stl. Next, it follows the procedure outlined by Castelnuovo and Tran (2017, pp. A1-A2) to map control and object data. After the mapping, object search volumes are divided by the sum of control search volumes in the respective control batch. We use the sum of search volumes for a set of control keywords, rather than the search volumes for a single control keyword, to smooth-out variation in the underlying control data.

Castelnuovo, E. & Tran, T. D. 2017. Google It Up! A Google Trends-based Uncertainty index for the United States and Australia. Economics Letters, 161: 149-153.

Value

Message that data has been computed successfully. Data is written to table data_score.

Note

When synonyms were specified through add_synonym, search scores for synonyms are added to the main keyword.

See Also

Examples

## Not run: 
compute_score(
  object = 1,
  control = 1,
  locations = countries
)
compute_voi(
  object = 1,
  control = 1
)
compute_score(
  object = as.list(1:5),
  control = 1,
  locations = countries
)

## End(Not run)


[Package globaltrends version 0.0.14 Index]