Tutorials › AP Statistics › Lurking Variables in Regression Settings

Regression and context · Tutorial 926 of 1000

Lurking Variables in Regression Settings

See how age can contribute to an overall regression association and how to describe that possibility without claiming it is the only explanation.

Intermediate 8 min read

What You'll Learn

  • Define a lurking variable in a regression setting.
  • Distinguish a lurking variable from a potential confounder.
  • Explain how age-related group differences can produce an overall association.
  • Compare a pooled pattern with patterns within age groups.
  • Use cautious language when describing a possibly spurious relationship.
  • Recognize what an overall regression does not establish.

When an Overall Regression Hides Age Differences

In “Identifying a Confounding Variable in a Scenario,” you practiced finding a third variable that could be related to both the explanatory variable and the response. This tutorial looks at what can happen when such a variable is not included in the regression analysis. Age is a useful example: age groups may differ in the explanatory variable and in the response, so combining those groups can produce an overall association that does not reflect the pattern within any one group.

A regression line describes the association in the data that were analyzed. If the data combine people of different ages, the fitted line reflects both the variation among people of similar ages and the differences between age groups. Those two patterns need not tell the same story. The overall association can be weakened, strengthened, or even have a different direction from the associations within age groups.

Definition: A lurking variable is an unmodeled variable that may affect the relationship between the explanatory variable and the response. In this setting, a variable related to both the explanatory variable and the response is a potential confounder. Age can be a lurking variable when it is left out of the regression and may affect the observed relationship.

A lurking variable is not simply any unrecorded detail. It matters because it may change how the relationship between the two modeled variables should be understood. If age is associated with both variables, for example, the pooled regression may partly reflect age differences rather than a relationship between the explanatory variable and response that holds within age groups.

Calling a relationship spurious means that an apparent association may be produced, or substantially affected, by a lurking variable. It does not mean the calculated correlation or regression line is mathematically fake. Nor does it prove that there is no relationship between the explanatory variable and response. The careful conclusion is that the overall pattern may not represent the relationship within comparable age groups.

How Age Can Contribute to an Overall Pattern

Suppose a study combines younger and older people. Younger people may tend to have higher values of \(x\), while older people tend to have higher values of \(y\). When the groups are combined, the overall data can show a relationship between \(x\) and \(y\), even if there is little or no association between them among younger people or among older people separately.

The same logic applies if both variables tend to be higher in one age group, or if their within-group patterns point in a different direction from the pooled pattern. The direction depends on how the groups differ. Do not assume that age always makes a relationship positive or always makes it negative: explain the specific group differences in the scenario.

1
Name the regression variables.
State what \(x\) measures and what \(y\) measures, and identify the individuals or cases when the scenario provides that information.
2
Describe how age may relate to \(x\).
Explain why the explanatory-variable values might differ across ages or age groups in this setting.
3
Describe how age may relate to \(y\).
Explain why the response might also differ with age, whether through age itself or age-related circumstances.
4
Compare pooled and within-age patterns.
If the data allow it, examine the relationship among people of similar ages as well as in the combined data.
5
State a cautious conclusion.
Say that age may contribute to or affect the overall association. Do not claim that age explains everything unless the evidence supports that conclusion.

Comparing patterns within age groups is a useful descriptive check. A scatterplot can use different symbols or colors for age groups, making it easier to see whether the pooled trend is also present within groups. If the groups have enough observations, separate summaries or regression lines can also help describe the patterns. These comparisons do not automatically control for every other variable, and they do not by themselves establish causation.

This builds on “Association Versus Causation in Regression” and “Observational Studies and Confounding.” A regression association alone does not show that changing \(x\) changes \(y\). Noticing age as a possible lurking variable gives an additional reason to be cautious about interpreting the overall line, but it does not prove that age caused the pattern or rule out a genuine association between \(x\) and \(y\).

Worked Examples: Pooled Patterns and Age Groups

Worked Example: Fitness-App Use and Resting Heart Rate

A fictional health program records data from adults. The explanatory variable \(x\) is the number of hours per week each person uses a fitness-tracking app, and the response \(y\) is resting heart rate in beats per minute. The combined data show that people who use the app more tend to have lower resting heart rates. The program also records age. In this invented example, younger participants tend to use the app more, and the age-group summaries show that older participants tend to have higher resting heart rates. Within each age group, the app-use and heart-rate values show little clear association.

Identify the modeled relationship. The cases are adults in the program, \(x\) is weekly app-use time in hours, and \(y\) is resting heart rate in beats per minute. The pooled data show a negative association: larger app-use values tend to occur with smaller heart-rate values.

Explain the two age links. Age is related to \(x\) in this scenario because younger adults tend to use the app more. Age is related to \(y\) because the older group tends to have higher resting heart rates. These group differences can help create the negative association when all ages are combined.

Compare the patterns. The within-group displays show little clear app-use relationship among younger participants and little clear relationship among older participants. Thus, the pooled association is not clearly repeated within either age group. The differences between the age groups may account for much of the overall pattern.

Conclude carefully. Age is a plausible lurking variable that may make the overall app-use–heart-rate association appear stronger than the within-age relationships. The pooled regression describes the combined participants, but it does not show that using the app lowers resting heart rate. The scenario also does not establish that age accounts for the entire association or that app use has no relationship with heart rate.

Worked Example: Salary and Weekly Exercise Among Employees

A fictional company surveys employees about annual salary in thousands of dollars and hours of exercise per week. In the full employee group, higher salaries tend to occur with fewer weekly exercise hours. The company also records age and job tenure. Its summary notes that older employees tend to have longer tenure and higher salaries, while some older employees report less time available for exercise. When employees of similar ages are compared, the negative salary–exercise pattern is much weaker.

Identify the modeled relationship. The individuals are employees. Salary is the explanatory variable \(x\), measured in thousands of dollars, and weekly exercise time is the response \(y\), measured in hours. The combined data show a negative association.

Explain how age could be related to salary. In the scenario, older employees tend to have longer job tenure, and the older group tends to have higher salaries. This provides a plausible link between age and the explanatory variable.

Explain how age could be related to exercise. The scenario says some older employees report less time available for exercise. This gives a possible link between age and the response. It is a contextual possibility, not a claim that every older employee exercises less.

Interpret the within-age comparison. The negative pattern is much weaker among employees of similar ages than it is in the combined group. This suggests that differences among age groups may contribute to the pooled association. Job tenure is also mentioned, so it may be another variable worth considering; the information provided does not establish which variable accounts for more of the pattern.

Conclude carefully. Age is a plausible lurking variable because it may be related to both salary and exercise time, and the within-age pattern is weaker. The overall regression does not establish that higher salary leads employees to exercise less. It also does not prove that age fully explains the pooled relationship.

Worked Example: Digital and Print Library Use Across Neighborhoods

A fictional library system compares neighborhoods. The explanatory variable \(x\) is the number of digital-book checkouts per 100 residents during a month, and the response \(y\) is the number of print-book checkouts per 100 residents during that month. Across all neighborhoods, the data show a negative association. The library also records the median age of residents. Neighborhoods with lower median ages tend to have more digital checkouts, while neighborhoods with higher median ages tend to have more print checkouts. Within neighborhoods of similar median age, the negative association is small.

Identify the cases and variables. The cases are neighborhoods. The explanatory variable is digital checkouts per 100 residents, and the response is print checkouts per 100 residents. Median resident age is an additional variable, not one of the two variables in the regression.

Explain the age links. Median age is associated with digital use in the scenario because neighborhoods with lower median ages tend to have more digital checkouts. It is also associated with print use because neighborhoods with higher median ages tend to have more print checkouts. These two differences can contribute to the negative pattern in the pooled neighborhood data.

Use the within-group information. When neighborhoods with similar median ages are compared, the negative association is small. That contrast supports the idea that the overall association may be largely connected to differences in neighborhood age composition. It does not show that every neighborhood follows the same pattern or that age is the only relevant difference.

Conclude carefully. Median age is a plausible lurking variable that may affect the observed relationship between digital and print checkouts. The overall regression describes the observed neighborhoods, but it should not be interpreted as proof that increasing digital checkouts causes print checkouts to decrease. Other neighborhood characteristics could also contribute.

What a Within-Group Comparison Can and Cannot Show

When an overall association weakens or changes direction within age groups, that is a warning that the pooled pattern may be influenced by age. It can be helpful to state both facts: what the combined data show and what the within-age comparisons show. This avoids treating one regression line as a complete description of every subgroup.

If the association remains similar within each age group, age may still be related to both variables, but the comparisons provide less indication that age accounts for the pooled pattern. A lurking variable can affect a relationship without making it disappear. The evidence should guide how strongly you describe its possible role.

Age groups are often broad, and people within a group still differ in age. Grouping can hide variation, and small groups may make patterns difficult to assess. Also, finding that a pattern changes after grouping by age does not prove that age is the only lurking variable. A careful description uses “may” or “could” and stays close to the information given.

Response frame: “The overall data show [describe the association between \(x\) and \(y\)]. Age may affect this relationship because [explain how age is related to \(x\)] and [explain how age is related to \(y\)]. The association [weakens, changes direction, or remains similar] within age groups, suggesting that age [may contribute to the pooled pattern / does not appear to account for the pooled pattern by itself].”

Common Mistakes and AP Exam Tip

  • Defining a lurking variable too broadly. A variable is not a lurking variable just because it is unrecorded or related to one modeled variable. Explain how it may affect the relationship between the explanatory variable and response. If it is related to both, call it a potential confounder in this setting.
  • Claiming age explains the entire association. Say that age may contribute unless the evidence supports a stronger conclusion. A pooled and within-group comparison can suggest a role without proving that age is the only explanation.
  • Describing only one age link. To explain why age may affect the relationship, connect it separately to \(x\) and \(y\). A full-credit response makes both links specific to the scenario.
  • Assuming the pooled pattern holds within every age group. The overall line describes the combined data. Check or describe within-age patterns when that information is available.
  • Confusing a spurious association with an incorrect calculation. “Spurious” describes an association that may be produced or affected by a lurking variable; it does not mean the fitted line was computed incorrectly.
  • Making a causal claim. An observational regression does not establish that changing \(x\) causes a change in \(y\). Identifying age as a possible lurking variable adds caution; it does not prove a causal explanation.

For an AP-style response, name age, connect it to both regression variables in context, and describe how the pooled pattern compares with the pattern within age groups if that information is given. Then qualify the conclusion: age may contribute to the observed association, but the scenario does not establish that age fully explains it.

Key takeaway: A lurking variable is an unmodeled variable that may affect the relationship between the explanatory variable and the response. Age can contribute to a pooled regression association when age groups differ in both variables. Compare the overall pattern with within-age patterns, and describe age’s possible role without claiming more than the evidence shows.

Check Your Understanding

For each situation, explain whether age could affect the overall regression relationship and identify what additional pattern or comparison would help assess the possibility.

  1. A survey finds that people who spend more time on online banking tend to visit bank branches less often. The sample includes adults of many ages. Name two age-related links that would make age a plausible lurking variable.
  2. A study finds that older community members attend more local-history events and report greater knowledge of local history. Explain how age could contribute to the pooled association, even if the relationship within age groups is weak.
  3. A regression of weekly streaming hours on monthly spending shows a positive association. The data include teenagers and adults, whose age groups differ in both streaming habits and spending money. Explain why age may affect the pooled pattern.
  4. In a scenario, an overall negative association becomes nearly zero within each age group. What can you conclude about age, and what would be too strong a claim?
  5. Write a two-link, cautious response explaining how age could affect a regression relationship of your choice. Include the explanatory variable, response, and a possible within-age comparison.