Description
https://we.tl/t-ro7BB7utAl
Unformatted Attachment Preview
INFO371 Lab: Interaction effects
January 15, 2024
1
Interaction Effects
Your task is to dig into interaction effects and answer the following question:
• Does religion help to overcome the loneliness-caused loss of life satisfaction?
You’ll work with a World Value Survey subset wvs-satisfaction-subset.csv (in files/data). The important
variables are:
satisfaction “All things considered, how satisfied are you with your life as a whole these days?” 1: not
at all satisfied … 10 totally satisfied
marital “Are you currently…” 1: Married; 2: Living together; 3: Divorced; 4: Separated; 5: Widowed;
6: Single
religious “Independently of whether you attend religious services or not, would you say you are…” 1: A
religious person; 2: Not a religious person; 3: An atheist
1.1
Data Preparation
First you have to prepare the data:
1. Load data.
2. Remove missings. In this dataset, missings are coded as negative numbers, not as NA!
3. Select only variables you need: satisfaction, marital, religious.
4. Create a new auxiliary variable lonely if person is living alone, i.e. not married and not living
together.
Hint: there are multiple ways, but %in% operator is a good choice.
5. Create a new auxiliary variable religious that is 1 if the person is religious and 0 it not (either
non-religious or atheist).
1.2
Graphical analysis
1. Create a graph along the following lines that shows the relationship between satisfaction, loneliness,
and religion:
1
5.0
satisfaction
4.5
Religious
0
4.0
1
3.5
3.0
0.00
0.25
0.50
0.75
1.00
lonely
Hint: compute average level of satisfaction for all groups of lonely and religious. In the example
above the numbers are just arbitrary and the corresponding data frame looks like
lonely
religious
satisfaction
0
0
1
1
0
1
0
1
5.0
3.0
4.0
3.5
Afterward you can use ggplot() + geom_point() + geom_line()
2. Based on the graph tell how is satisfaction, loneliness and religion related.
1.3
Does Religion Help against Loneliness?
Now analyze if religious persons are less affected by loneliness (in terms of family status). Estimate the
model in the form
satisfaction i = β0 + β1 · lonely i + β2 · religious i + β3 · lonely i × religious i + ϵi .
1. Estimate such model and print the output
Hint: use the formula shortcut, see R notes Ch 11.1.3 Using R modeling tools.
2. Interpret all four coefficients.
3. Based on your analysis–do religious people suffer more or less from loneliness? Is the effect statistically significant?
4. Can you answer the question: does religion help to ameliorate the effect of loneliness?
2
Purchase answer to see full
attachment