Isolation01
This study examines changes in time allocation across activities from 2006 to 2021, focusing on relationships such as being alone, with family, colleagues, or others. The findings show an increase in time spent alone and a decline in interactions with others, particularly non-family members. These trends reflect societal changes like individualism, digitalization, and shifting work-life dynamics. The analysis highlights that secondary activities, such as work, are increasingly done alone, while leisure activities show a sharp decline in interactions outside the family. These results reveal the growing impact of modern lifestyles on social connections and individual behaviors.
Social Interactions, Lifestyle Changes, Visualization, R language
Introduction
Understanding how people spend their time and with whom provides valuable insights into social behaviors, lifestyle changes, and societal trends. By analyzing the time spent on various activities across different years and relationships (e.g., alone, with family, with colleagues, or with others), we can observe significant patterns that reflect changes in social connectivity and individual lifestyles.
This analysis focuses on four types of activities:
Primary Activities: Basic physiological activities necessary for survival.
Primary Activities (Excluding Sleep): Essential activities excluding sleep, such as eating and personal care.
Secondary Activities: Obligatory activities such as work, school, and housework.
Tertiary Activities: Leisure and free-time activities.
The data spans from 2006 to 2021 and examines how these activities are distributed across different relational contexts: being alone, with family, with colleagues, or with other people. The trends over time reveal a gradual increase in activities performed alone, alongside a decrease in activities involving others, particularly colleagues and other social connections. These changes may indicate broader societal phenomena, such as increasing individualism, work-life transformations, and digitalization.
Objective
The goal of this analysis is to:
Identify trends in activity patterns by year and relationship context.
Understand the distribution of time spent across different activities.
Explore how societal factors like demographic shifts, family structures, and technological changes impact social behaviors.
Methodology
The analysis uses data from a CSV file (SocialLife2006_2021.csv) containing information about activities, relationships, and time allocation. The data was taken from the website ‘estat’, and the author has aggregated the data for four periods’ data. The R programming language and relevant libraries (dplyr, plotly, etc.) are used to:
Filter and prepare the data for analysis.
Visualize trends with interactive graphs.
Interpret the results to identify meaningful patterns and implications.
Figures
Interpretation of Cross-Tabulation
1. Trends in Activities by Relationships Over the Years
From 2006 to 2021, “Primary Activity_Alone” (activities done alone) has gradually increased, reaching its peak of 541 minutes in 2021.
In contrast, “Primary Activity_WithFamily” (activities done with family) has consistently shown a decreasing trend, recording its lowest value of 86 minutes in 2021.
Additionally, activities involving “WithColleague” (colleagues) and “WithOthers” (other people) have generally declined over time. These changes are thought to reflect increased social isolation and changes in lifestyle patterns.
2. Cross-Analysis of “Year” and “Relationships” by Activity
Primary Activity (Basic Physiological Activities):
“Primary Activity_Alone” occupies the largest share of time and has been increasing year by year. On the other hand, “WithFamily” and “WithColleague” have been decreasing, while “WithOthers” shows the smallest values (2006: 6 minutes → 2021: 4 minutes).
Primary Activity (Excluding Sleep):
Even when excluding sleep, activities done alone (“Alone”) occupy the most time, showing an increasing trend, reaching 69 minutes in 2021.
Activities done with family (“WithFamily”) have remained relatively stable, while activities with colleagues (“WithColleague”) and others (“WithOthers”) have decreased year by year.
Secondary Activity (Work, School, Housework, and Other Obligatory Activities):
Since these are obligatory activities, “Secondary Activity_Alone” occupies the most time overall, particularly increasing to 126 minutes in 2021.
“WithFamily” and “WithColleague” maintain a certain proportion of time, but “WithOthers” is very minimal and has further decreased from 14 minutes in 2006 to 8 minutes in 2021.
This decline reflects a weakening of interpersonal relationships outside of the family and workplace.
Tertiary Activity (Leisure Activities in Free Time):
Activities done alone (“Alone”) have been increasing year by year (2006: 142 minutes → 2021: 171 minutes).
Both “WithFamily” and “WithColleague” show a decreasing trend, while “WithOthers” has significantly declined (2006: 49 minutes → 2021: 24 minutes).
3. Characteristics of Activity Distribution by Relationships
Alone (By Oneself):
Across all activities, time spent alone is the highest.
This time has been increasing year by year, indicating a growth in individual time.
WithFamily (With Family):
Time spent with family shows an overall decreasing trend.
Particularly in “Secondary Activity,” time spent with family has decreased, but in “Tertiary Activity,” it still holds a certain proportion.
WithColleague (With Colleagues):
Time spent with colleagues has been decreasing year by year.
The decline is particularly noticeable in “Primary Activity” and “Secondary Activity.”
WithOthers (With Other People):
Time spent with other people is very minimal and has been decreasing year by year.
The decline is especially pronounced in “Tertiary Activity,” dropping significantly from 49 minutes in 2006 to 24 minutes in 2021.
4. Overall Interpretation of Yearly Trends
As a trend in time allocation, activities done alone (“Alone”) have been increasing year by year, while activities done with family and others have been decreasing.
The decline in “WithColleague” and “WithOthers” is particularly notable, suggesting a weakening of social connections.
This data is thought to reflect societal changes such as aging populations, nuclear family structures, work-life reforms, and changes in communication driven by digitalization.
クロス集計の解釈
1. 年ごとの「人との関係」による活動の傾向
2006年から2021年にかけて、「
1次活動_Alone」(一人で行う活動)は徐々に増加しており、特に2021年には541分と最高値を記録している。対照的に、「
1次活動_WithFamily」(家族と行う活動)は一貫して減少傾向にあり、2021年には86分と最低値を記録している。また、「
WithColleague」(同僚)や「WithOthers」(その他の人)との活動は全体的に減少している。これらの変化は、社会的孤立の増加や生活様式の変化を反映していると考えられる。
2. 活動別の「年」と「人との関係」のクロス分析
1次活動(基本的な生理的活動):- 「
1次活動_Alone」が最も多くの時間を占め、年々増加している。一方、「WithFamily」や「WithColleague」は減少傾向にあり、「WithOthers」はさらに少なくなっている(2006年: 6分 → 2021年: 4分)。
- 「
1次活動(睡眠を除く):睡眠を除いた場合でも、一人で行う活動(
Alone)が最も多い。2021年には69分と増加傾向にある。家族と行う活動(
WithFamily)は比較的安定しているが、同僚(WithColleague)やその他の人(WithOthers)との活動は年々減少している。
2次活動(仕事、学業、家事など、義務的な性格を持つ活動):義務的な活動であるため、全体的に「
2次活動_Alone」が最も多い時間を占めている。特に2021年には126分と増加している。「
WithFamily」や「WithColleague」も一定の割合を保っているが、「WithOthers」は非常に少なく、2006年から2021年にかけてさらに減少している(14分 → 8分)。この減少は、家庭や職場以外の対人関係の希薄化を反映していると考えられる。
3次活動(自由時間の余暇活動):一人で行う活動(
Alone)が年々増加している(2006年: 142分 → 2021年: 171分)。「
WithFamily」や「WithColleague」は減少傾向にあり、「WithOthers」は特に顕著に減少している(2006年: 49分 → 2021年: 24分)。
3. 人間関係別の活動配分の特徴
Alone(一人で):すべての活動において、一人で行う時間が最も多い。
時間は年々増加しており、個人時間が増えていることがうかがえる。
WithFamily(家族と):家族との活動時間は全体的に減少傾向にある。
特に「
2次活動」で家族との時間が減少しているが、「3次活動」では依然として一定の割合を占めている。
WithColleague(同僚と):同僚との活動時間は年々減少している。
特に「
1次活動」や「2次活動」でその減少が顕著である。
WithOthers(その他の人と):その他の人との活動時間は非常に少なく、年々減少している。
「
3次活動」では特に顕著であり、2006年の49分から2021年の24分へと大きく減少している。
4. 年次トレンドの全体的な解釈
時間配分の傾向として、「一人で行う活動(
Alone)」が年々増加している一方、「家族や他人と行う活動」は減少している。特に「
WithColleague」や「WithOthers」の減少が顕著であり、社会的なつながりが弱まっている可能性がある。このデータは、少子高齢化や核家族化、働き方改革、デジタル化によるコミュニケーションの変化などの社会的背景を反映していると考えられる。
Full Code
# 1. Load Libraries
library(readr)
library(dplyr)
library(RColorBrewer)
library(plotly)
# 2. Load Data
df <- read_csv("https://takafumikubota.jp/isolation/SocialLife2006_2021.csv")
# 3. Set Filtering Conditions and Activity Labels
day_filter <- "1_WholeWeek"
sex_filter <- "0_Total"
work_filter <- "0_Total"
age_filter <- "00_Total"
activity_primary <- "Primary Activity"
activity_primary_no_sleep <- "Primary Activity (Excluding Sleep)"
activity_secondary <- "Secondary Activity"
activity_tertiary <- "Tertiary Activity"
activity_list <- c(activity_primary, activity_primary_no_sleep, activity_secondary, activity_tertiary)
title_primary <- "Average Time Spent on Activities for Person Being Together (Primary Activity)"
title_primary_no_sleep <- "Average Time Spent on Activities for Person Being Together (Primary Activity Excluding Sleep)"
title_secondary <- "Average Time Spent on Activities for Person Being Together (Secondary Activity)"
title_tertiary <- "Average Time Spent on Activities for Person Being Together (Tertiary Activity)"
title_list <- c(title_primary, title_primary_no_sleep, title_secondary, title_tertiary)
# 4. Set Color Palette
colors <- brewer.pal(4, "Spectral")
# 5. Select Activity to Display
index <- 1 #In the following, this section is compared from 1 to 4, i.e. including the first(excluding sleep), the second and third.
activity_selected <- activity_list[index]
title_selected <- title_list[index]
# 6. Filter and Reshape Data
df_filtered <- df %>%
filter(day == day_filter, sex == sex_filter, work == work_filter, age == age_filter, act == activity_selected) %>%
select(people, year, value)
df_wide <- df_filtered %>%
mutate(
category = case_when(
people == "1_Alone" ~ "Alone",
people == "2_WithFamily" ~ "WithFamily",
people == "3_WithColleagues" ~ "WithColleague",
people == "4_WithOthers" ~ "WithOthers",
TRUE ~ NA_character_
)
) %>%
select(year, category, value) %>%
pivot_wider(names_from = category, values_from = value)
# 7. Create Graph
fig <- plot_ly(
df_wide,
x = ~year,
y = ~Alone,
type = 'scatter',
mode = 'lines+markers',
name = 'Alone',
line = list(color = colors[1]),
marker = list(color = colors[1])
)
fig <- fig %>%
add_trace(
y = ~WithFamily,
name = 'WithFamily',
type = 'scatter',
mode = 'lines+markers',
line = list(color = colors[2]),
marker = list(color = colors[2])
) %>%
add_trace(
y = ~WithColleague,
name = 'WithColleague',
type = 'scatter',
mode = 'lines+markers',
line = list(color = colors[3]),
marker = list(color = colors[3])
) %>%
add_trace(
y = ~WithOthers,
name = 'WithOthers',
type = 'scatter',
mode = 'lines+markers',
line = list(color = colors[4]),
marker = list(color = colors[4])
)
# 8. Configure Layout
fig <- fig %>%
layout(
title = title_selected,
xaxis = list(
title = "Year",
tickvals = c(2006, 2011, 2016, 2021),
ticktext = c("2006 (H18)", "2011 (H23)", "2016 (H28)", "2021 (R03)")
),
yaxis = list(
title = "Average Time Spent (min)"
)
)
# 9. Display Graph
figCode Explanation
1. Load Libraries
The script loads the required libraries:
readr: For loading the CSV file.dplyr: For data manipulation.RColorBrewer: For creating a color palette.plotly: For creating an interactive plot.
2. Load Data
The dataset SocialLife2006_2021.csv is loaded into a data frame df using read_csv().
3. Set Filtering Conditions and Activity Labels
The filtering conditions (day, sex, work, age) are defined. Activity types (Primary Activity, etc.) and their corresponding graph titles are stored in separate lists (activity_list and title_list).
4. Set Color Palette
A set of 4 colors is selected from the Spectral palette using RColorBrewer.
5. Select Activity to Display
The script selects a specific activity (in this case, the first one, Primary Activity) and its corresponding title.
6. Filter and Reshape Data
The data is filtered based on the specified conditions.
A new column
categoryis created to translatepeopleinto more descriptive English names (e.g.,1_Alone→Alone).The data is reshaped into a wide format where categories (
Alone,WithFamily, etc.) become columns.
7. Create Graph
A line graph is created for
Aloneactivities withplot_ly.Additional traces are added for
WithFamily,WithColleague, andWithOthersusingadd_trace.
8. Configure Layout
The graph’s title is set.
The x-axis is configured to show specific years with labels that include both the Western year and the Japanese era.
The y-axis is labeled as “Average Time Spent (min)”.
9. Display Graph
The interactive plot fig is displayed. It allows the user to explore the data visually.bar
コードの説明
1. ライブラリの読み込み
readr、dplyr、RColorBrewer、plotlyの4つのライブラリを使用している。それぞれ、データの読み込み、操作、カラーパレット設定、インタラクティブグラフ作成に利用される。
2. データの読み込み
CSVファイルSocialLife2006_2021.csvを読み込み、データフレームdfとして保存している。 データの引用元はestatで、著者が4回分のデータを集約した。 estat(社会生活基本調査)
3. フィルタリング条件と活動の設定
フィルタリング条件(曜日、性別、仕事、年齢)を変数に設定し、活動カテゴリ(1次活動、2次活動など)とその対応タイトルをリストとして保存している。
4. カラーパレットの設定
RColorBrewerのSpectralパレットを使い、4色のカラーパレットを定義している。この色はグラフの各線の色に使用される。
5. 表示する活動の設定
リストact.lとtitle.lから、1つの活動(1次活動)を選択して変数act.thisとtitle.thisに保存している。
6. データのフィルタリングと整形
指定条件でデータをフィルタリングし、必要な列のみを抽出した後、people列を英語化して新たにcategory列を作成している。さらに、pivot_widerを使ってワイド形式に変換し、各カテゴリが列として扱える形にしている。
7. グラフ作成
plot_lyを使い、1人で行う活動(Alone)のデータを折れ線グラフとして作成。次に、家族(WithFamily)、同僚(WithColleague)、その他の人(WithOthers)のデータをadd_traceで追加し、複数線を含むグラフを構築している。
8. レイアウト設定
グラフのタイトルやx軸の表示年(西暦と元号)、y軸のタイトルを設定している。
9. グラフ表示
作成したインタラクティブなグラフオブジェクトfigisoを表示している。これにより、ユーザーはグラフを操作してデータを視覚的に分析できる。