3.1. Data transformation
All the regression models were carried out using the “glm”-function from the stats package.
Furthermore age, marital status, household size and origin have been summarized in fewer categories as an analysis with a more fine grained differentiation yield no additional significant differences.
### Prep IVs for logistic regression ####
# Calculate age from birth year
WaveOne$age <- 2016 - WaveOne$SD2
WaveOne$age[WaveOne$age < 16] <- NA
WaveOne$age[WaveOne$age > 74] <- NA
# Define age categories
# No missings
WaveOne$age.cat <- "65 Jahre und mehr"
WaveOne$age.cat[WaveOne$age < 64] <- "25 bis 64 Jahre"
WaveOne$age.cat[WaveOne$age < 25] <- "bis 24 Jahre"
WaveOne$age.cat <- factor(WaveOne$age.cat)
# SD4 marital status into partnership
# No missings
WaveOne$SD4.dic <- "No"
WaveOne$SD4.dic[WaveOne$SD4 == "Verheiratet (oder eingetragene Partnerschaft)"] <- "Yes"
WaveOne$SD4.dic <- factor(WaveOne$SD4.dic)
# SD5 household size
WaveOne$SD5.dic[as.numeric(WaveOne$sd5) < 5] <- "Household (1-4 Persons)"
WaveOne$SD5.dic[as.numeric(WaveOne$sd5) > 4] <- "Household (5+))"
WaveOne$SD5.dic <- factor(WaveOne$SD5.dic)
# SD21 origin
WaveOne$SD21.dic[as.numeric(WaveOne$SD21) > 2] <- "non-EU15"
WaveOne$SD21.dic[as.numeric(WaveOne$SD21) < 3] <- "EU15 with Austria"
WaveOne$SD21.dic <- factor(WaveOne$SD21.dic)