Testing a Rival Explanation SOCL 3633 Research Methods · Lab 6 · Midwestern State University

Older people in the GSS report more hours of TV a day. Does getting older cause people to watch more TV, or does something else explain the pattern? Today you find the pattern, then test two rival explanations in the data. Keep this page open next to RStudio and work through the tabs in order. Before you leave, you submit two things in the Lab 6 submission on D2L: your response sheet and the picture file of your own chart.

Get set up

Two new tools today

cut()
Sorts a number, such as age, into groups. breaks sets where each group ends, and labels names the groups.
if_else()
Gives one value when a rule is true and another when it is false. if_else(rincome == "Not applicable", "No income from work", "Income from work") sorts everyone into two groups.

The pattern: Steps 2 and 3

Step 2: keep people with both values

Select all the lines from tv_age <- through the labels line and run them. Then run nrow(tv_age).

Checkpoint. 11,299 people have both an age and a TV-hours value. Remember from Lab 2 that many people were never asked about TV, so this is about half of the data.

Step 3: average TV hours by age group

  1. Put age_group in the blank, select the four lines from by_age <-, and run them. Then run by_age to see the table.
  2. Select the chart lines and run them, then print(age_chart).
Checkpoint. People aged 30 to 44 average 2.58 hours a day. People 65 and older average 3.70 hours, about 1.1 hours more.
Bar chart of average daily TV hours by age group: 18 to 29, 2.8 hours; 30 to 44, 2.6; 45 to 64, 3.1; 65 and older, 3.7.
Age and TV hours go together. That is the first requirement for a causal claim. Before saying that getting older causes more TV watching, ask what else differs between the age groups.

If something goes wrong

What you seeWhat to do
"object 'age_group' not found"Step 2 did not run all the way. Select every line of Step 2 and run them together.
Only one row in a table, or NA averagesA blank is still empty or misspelled. Variable names are lower case.
In Step 5, everyone is in "Income from work"The Step 4 blank is empty or misspelled. Type Not applicable exactly, with a capital N, inside the quotation marks, and run Step 4 again.
A + sign in the ConsoleA parenthesis is missing. Press Escape in the Console, fix it, and run all the lines of the step again.

Rival explanation: work. Steps 4 and 5

Most people 65 and older are retired. People who are not working may have more time for TV at any age. If so, working for pay could be a third factor behind the age pattern.

Step 4: who has income from work?

  1. Put Not applicable in the blank, inside the quotation marks, and run the three lines.
  2. Run the next block to see the share of each age group with no income from work.
Before you run Step 5: among people with income from work, how many more hours of TV will people 65 and older report than people aged 30 to 44? The overall gap is 1.1 hours.
1.1 hours

Step 5: compare age groups within each work group

  1. Put work in the blank, select the lines from by_age_work <-, and run them. Then run by_age_work.
  2. Run the chart lines and print(work_chart).
Two bar charts stacked. Income from work: 18 to 29, 2.7 hours; 30 to 44, 2.4; 45 to 64, 2.6; 65 and older, 2.9. No income from work: 18 to 29, 3.0; 30 to 44, 3.3; 45 to 64, 4.4; 65 and older, 3.9.
Checkpoint. 77 percent of people 65 and older have no income from work, compared with 20 percent of people aged 30 to 44. Among people with income from work, the gap between those two age groups shrinks to about half an hour. Working for pay explains a large part of the age pattern, though not all of it.

On your own: Step 6, marriage

Another rival explanation: married people may watch less TV, and the age groups differ in how many people are married. Test it the same way you tested work.

  1. In the first blank, put Married, exactly as it appears in the data, inside the quotation marks. Run those three lines.
  2. In the second blank, put married, the name of your new variable. Run the lines, then by_age_married.
  3. Run the chart lines. Look at the chart, then replace "Write your title here" with a complete sentence of about ten words that says what it shows. Run the chart lines again.
  4. Write one ggsave() line that saves my_chart with your last name, for example smith_lab6.png, and run it. Use height = 6 so both panels fit.
There is no example chart for this step. Compare the two panels. If the age pattern looks about the same in both, marriage does not explain it. If the pattern shrinks in both, as it did for work, marriage explains part of it. Question 4 asks what you found.
Before you leave: save the script in your SOCL3633 folder (File, then Save).

Lab 6 response sheet

Answer in complete sentences. Then assemble your answers and paste them into the Lab 6 submission in D2L. In the same submission, upload the picture file of your own chart. Your answers stay on this page and are not sent anywhere until you paste them.

Your name
1. How many more hours of TV do people 65 and older report than people aged 30 to 44? Does that show that getting older causes people to watch more TV?
Two to three sentences.
2. Among people with income from work, how big is the gap between those two age groups? What does that suggest about working for pay as a third factor?
Two to three sentences.
3. "No income from work" comes from the income question's "Not applicable" category. What does that measure miss as a stand-in for "not working"?
Two to three sentences.
4. Did marital status explain the age pattern? Then name one rival explanation these data cannot test, and say why.
Three to four sentences.

Sources

NORC at the University of Chicago. General Social Survey, 2000 to 2014. Accessed through the gss_cat extract in the forcats package for R. https://gss.norc.org
Wickham, Hadley, Romain François, Lionel Henry, Kirill Müller, and Davis Vaughan. 2023. dplyr: A Grammar of Data Manipulation. R package. https://dplyr.tidyverse.org
Wickham, Hadley. 2016. ggplot2: Elegant Graphics for Data Analysis. New York: Springer.

All averages on this page come from the gss_cat extract and were checked by running the lab script. They are unweighted, and they include only people who were asked about TV hours.