### Domain:Income ###
# Dependants - using under 15 years old for the 2022 Italian census
dependants_fields <- c(
'P14',
'P15',
'P16')
dependants_data <- census_data[, dependants_fields, drop = FALSE]
dependants <- rowSums(dependants_data, na.rm=TRUE)
dependants_pct <- (dependants / population_total) * 100.0
names(dependants_pct)[1] <- 'dependants_pct'
# Unemployment
## Calculate total poluation for ages 15-64.
## Note: P101 = total employed people aged 15-64.
## Note: Sum of P17, P18, P19, P20, P21, P22, P23, P24, P25 and P26 is total poluation for ages 15-64.
## Note: to calculate unemployed we use: P101 - total poluation for ages 15-64.
## Note: this unemployed figure might also indicate students not working
population_15to64_fields <- c(
'P17',
'P18',
'P19',
'P20',
'P21',
'P22',
'P23',
'P24',
'P25',
'P26')
population_15to64_data <- census_data[, population_15to64_fields, drop = FALSE]
population_15to64 <- rowSums(population_15to64_data, na.rm=TRUE)
unemployment <- population_15to64 - census_data$P101
unemployment_pct <- (unemployment / population_total) * 100.0
names(unemployment_pct)[1] <- 'unemployment_pct'
# Combine all these indicators into an array for this domain
income_domain_pct <- cbind(dependants_pct,
unemployment_pct)
# Print the first six rows of the data to visually check it looks OK
head(income_domain_pct)
Social Vulnerability Milan - Census Data#
Environment#
R Libraries#
Any required R libraries are imported into the kernal:
Output directory#
Load Data#
Import the csv data#
Ireland census data from: https://www.cso.ie/en/census/census2022/census2022smallareapopulationstatistics
Prepare data#
We only require a subset of the census data for our purposes. We therefore need to extract the relevant data, then combine these to create our vulnerability indicators.
In addition, the raw data is not suitable for use within the vulnerabiltiy assessment. It needs to be normalised based on the number of people/households within each small area. Therefore, the data is converted to percentages based on the total persons/households within each small area.
Supporting data#
Code that uniquely identifies the census area#
Population total#
Households / families total#
Domain data#
Age domain#
Income domain#
Information Access/Use domain#
Local knowledge domain#
Social Network domain data#
Combine all data into one table#
Calculate Z-Score#
The raw data is not suitable for use within the vulnerabiltiy assessment. It needs to be standardised. Therefore, the data is converted to z-scores. Z-scores are:
Calculate the Z-score#
Output the Z-score data#
END