Compute standardise coefficients for contribution per unit
Source:R/step2_constraints.R
compute_stdcoef.Rd
Compute standardise coefficients for contribution per unit for each tag_outcome
.
Arguments
- data_perunit_contrib
A dataframe where contribution per unit for each tag_outcome is stored.
- method
Method to compute the coefficient. So far only
method = 'sd'
is implemented.
Value
A list of outputs:
std_coef
stores the standardization coefficients to scale the contribution per unit for each tag_outcomemethod
returns the method used for the computation
Examples
cpu_selected <- select_perunit(data_perunit_contrib = contrib_per_unit,
tag_food = c('Bread', 'Vegetables', 'Red meat'),
tag_outcome = c('energy', 'protein', 'ghge'))
compute_stdcoef(data_perunit_contrib = cpu_selected)
#> $std_coef
#> tag_outcome std_coef
#> 1 energy 0.2109576
#> 2 protein 12.6767653
#> 3 ghge 145.6722840
#>
#> $method
#> [1] "sd"
#>