Contributions: Tolstokoraya Darya: Describtion of the topic, literature review, introductions, comments
Baturina Elina: 2 variables + boxplot
Sorokina Darya: 2 variables + scatterplot
Suetina Anna: 2 variables + barplot
Describtion of the topic We chose Switzerland as a country for our analysis.
Topic: “Digital contacts within family and workplace and its relation to subjective well-being and social exclusion”
Research question: How digital contacts within family and workplace are related to subjective well-being and social exclusion?
Why Switzerland as a country? - Switzerland is one of the wealthiest countries in the world with $92,463 GDP per Capita (Richest Countries in the world 2024., n.d.). This point is directly connected with people’s work, how their work is organized and with people’s happiness and whether they enjoy their lives, as they probably have really high quality conditions of living in such a wealthy country. We got interested in this fact and thought we might derive interesting data in the ESS portal about Switzerland, happiness level there, work and family related data. We wanted to dive deeper and observe what factors are related to the happiness level of the population of Switzerland. SOURCE:Richest Countries in the world 2024. (n.d.).
SOURCE: Kavetsos, G., & Koutroumpis, P. (2011). Technological affluence and subjective well-being. Journal of Economic Psychology, 32(5), 742–753.
SOURCE: Taylor, S. H., & Bazarova, N. N. (2021). Always Available, Always attached: A relational perspective on the effects of mobile phones and social media on Subjective Well-Being. Journal of Computer-Mediated Communication, 26(4), 187–206.
SOURCE: Hommerich, C., & Tiefenbach, T. (2017). Analyzing the relationship between Social capital and Subjective Well-Being: The mediating role of social affiliation. Journal of Happiness Studies, 19(4), 1091–1114. https://doi.org/10.1007/s10902-017-9859-9
Loading of the packages:
library(dplyr)
##
## Attaching package: 'dplyr'
## The following objects are masked from 'package:stats':
##
## filter, lag
## The following objects are masked from 'package:base':
##
## intersect, setdiff, setequal, union
library(ggplot2)
library(readr)
library (kableExtra)
##
## Attaching package: 'kableExtra'
## The following object is masked from 'package:dplyr':
##
## group_rows
Mode = function(x){
ta = table(x)
tam = max(ta)
if (all(ta == tam))
mod = NA
else
if(is.numeric(x))
mod = as.numeric(names(ta)[ta == tam])
else
mod = names(ta)[ta == tam]
return(mod)
}
Downloading the data from ESS round 10
ESS <- read_csv(file = '/Users/admin/Downloads/ESS10/ESS10.csv')
## Rows: 37611 Columns: 618
## ── Column specification ────────────────────────────────────────────────────────
## Delimiter: ","
## chr (9): name, proddate, cntry, cntbrthd, lnghom1, lnghom2, fbrncntc, mbr...
## dbl (594): essround, edition, idno, dweight, pspwght, pweight, anweight, pr...
## dttm (15): inwds, ainws, ainwe, binwe, cinwe, dinwe, finwe, ginwe, hinwe, i...
##
## ℹ Use `spec()` to retrieve the full column specification for this data.
## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
Selecting the country & needed variables from dataset
ESS10 <- ESS %>%
filter(cntry == "CH") %>%
select(idno, acchome, sclact, closepnt, teamfeel, happy, ttminpnt)
ESS10_1 <- ESS %>%
filter(cntry == "CH") %>%
select(idno, acchome, sclact, closepnt, teamfeel, happy, ttminpnt)
This variables represent the ability of the respondent to access the internet from home
#R represens this variable as numeric, so we assigning factor variable type
ESS10$acchome <- factor(ESS10$acchome, labels = c("Don't have an access", "Have an access"), ordered= F)
class(ESS10$acchome)
## [1] "factor"
summary(ESS10$acchome)
## Don't have an access Have an access
## 104 1419
Plot 1: How many people have access to the internet at home?
ggplot() +
geom_bar(data = ESS10, aes(x = acchome), fill="#00FFFF", col="#0000FF", alpha = 0.5) +
xlab("Having an ability to access the internet: Home") +
ylab("Number of people") +
ggtitle("The level of people`s access to the Internet at home")
Conclusion 1: 1) In Switzerland there are much more people who have an access to the internet at home in comparison to those who don’t have.
This variable represents answers of respondents to the question “Compared to other people of your age, how often would you say you take part in social activities?”.
ESS10_sclact <- ESS10_1 %>%
filter(sclact != 8 & sclact != 7)
#Deleting observations, which are not needed for the analysis: Refusal* & Don't know*
ESS10$sclact[ESS10$sclact == 8 | ESS10$sclact == 7] <- NA
#R represents this variable as numeric, so we assigning ordered factor variable type
ESS10$sclact <- factor(ESS10$sclact, labels = c("Much less than most", "Less than most", "About the same", "More than most", "Much more than most"), ordered= T)
class(ESS10$sclact)
## [1] "ordered" "factor"
summary(ESS10$sclact)
## Much less than most Less than most About the same More than most
## 116 455 691 206
## Much more than most NA's
## 31 24
Plot 2: How often do people participate in social activities (compared to others of same age)?
ESS10 = ESS10 %>%
filter(sclact != 8 )%>%
filter(sclact != 9 )%>%
filter(sclact != 7 )
ESS10$sclact <- factor(ESS10$sclact, labels = c("Much less than most", "Less than most", "About the same", "More than most", "Much more than most"), ordered= F)
ggplot(ESS10 %>%
filter(sclact != "NA")) +
geom_bar(aes(x = sclact), fill="#99FF66", col="#990033", alpha = 0.5) +
xlab("Frequency of participation in social activities") +
ylab("Number of people") +
ggtitle("The degree of participation in social activities (compared to others of same age)")
Conclusion 2: People in Switzerland think that they are take part in social activities in the same level as others of their age. Fewer people tend to think they participate less than others.
This variable represents answers of respondents to the question “Taking everything into consideration, how close do you feel to him/her?”.
ESS10_closepnt <- ESS10_1 %>%
select(idno, closepnt) %>%
filter(closepnt < 6)
#Deleting observations, which are not needed for the analysis: Not applicable* & Refusal* & Don't know*
ESS10$closepnt[ESS10$closepnt == 6 | ESS10$closepnt == 7 | ESS10$closepnt == 8 | ESS10$closepnt == 9] <- NA
#R represents this variable as numeric, so we assigning ordered factor variable type
ESS10$closepnt <- factor(ESS10$closepnt, labels = c("Extremely close", "Very close", "Quite close", "Not very close", "Not at all close"), ordered= T)
class(ESS10$closepnt)
## [1] "ordered" "factor"
summary(ESS10$closepnt)
## Extremely close Very close Quite close Not very close
## 209 432 237 67
## Not at all close NA's
## 23 531
Plot 3: How are people close to their parents?
ggplot(ESS10 %>%
filter(closepnt != "NA")) +
geom_bar(aes(x = closepnt), fill="#CCCCFF", col="#FF7F50", alpha = 0.5) +
xlab("How close to parents") +
ylab("Number of people") +
ggtitle("The degree of closeness to parents")
Conclusion 3: We see that people in Switzerland are more inclined to be close to their parents.
This variable represents answers of respondents to the question “If you work in a team, how much do you feel like part of your team?”
ESS10_teamfeel <- ESS10 %>%
select(teamfeel) %>%
filter(teamfeel <= 10)
class(ESS10_teamfeel$teamfeel)
## [1] "numeric"
summary(ESS10_teamfeel$teamfeel)
## Min. 1st Qu. Median Mean 3rd Qu. Max.
## 0.000 8.000 9.000 8.487 10.000 10.000
Plot 4: Do people in Switzerland feel part of their working team?
ggplot(ESS10_teamfeel)+
geom_histogram( aes(x = teamfeel), binwidth = 1, fill="#367588", col="#6a5acd", alpha = 0.5) +
xlim(c(0, 10))+
xlab("How much people feel like a part of their working team") +
ylab("Number of people") +
scale_x_continuous(breaks= seq(0, 10, by=2))+
geom_vline(aes(xintercept = mean(teamfeel), color = 'mean'), linetype="solid", linewidth = 1) +
geom_vline(aes(xintercept = median(teamfeel), color = 'median'), linetype="solid", linewidth = 1)+
geom_vline(aes(xintercept = Mode(teamfeel), color = 'mode'), linetype="solid", linewidth = 1) +
scale_color_manual(name = "Measurement", values = c(median = "#1e90ff", mean = "#ffb6c1", mode = "#C9F76F"))+
ggtitle("The level of feeling like a part of working team")
## Scale for x is already present.
## Adding another scale for x, which will replace the existing scale.
Conclusion 4: As it can be seen from the graph, people in Switzerland mostly feel like a part of their working team as the histogram is right-skewed. Moreover, all central tendency measurement are higher then 8, which represents high lefel of feeling like a part of a workig team.
This variable represents answers of respondents to the question “Taking all things together, how happy would you say you are?”
ESS10_happy <- ESS10 %>%
select(happy) %>%
filter(happy <= 10)
class(ESS10_happy$happy)
## [1] "numeric"
summary(ESS10_happy$happy)
## Min. 1st Qu. Median Mean 3rd Qu. Max.
## 0.000 8.000 8.000 8.087 9.000 10.000
Plot 5: Do people in Switzerland feel happy?
ggplot(ESS10_happy)+
geom_histogram( aes(x = happy), binwidth = 1, fill="#367588", col="#6a5acd", alpha = 0.5) +
xlim(c(0, 10))+
xlab("How much people feel happy") +
ylab("Number of people") +
scale_x_continuous(breaks= seq(0, 10, by=2))+
geom_vline(aes(xintercept = mean(happy), color = 'mean'), linetype="solid",linewidth = 1) +
geom_vline(aes(xintercept = median(happy), color = 'median'), linetype="solid", linewidth = 1)+
geom_vline(aes(xintercept = Mode(happy), color = 'mode'), linetype="solid",linewidth = 1) +
scale_color_manual(name = "Measurement", values = c(median = "#1e90ff", mean = "#ffb6c1", mode = "#C9F76F"))+
ggtitle("Happines in Switzerland")
## Scale for x is already present.
## Adding another scale for x, which will replace the existing scale.
Conclusion 5: The graph illustrates that, on average, people in Switzerkand feel happy as the histogram is right-skewed and mean, median and mode are located approximately in 8 point, which is much higher than the central point (5).
This variable represents answers of respondents to the question “About how long would it take you to get to where your parents live, on average? Think of the way you would travel and of the time it would take door to door.”
ESS10_ttminpnt <- ESS10 %>%
select(idno, ttminpnt) %>%
filter(ttminpnt != 6666) %>%
filter (ttminpnt != 7777) %>%
filter(ttminpnt != 8888) %>%
filter (ttminpnt != 9999)
class(ESS10_ttminpnt$ttminpnt)
## [1] "numeric"
summary(ESS10_ttminpnt$ttminpnt)
## Min. 1st Qu. Median Mean 3rd Qu. Max.
## 0.0 10.0 30.0 179.6 180.0 4320.0
Plot 6: How long does it takes for people to get to their parents?
ggplot(ESS10_ttminpnt)+
geom_histogram(aes(x = ttminpnt), fill="gray", col="#FF6347", alpha = 0.5) +
xlab("How long does it takes to get to parents, min") +
ylab("Number of people") +
geom_vline(aes(xintercept = mean(ttminpnt), color = 'mean'), linetype="solid",linewidth = 1) +
geom_vline(aes(xintercept = median(ttminpnt), color = 'median'), linetype="solid", linewidth = 1)+
geom_vline(aes(xintercept = Mode(ttminpnt), color = 'mode'), linetype="solid",linewidth = 1) +
scale_color_manual(name = "Measurement", values = c(median = "#1e90ff", mean = "#ffb6c1", mode = "#C9F76F"))+
ggtitle("Time to parents")+
xlim(0, 1500)+
ylim(0, 175)
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
## Warning: Removed 3 rows containing non-finite values (`stat_bin()`).
## Warning: Removed 2 rows containing missing values (`geom_bar()`).
Conclusion 6: On average, it takes 3 hours for people in Switzerland to get to their parents.
v.acchome <- c(NA, Mode(ESS10_1$acchome), NA)
names(v.acchome) <- c("mean", "mode", "median")
v.sclact <- c(NA, Mode(ESS10_sclact$sclact), median(ESS10_sclact$sclact))
names(v.sclact) <- c("mean", "mode", "median")
v.closepnt <- c(NA, Mode(ESS10_closepnt$closepnt), median(ESS10_closepnt$closepnt))
names(v.closepnt) <- c("mean", "mode", "median")
ESS10_teamfeel$teamfeel = as.numeric(as.character(ESS10_teamfeel$teamfeel))
v.teamfeel <- c(mean(ESS10_teamfeel$teamfeel), Mode(ESS10_teamfeel$teamfeel), median(ESS10_teamfeel$teamfeel))
names(v.teamfeel) <- c("mean", "mode", "median")
ESS10_happy$happy = as.numeric(as.character(ESS10_happy$happy))
v.happy <- c(mean(ESS10_happy$happy), Mode(ESS10_happy$happy), median(ESS10_happy$happy))
names(v.happy) <- c("mean", "mode", "median")
v.ttminpnt <- c(mean(ESS10_ttminpnt$ttminpnt), Mode(ESS10_ttminpnt$ttminpnt), median(ESS10_ttminpnt$ttminpnt))
names(v.ttminpnt) <- c("mean", "mode", "median")
tendencymeasures = data.frame(v.acchome, v.sclact, v.closepnt, v.teamfeel, v.happy, v.ttminpnt, stringsAsFactors = FALSE)
kable(tendencymeasures) %>%
kable_styling(bootstrap_options=c("bordered", "responsive","striped"), full_width = FALSE)
| v.acchome | v.sclact | v.closepnt | v.teamfeel | v.happy | v.ttminpnt | |
|---|---|---|---|---|---|---|
| mean | NA | NA | NA | 8.486766 | 8.086725 | 179.5907 |
| mode | 1 | 3 | 2 | 10.000000 | 8.000000 | 10.0000 |
| median | NA | 3 | 2 | 9.000000 | 8.000000 | 30.0000 |
Do people who feel like part of their working team feel happier than those who do not feel like part of their team?
ggplot(ESS10 %>%
filter(happy <=10 & teamfeel <= 10 ), aes(x = teamfeel, y = happy)) +
geom_point( )+
ylab("How happy are you") +
xlab("How much you feel like a team") +
ggtitle("Feeling happy due to feeling like a part of a working team") +
scale_x_continuous(breaks= seq(0, 10, by=2))+
scale_y_continuous(breaks= seq(0, 10, by=2))+
theme_minimal()+
geom_count()
Answer: Looking at the graph, it can be seen that there is a slight connecting between feeling of belonging to the working team and happiness as quite many high points of each scales corresponds with high values and have bigger size (therefore, there is bigger number of occurrences), however, still there are cases where high values of happiness corresponds with low values of feeling a part of a team and vise versa.
Is there a relation between how close a parent and child live and the closeness of their relationship (assessed by the child)?
ESS_boxplot <- full_join(ESS10_ttminpnt, ESS10_closepnt, by = "idno")
ggplot(ESS10 %>%
filter(closepnt != "NA") %>%
filter(ttminpnt != 6666) %>%
filter (ttminpnt != 7777) %>%
filter(ttminpnt != 8888) %>%
filter (ttminpnt != 9999), aes(x=closepnt, y=ttminpnt))+
geom_boxplot(aes(fill = closepnt))+
stat_summary(fun.y = mean, geom = "point", size = 2, col = "orange")+
ylim(0, 500)
## Warning: The `fun.y` argument of `stat_summary()` is deprecated as of ggplot2 3.3.0.
## ℹ Please use the `fun` argument instead.
## This warning is displayed once every 8 hours.
## Call `lifecycle::last_lifecycle_warnings()` to see where this warning was
## generated.
## Warning: Removed 89 rows containing non-finite values (`stat_boxplot()`).
## Warning: Removed 89 rows containing non-finite values (`stat_summary()`).
Answer: We see that the average distance to parents increases with decreasing degree of relationship closeness. Therefore we can conclude that families who live in a longer distance from each other have less clode relationships.
Are people who have access to the internet at home more involved in social activities (compared to others of the same age)?
ggplot(ESS10 %>%
filter(sclact != "NA"), aes(x = sclact, fill = acchome)) +
geom_bar(position="fill")+
coord_flip()+
xlab("Share of population") +
ylab("Нaving an ability to access the internet: Home") +
ggtitle("Participation in social activities due to access to the Internet")
Answer: Looking at the graph, we can see that in
Switzerland a fairly large number (about 80%) of people who have
internet access at home think that they participate in social activities
much less than others their age. Also a large number of people (about
90%) who have internet access at home think that they participate in
social activities much more than others.