Main function to calculate the distributional impacts for different price shocks and to save the results and the figures.
calc_di(
year,
elevate = F,
shocks,
var_impact = "all",
var_intersec = NULL,
save = T,
file_name_impact = "D_impact",
file_name_intersec = "DI_impact",
fig = T
)
year for the simulation. Available time series: 2006-2021.
if TRUE elevate the HBS to national accounting. If FALSE (by default) do not elevate.
a dataset with the price shocks per coicop to be applied. The format of the dataset has to correspond to the predefined one in the package. To save a csv file with the right format to enter the price shocks run `ex_shocks()`. You can enter more scenarios by including more columns to the right (e.g. s3). A price shock greater than 1 indicates a price increase (e.g. 1.1 indicates a 10% increase) and less than 1 indicates a price decrease (e.g. 0.9 indicates a 10% decrease).
variable(s) according to which you want to calculate distributional impacts. If "all" (by default) calculates the distributional impacts for each of the variables specified in the package. If not, you can indicate the variable on the basis of which you want to calculate the distributional impacts. If not, you can indicate a variable or a vector of variables to calculate distributional impacts.If you want to see the variables for which the calculation is available run `available_var_impact()`. If you do not want to calculate distributional impacts per variable indicate `NULL`.
set of variables (2) according to which you want to calculate the intersectional distributional impacts. If "all", it calculates the distributional impacts for each of the combinations of variables specified in the package. If not, you can indicate the set of variables according to which you want to calculate the intersectional distributional impacts. If you wish to see the set of variables for which the calculation is available, run `available_var_intersec()`. To enter a set of variables for the calculation, it must follow the same format as the output of `available_var_intersec()`, i.e. a table whose columns have category_a and category_b as their titles. If you do not want to calculate distributional impacts, indicate NULL (by default).
if TRUE saves the dataframes with the results for the distributional impacts calculated by the function. If FALSE do not save.
name of the file to save the results of basic distributional impacts, if save TRUE. By default "D_impacts".
name of the file to save the results of the intersectional distributional impacts, if save TRUE. By default "DI_impacts".
if TRUE (by default) create and save the figures of the distributional impacts calculated by the function. If FALSE do not create neither save.
a list containing the generated datasets summarising the basic or/and the intersectional distributional impacts per selected variable or set of variables.