Migration Aspiration and Crisis in Redditors’ Trajectory

https://cyuhat.github.io/mobility_intention_reddit

Hategekimana Vestin

University of Geneva

Research question

  • Central question:
    • What is the impact of migration intention and Covid-19 on migration to Switzerland?

Research question

  • Central question:
    • What is the impact of migration intention and Covid-19 on migration to Switzerland?

Migration intention

Let’s imagine an individual…

Migration intention

… that want to move to Switzerland

Migration intention

Does the intention to move vary over time?

Migration intention isn’t always predictible

2 years after:

  • 70% indeed emigrated (Wanner, 2021)

  • 24% - 36% indeed emigrated (Van Dalen & Henkens, 2008)

Factors (Bernard & Vidal, 2023; Kulu & Milewski, 2007):

  • Job opportunities

  • Birth

  • Social network

Research context

Many factors have an impact in the mobility intention:

  • Demographic scope (Findlay et al., 2015):
    • Age groups, gender, family statuses, migrant groups, …
  • Life course (Horowitz & Entwisle, 2021).:
    • Life events (e.g., education, job loss, birth, divorce)
    • Linked lives (family/social networks influencing decisions)
    • Historical time/place (contextual factors like economic crisis).
    • Individual agency (decision-making processes)
    • Timing of lives (age-related migration patterns)

Reddit

https://backlinko.com/reddit-users

What is it?

  • Social media

  • Founded in 2005

  • Community based

Statistics

  • 97.2 million daily active users

  • +100’000 active subreddits

Adavantages of Reddit

  • Longitudinal Tracking:
    • Enables analysis of how personal circumstances, policies, and crises (e.g., pandemic) dynamically shape migration decisions.
  • Ethical and accessibility benefits:
    • Reddit’s anonymity and accessible API for researchers reduce ethical concerns compared to traditional methods (e.g., surveys).
  • Novel use of non-official APIs (Application Programming Interface):
    • The PullPush API facilitates comprehensive data collection over extended periods.

Key objectives

  • Primary goal:
    • Map the temporal progression of migration intention using data from Reddit’s r/AskSwitzerland.
    • Highlight the impact of Covid-19 in migration intention
  • Side objectives:
    • Show that Reddit data are valuable for migration studies
    • Show that local SLMs (Small Language Models) are valuable tools for data extraction

Method

Data Source: Reddit and r/AskSwitzerland

Data Source: Reddit and r/AskSwitzerland

The subreddit r/AskSwitzerland is specifically targeted, as it is a hub for users seeking information about living in Switzerland and expressing relocation intentions.

The full workflow

Data collection

  • Three-stage approach:
    1. Initial collection (2018–2022):
      • Posts containing keywords like “Relocation,” “Migration,” “Mobility,” or “Living in Switzerland” are gathered.
    2. Filtering:
      • Posts are filtered to retain only those expressing genuine intent to move to Switzerland.
    3. Saving user name:
      • A list of user name is saved in a database.

Data extraction

  • Three-stage approach:
    1. Users’ comment history (2nd data collection):
    • Collecting user’s comment history 2 years after the migration intention
    • Removing people who posted only once
    1. Monthly comment aggregation:
    • The time unit is monthly so the comment are joined this way
    1. SLMs data extraction:
    • Using a small language model, specific information will be extracted

Data extraction

Using a Large Language Model (LLM) or a Small Language Model (SLM)?

https://www.techradar.com/computing/artificial-intelligence/best-llms

Data extraction

LLMs have many use cases… data extraction is one of them!

Data extraction

From unstructured text to JSON format (LLMs are good for that!)

“Hey everyone, I (f28) and my husband (m28) have been dreaming of moving to Switzerland because I’ve received an exciting job offer from a tech company based there. The role involves developing software solutions, which aligns perfectly with my career goals.”

Prompt: Extract the following information of 
the user in a JSON format: user age, 
user sex, migration reason [job, family], 
coming from, marital status, social network.

Result

{
  "poster_age": "28",
  "poster_sex": "female",
  "migration_reason": "job",
  "coming_from": "not specified in the message",
  "marital_status": "married",
  "social_network": "husband"
}

Data extraction

Some advanced prompting is needed:

  • Role given to the model: Labeling Expert
  • Detailed description of variables we are looking for
  • Restricted value list per variable given
  • A few shots example (questions and expected answers) to guide the model

Result

  • +100 lines long prompt with 3 examples

Data extraction

The full prompt:

/nothink You are a labeling expert specialized in extracting data from Reddit 
posts. Your goal is to extract relevant socio-demographic data from a given
Reddit post. Please extract the data in valid JSON format, following this 
schema:

{
    "age": "",
    "sex": "",
    "marital_status": "",
    "level_of_education": "",
    "occupations": [],
    "sector": [],
    "nationality": [],
    "country": [],
    "migration_reason": [],
    "migration_reason_details": "",
    "coming_with_list": [],
    "relationship_in_switzerland_list": [],
    "going_to_canton": [],
    "concerns": [],
    "estimated_arrival_date": "",
    "estimated_staying_duration": ""
}

here is the detail of what each key can have as a value:

age: from 1 to 100,
sex: one of [Man, Woman],
marital status: one or many of [Single, In Relationship, Married, Divorced],
level_of_education: one of [Primary, Secondary, Tertiary],
occupation: can be any type of employement,
sector: which sector is the employement,
nationality: which nationality,
country: which country,
migration_reason: one or many of [Professional reason, Educational, Start a family, Accompany family, Life style Reason, Gain new experience, Social Network in Switzerland, Tax reason, Political reason, Other reason],
migration_reason_details: details what is said in the text,
coming_with_list: one or many of [Partner, Parents, Children, Friends, Colleagues, Other People],
relationship_in_switzerland_list: [Partner, Parents, Children, Friends, Colleagues, Other People],
going_to_canton: One of [Zürich (ZH), Bern (BE), Luzern (LU), Uri (UR), Schwyz (SZ), Obwalden (OW), Nidwalden (NW)), Glarus (GL), Zug (ZG), Freiburg (FR), Solothurn (SO), Basel Stadt (BS), Basel Land (BL), Schaffhausen (SH), Appenzell Ausserrhoden (AR), Appenzell Innerrhoden (AI), Sankt Gallen (SG), Graubünden (GR), Aargau (AG), Thurgau (TG), Ticino (TI), Vaud (VD), Valais (VS), Neuchâtel (NE), Genève (GE), Jura (JU)],
concerns: [Financing the move, Financing the settlement, Finding Accomodation, Finding Childcare, Finding School, ealing with Administration, Speaking Local Language, Feeling Lonely, Feeling Homesick, Feeling Unwelcomed, Cost of Life in Switzerland, Work/Residential Permit, Healthcare System, Politics, Salary],
estimated_arrival_date: give an estimated date in the Following format yyyy-mm-dd and floor it if it is unsure and chose the earliest option,
estimated_staying_duration: give an estimation in years

If the information for a given key is not available, just return an empty string ("") or an empty list ([]). Do not answer anything else than the json. Here are some examples:

---

# Example 1
DATE: 2019-02-04
TITLE: Arrival to Switzerland on March, what to do?
AUTHOR_FLAIR: family
TEXT: Hey everyone, so I'm (f39) an IT professional who just got a promotion that allows me to move to Switzerland. So I'm coming from Germany, and I know that Switzerland and Germany are pretty similar in many ways. In fact, I'm moving because I'm coming with my spouse (31) and my two kids (12 and 17). I'd like to know if it's possible to settle in Switzerland easily. So I have some questions about schools because I want to enroll my kids in school. I also have questions about what comes next, especially regarding healthcare.  And basically, I wanted to know if it's possible to earn a good salary in Switzerland.  
That's it.
Thanks in advance!

# Response 1  
{
    "age": "39",
    "sex": "Woman",
    "marital_status": "Relationship",
    "level_of_education": "Tertiary",
    "occupations": ["IT professional"],
    "sector": ["IT"],
    "nationality": ["German"],
    "country": ["Germany"],
    "migration_reason": ["Professional reason", "Gain new experience"],
    "migration_reason_details": "Just got a promotion",
    "coming_with_list": ["Partner", "Children"],
    "relationship_in_switzerland_list": [],
    "going_to_canton": [],
    "concerns": ["Finding school", "Healthcare system", "Salary"],
    "estimated_arrival_date": "",
    "estimated_staying_duration": ""
}

---

# Example 2
DATE: 2018-05-19
TITLE: 22M in Philosophy
AUTHOR_FLAIR: family
TEXT: Hey everyone, I'm a Harvard student, originally from China, but I've been living in the US for now. I actually got a job offer that allows me to move to Switzerland, and I'd really like to know how to get a student permit there. The problem is, all the documentation I find is either unreadable or inaccessible. I also want to know how expensive life in Switzerland is — I know it's already pretty pricey in the US, and now if I move to Switzerland, how is it going to go down? For reference, I'll be in the canton of Vaud, more specifically in Lausanne. Can anyone tell me what it's like there?

# Response 2
  
{
    "age": "22",
    "sex": "Man",
    "marital_status": "",
    "level_of_education": "Tertiary",
    "occupations": ["Student"],
    "sector": ["Education"],
    "nationality": ["Chinese"],
    "country": ["China", "United-States"],
    "migration_reason": ["Professional reason"],
    "migration_reason_details": "got a job offer",
    "coming_with_list": [],
    "relationship_in_switzerland_list": [],
    "going_to_canton": ["Vaud (VD)"],
    "concerns": ["Cost of Life in Switzerland"],
    "estimated_arrival_date": "",
    "estimated_staying_duration": ""
}

---

# Example 3
DATE: 2020-01-20
TITLE: From Spain, joining a friend in Switzerland for work, is it Worth it?
AUTHOR_FLAIR: familyHey everyone, so I got a job at this awesome company that does data science, and I'm going to end up in Saint-Gall. Right now I'm looking for new projects to work on. For reference, I'm 36(m), and I wanted to know if Switzerland is a really great country — since the contract hasn't been signed yet. I would like to stay as long as possible, let say something like 5 years. If the destination looks good I would arrive the next december. Thanks, everyone!

# Response 3  
{
    "age": "36",
    "sex": "Man",
    "marital_status": "",
    "level_of_education": "Tertiary",
    "occupations": ["Data Scientist"],
    "sector": ["IT"],
    "nationality": ["Spanish"],
    "country": ["Spain"],
    "migration_reason": ["Professional reason"],
    "migration_reason_details": 'got a job offer',
    "coming_with_list": [],
    "relationship_in_switzerland_list": ["Friends"],
    "going_to_canton": ["Sankt Gallen (SG)"],
    "concerns": [],
    "estimated_arrival_date": "2020-12-01",
    "estimated_staying_duration": "5 Years"
}

---

Here is the real text:

Data extraction

LLMs vs SLMs

  • LLMs (ChatGPT, Claude, …)
    • Efficient
    • Cost
    • Not confidential
  • SLMs (Llama, Qwen, …)
    • Less efficient
    • Free
    • Local (confidential)

Model

Joint Bayesian model

Advantages:

  • Mix a survival model with longitudinal models

  • Time dependent predictors

Model

Joint Bayesian model

Advantages:

  • Mix a survival model with longitudinal models

  • Time dependent predictors

Model

Joint Bayesian model

Advantages:

  • Mix a survival model with longitudinal models

  • Time dependent predictors

Model

Joint Bayesian model

Advantages:

  • Mix a survival model with longitudinal models

  • Time dependent predictors

Model

Joint Bayesian model

Advantages:

  • Mix a survival model with longitudinal models

  • Time dependent predictors

Model

Joint Bayesian model

Advantages:

  • Mix a survival model with longitudinal models

  • Time dependent predictors

Model

Joint Bayesian model

Longitudinal submodel

\[ y_i(t) \mid b_i \sim \mathcal{N}\big(\eta_i(t),\,\sigma^2\big),\qquad \]

\[ \eta_i(t)=X_i(t)\beta + Z_i(t)b_i \]

Random effects

\[ b_i \sim \mathcal{N}\big(0,\,\Sigma_b\big) \]

Event (survival) submodel — hazard

\[ h_i(t)=h_0(t)\exp\big(W_i\gamma + \alpha\,A_i(t)\big) \]

Variable meanings

  • \(y_i(t)\): observed longitudinal outcome for subject \(i\) at time \(t\).
  • \(\eta_i(t)\): subject-specific linear predictor (true mean) of the longitudinal model for subject \(i\) at time \(t\).
  • \(X_i(t)\): row vector (or design matrix) of fixed-effect covariates for the longitudinal outcome for subject \(i\) at time \(t\).
  • \(\beta\): column vector of fixed-effect coefficients (population-level parameters) for the longitudinal submodel.
  • \(Z_i(t)\): row vector (or design matrix) of covariates entering the random-effects part of the longitudinal model for subject \(i\) at time \(t\) (e.g., intercept, slope basis functions).
  • \(b_i\): subject-specific random-effects vector for individual \(i\) (random intercepts/slopes).
  • \(\sigma^2\): residual variance of the longitudinal outcome (observation-level error variance).
  • \(\Sigma_b\): covariance matrix of the random effects \(b_i\) (between-subject variance–covariance).
  • \(h_i(t)\): hazard (instantaneous event rate) for subject \(i\) at time \(t\).
  • \(h_0(t)\): baseline hazard function (time-dependent baseline hazard common to all subjects).
  • \(W_i\): row vector of baseline (or time-varying, if specified) covariates included in the event model for subject \(i\).
  • \(\gamma\): column vector of regression coefficients for covariates \(W_i\) in the event (hazard) model.
  • \(A_i(t)\): association function linking the longitudinal process to the hazard for subject \(i\) at time \(t\) (commonly \(A_i(t)=\eta_i(t)\), the current value; can also be slope, cumulative value, a random-effect, lagged value, etc.).
  • \(\alpha\): association parameter that quantifies the effect of \(A_i(t)\) (the longitudinal feature) on the log-hazard (i.e., the log-relative hazard).

Model

Joint Bayesian model

Survival part

Longitudinal part

Model

Survival part

  • Dependent variables: Migration to Switzerland
  • Time (month)
  • Sociodemographic: (age, gender, occupation, country of origin)
  • Migration related variables: migration reason, migration concerns, etc.

Longitudinal part

Model

Survival part

Longitudinal part

  • Dependent variables: Migration intention to Switzerland
  • Time (month)
  • Life course:
    • Historical time/place (Covid-19, economic shifts)
    • Life events (birth, death, job gain/loss, …)
    • Linked lives (friends, family member mention)

Many missing values

Data completed with a random forest based imputation:

Many missing values

Age and Sex

  • Information: years after the first intention

  • Data completed with a random forest based imputation

Attrition

  • Keep: people posting at least 2 times before the first mention

  • Keep: people posting at least 2 times after the first mention

Migration intention

  • Mentioning wanting to go Switzerland (Yes)

  • Not mentioning it (No)

Migration

  • Mentioning being in Switzerland (Yes)

  • No mentioning it (No)

Final sample (n=383)

Current results: Initial collection

Biased population

Mostly from USA and UK, and mostly educated

Concerns coming to Switzerland

Mostly practical concerns:

n prop
1 Work/Residential Permit 119 20.3%
2 Cost Of Life In Switzerland 104 17.7%
3 Speaking Local Language 96 16.4%
4 Finding Accomodation 76 13.0%
5 Healthcare System 42 7.2%
6 Financing The Settlement 24 4.1%
7 Finding School 22 3.8%
8 Salary 22 3.8%
9 Feeling Unwelcomed 21 3.6%
10 Dealing With Administration 20 3.4%
11 Financing The Move 17 2.9%
12 Feeling Lonely 8 1.4%
13 Politics 7 1.2%
14 Finding Childcare 3 0.5%
15 Finding Accommodation 2 0.3%
16 Tax Reason 2 0.3%
17 Feeling Homesick 1 0.2%

Migration

42% (n=161) of the sample migrate to Switzerland before the end of the observation period

Migration

Model

Summary of Posterior Distribution
Parameter Median 95% CI pd ROPE % in ROPE
Long1|monthly -0.59 [-0.65, -0.53] 100% [-0.10, 0.10] 0%
Long1|covidTRUE 0.11 [-0.11, 0.37] 82.88% [-0.10, 0.10] 45.16%
Event|age -0.02 [-0.08, 0.03] 81.27% [-0.10, 0.10] 100%
Event|sexWoman -0.06 [-0.51, 0.39] 59.65% [-0.10, 0.10] 34.16%
Event|marital_statusMarried -0.71 [-1.74, 0.31] 91.70% [-0.10, 0.10] 6.45%
Event|marital_statusRelationship -0.30 [-1.19, 0.60] 75.78% [-0.10, 0.10] 14.97%
Event|level_of_educationTertiary 0.92 [-0.03, 1.95] 97.15% [-0.10, 0.10] 1.79%
Event|year2018 0.03 [-0.87, 0.83] 52.60% [-0.10, 0.10] 20.08%
Event|year2019 0.16 [-0.57, 0.92] 67.62% [-0.10, 0.10] 20.92%
Event|year2021 0.70 [ 0.10, 1.36] 99.00% [-0.10, 0.10] 0.11%
Event|year2022 1.21 [ 0.55, 1.96] 100% [-0.10, 0.10] 0%
Assoc|Long1|etavalue 1.68 [ 0.85, 2.59] 99.83% [-0.10, 0.10] 0%

Impact of Covid-19

Longitudinal

Survival

Thank you for your attention!

Sources

Bernard, Aude, and Sergi Vidal. 2023. “Linking Internal and International Migration over the Life Course: A Sequence Analysis of Individual Migration Trajectories in Europe.” Population Studies 77 (3): 515–37. https://doi.org/10.1080/00324728.2023.2231913.
Findlay, Allan, David McCollum, Rory Coulter, and Vernon Gayle. 2015. “New Mobilities Across the Life Course: A Framework for Analysing Demographically Linked Drivers of Migration.” Population, Space and Place 21 (4): 390–402. https://doi.org/10.1002/psp.1956.
Kulu, Hill, and Nadja Milewski. 2007. “Family Change and Migration in the Life Course: An Introduction.” Demographic Research 17 (December): 567–90. https://doi.org/10.4054/DemRes.2007.17.19.
Sîrbu, Alina, Gennady Andrienko, Natalia Andrienko, Chiara Boldrini, Marco Conti, Fosca Giannotti, Riccardo Guidotti, et al. 2021. “Human Migration: The Big Data Perspective.” International Journal of Data Science and Analytics 11 (4): 341–60. https://doi.org/10.1007/s41060-020-00213-5.
Van Dalen, Hendrik P., and Kene Henkens. 2008. “Emigration Intentions: Mere Words or True Plans? Explaining International Migration Intentions and Behavior.” SSRN Electronic Journal. https://doi.org/10.2139/ssrn.1153985.
Wanner, Philippe. 2021. “Can MigrantsEmigration Intentions Predict Their Actual Behaviors? Evidence from a Swiss Survey.” Journal of International Migration and Integration 22 (3): 1151–79. https://doi.org/10.1007/s12134-020-00798-7.