A function used to construct new variables from existing variables.
constructSYB(
data,
origVar1,
origVar2,
newVarName = NA,
constructType = c("share", "growth", "change", "index"),
grFreq = 1,
grType = c("ls", "geo"),
baseYear = 2000
)
A data frame containing both the original data frame and the processed data and also a list indicating whether the construction passed or failed.
The data frame containing the raw variable
The variable name to be used in construction, refer to Details for more information and useage.
The variable name to be used in construction, refer to Details for more information and useage.
The name assigned to the new variable, if missing then .SC/.SH/.GR/.CH will be appended depending on the type of construction
The type of construction, refer to Details for more information.
The frequency for the growth rate to be computed.
The method for the growth to be calculated, currently supports least squares and geometric.
The base year to be used for constructing index.
Currently two types of construction are supported, either share or growth rate computation.
Share can be a share of total or share of another variable depending on whether an additional variable is supplied or not.