#This example is based on the dataset eusilc included in the package
#The FS index is compute without and with breakdown and using an HCR = 0.12
#The step 2-5 are the following (step 1 is the eusilc dataset)
#For more on each step see the ad hoc function included in the package
#Step 2
step2 = fs_transform(eusilc[,4:23], weight = eusilc$DB090, ID = eusilc$ID)
#Step 3 is the definition of the dimension.
#For more about the step see Betti et al. (2018)
dimensions = c(1,1,1,1,2,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5)
#Step 4-5 finding weights
steps4_5 = fs_weight(dimensions, step2 = step2, rho = NULL)
#Step 6 computation of alpha parameter
alpha <- fs_equate(steps4_5 = steps4_5,
weight = eusilc$DB090, HCR = 0.12,
interval = c(1,10))
#Step 7 the FS index without breakdown
fs_results = fs_construct(steps4_5 = steps4_5,
weight = eusilc$DB090, alpha = alpha, breakdown = NULL)
#Step 7 the FS index with breakdown
fs_results = fs_construct(steps4_5 = steps4_5,
weight = eusilc$DB090, alpha = alpha, breakdown = eusilc$db040)
Run the code above in your browser using DataLab