Main function to calculate the distributional impacts for different price shocks and to save the results and the figures.
Usage
calc_di_eu(
data,
update_hbs = F,
shocks,
outputs_path = F,
var = "all",
var_intersec = NULL,
by_country = TRUE,
save = T,
fig = TRUE,
file_name = "D_impact",
file_name_intersec = "DI_impact"
)Arguments
- data
Local
- update_hbs
year to which you want to update the microdata. Include only if you want to update the HBS expenditure data to a year other than the base year. By default, the parameter is F, so skip this step.
- shocks
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_eu()`. You can enter more scenarios by including more columns to the right with all the country codes + the scenario name (e.g. AT_s3, BE_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).
- outputs_path
Local path to the folder where the results will be stored (not included in the package). By default, it creates and saves the results in the outputs folder within your working directory.
- var
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 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_eu()`.If you do not want to calculate distributional impacts per variable indicate `NULL`.
- var_intersec
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).
- by_country
If TRUE (by default) in addition to calculating the general distributional impacts for all the households (EU level), it also calculates the distributional impacts for each country (and for each specified variables).
- save
if TRUE saves the dataframes with the results for the distributional impacts calculated by the function. If FALSE do not save.
- fig
if TRUE (by default) create and save the figures of the distributional impacts calculated by the function. If FALSE do not create neither save.
- file_name
name of the file to save the results of basic distributional impacts, if save TRUE. By default "D_impacts".
- file_name_intersec
name of the file to save the results of the intersectional distributional impacts, if save TRUE. By default "DI_impacts".