This creates normalised data sets for each coin in the purse. In most respects, this works in a similar way
to normalising on a coin, for which reason please see Normalise.coin()
for most documentation. There is however
a special case in terms of operating on a purse of coins. This is because, when
dealing with time series data, it is often desirable to normalise over the whole panel data set at once
rather than independently for each time point. This makes the resulting index and aggregates comparable
over time. Here, the global
argument controls whether to normalise each coin independently or to normalise
across all data at once. In other respects, this function behaves the same as Normalise.coin()
.
Usage
# S3 method for class 'purse'
Normalise(
x,
dset,
global_specs = NULL,
indiv_specs = NULL,
directions = NULL,
global = TRUE,
write_to = NULL,
...
)
Arguments
- x
A purse object
- dset
The data set to normalise in each coin
- global_specs
Default specifications
- indiv_specs
Individual specifications
- directions
An optional data frame containing the following columns:
iCode
The indicator code, corresponding to the column names of the data setDirection
numeric vector with entries either-1
or1
Ifdirections
is not specified, the directions will be taken from theiMeta
table in the coin, if available.
- global
Logical: if
TRUE
, normalisation is performed "globally" across all coins, by using e.g. the max and min of each indicator in any coin. This effectively makes normalised scores comparable between coins because they are all scaled using the same parameters. Otherwise ifFALSE
, coins are normalised individually.- write_to
Optional character string for naming the data set in each coin. Data will be written to
.$Data[[write_to]]
. Default iswrite_to == "Normalised"
.- ...
arguments passed to or from other methods.
Details
The same specifications are passed to each coin in the purse. This means that each coin is normalised using the same set of specifications and directions. If you need control over individual coins, you will have to normalise coins individually.
Examples
# build example purse
purse <- build_example_purse(up_to = "new_coin", quietly = TRUE)
# normalise raw data set
purse <- Normalise(purse, dset = "Raw", global = TRUE)
#> Written data set to .$Data$Normalised
#> Written data set to .$Data$Normalised
#> Written data set to .$Data$Normalised
#> Written data set to .$Data$Normalised
#> Written data set to .$Data$Normalised