IntroAnalysis:::ma223_setup()
library(learnr)

knitr::opts_chunk$set(echo = FALSE)
learnr::tutorial_options(exercise.cap = "Exercise")

```{css, echo=FALSE} / Solution Functionality / .accordion > input[type="checkbox"] { position: absolute; left: -100vw; }

.accordion .content { overflow-y: hidden; height: 0; transition: height 0.3s ease; }

.accordion > input[type="checkbox"]:checked ~ .content { height: auto; overflow: visible; }

.accordion label { display: block; }

/ Styling /

.accordion { margin-bottom: 1em; }

.accordion > input[type="checkbox"]:checked ~ .content { padding: 15px; border: 1px solid #e8e8e8; border-top: 0; }

.accordion .handle { margin: 0; }

.accordion label { cursor: pointer; font-weight: normal; padding: 15px; }

.accordion label:hover, .accordion label:focus { background: #d8d8d8; }

/ Turning arrow / .accordion .handle label:before { font-family: 'fontawesome'; content: "\f054"; display: inline-block; margin-right: 10px; font-size: .58em; line-height: 1.556em; vertical-align: middle; }

.accordion > input[type="checkbox"]:checked ~ .handle label:before { content: "\f078"; }

.tipbox { padding: 1em 1em 1em 1em; border: 1px solid black; border-radius: 10px; box-shadow: 2px 2px #888888; }

.keyidea { border: 1px solid #54585A; background: #4F758B; color: white; }

.keyidea:before { content: "Key Idea: "; font-weight: bold; }

.tip { background: lightyellow; }

.tip:before { content: "Tip: "; font-weight: bold; }

.title{ color: #800000; background: none; }

.solution { background: #ebebeb; }

h2{ color: white; background-color: #800000; }

h3{ color: #800000; border-bottom: thick solid #696969; }

h4{ color: #800000; }

blockquote { font-size: inherit; padding: 0px 20px; }

## Background
"Repetitive negative thinking (RNT) is a process characterized by intrusiveness, repetitiveness, and difficulties to disengage from negative cognitive and affective content...which encompasses worry (future-directed negative thought) and rumination (past-directed negative thought)" [(Schlosser 2022)](https://link.springer.com/article/10.1007/s12144-020-00839-5).  Those diagnosed with depression and anxiety often exhibit high levels of RNT.  Mindfulness is one recommended therapy to combat RNT.

> It can be difficult to distinguish between prudent forethought and worry as well as prudent reflection and rumination.  RNT includes both "instrusiveness" (unwanted, but it comes anyway) and "repetitiveness."  An example of rumination is replaying a conversation over and over again in your mind, thinking of how it could have gone differently (and often critiquing yourself in the process).  Similarly, an example of worrying is when you play a hypothetical conversation over and over again in your mind before it happens, often bringing in elements from past conversations (generally assuming the worst of another person or yourself).  
>  
> It is easy to dismiss RNT as simply "my personality."  But, frequently engaging in this type of thinking can lead to depression and self-harming thoughts.  If you are interested in exploring treatment options, including mindfulness, reach out to the [Student Counseling Center](https://rosehulman.sharepoint.com/sites/counseling/SitePages/Home.aspx).
>
> For free resources on mindfulness, consider the [Free Mindfulness Project](https://www.freemindfulness.org/).

A link to an online survey was shared via social media to international mindfulness associations, meditation centers, and Buddhist communities.  Participants had to be at least 18 years of age and regularly (at least once per week) practice meditation. We have access to this data (`meditation`).  The Perseverative Thinking Questionnaire (PTQ, `negthinking` variable) was used to quantify the participants level of RNT.  The PTQ consists of 15 questions in which participants rate each item on a 5-point scale; scores can range from 0 to 60, and higher scores indicate higher levels of RNT.  The Mindsens score (`mindfulness`) was used to measure mindfulness obtained through the participants meditation practices.  The Mindsens is a 19-item index combining elements of the Five Face Mindfulness Questionnaire and the Experience Questionnaire.  Scores represent an average of responses to these questions and range from 1 to 5, with higher values indicating higher levels of mindfulness.  These scores have been well-studied.

> There is no agreed upon definition of "mindfulness."  Some associate this with specific religious practices (like Buddhism), but there are many characteristics that are shared by a wide range of people from different spiritual backgrounds.  In this study, "mindfulness" is primarily considered the result of "meditation," and is considered the participants "ability to be mindful and the capacity to observe mental objects as transient and impersonal."  Think of it as a person's ability to describe their emotions without experiencing those emotions.

"[C]linical research suggests that RNT mediates the effects of mindfulness-based interventions on mental health outcomes including anxiety, stress, and depression" (Schlosser 2022).  That is, research has suggested that practicing mindfulness can result in decreased anxiety and stress, and one possible explanation is that this works through decreasing the amount of time we spend engaging in repeated negative thinking.  Researchers in this study are primarily interested in quantifying the impact of mindfulness on repeated negative thinking.


## Data Exploration
### Exercise: Graphical Summary
> Construct a graphic summarizing the relationship between the level of RNT and mindfulness.  What does the graphic communicate (keeping in mind the research objective)?

```r
ggplot() +
  aes() +
  labs()
ggplot(data = meditation) +
  aes(y = negthinking,
      x = mindfulness) +
  labs(y = "Level of RNT (higher is worse)",
       x = "Mindfulness (higher is better)") +
  geom_point()

The relationship is somewhat complex. Increasing the level of mindfulness is associated with increased RNT up until participants reach a mindfulness of about 3. For mindfulness values above 3, increased mindfulness is associated with decreased RNT. _This might suggest that mindfulness practices alone are insufficient for decreasing RNT; in fact, the data suggests that an individual's ability to practice self-compassion plays a key role in an being able to capitalize on the benefits of mindfulness practices._

Exercise: Correlation

Which of the following most likely represents the correlation coefficient relating the level of RNT and mindfulness in this study?

  • -4.9
  • -0.93
  • -0.34
  • 0.34
  • 0.93
  • 4.9

From the graphic, we see that, overall, there is a slight decreasing trend between the two variables. However, that trend is not extreme; this weak negative correlation suggests a negative value closer to 0 than to 1. This can also be computed using the following code: wzxhzdk:3

Fitting a Linear Model

Exercise: Model for Data Generating Process

Using mathematical notation, write the model for the data generating process viewing the level of negative thinking as a linear function of an individual's mindfulness.

$$(\text{RNT})_i = \beta_0 + \beta_1 (\text{Mindfulness})_i + \varepsilon_i$$ We note that while we did not necessarily feel a linear relationship was most appropriate here when examining the graphic, the prompt asked us to assume this particular structure.

Exercise: Computing Least Squares Estimates

Compute the least squares estimates for the parameters in the model specified in the previous part. Assuming the deterministic portion of that model is correctly specified, interpret the slope in the context of this problem.

meditation.model = specify_mean_model()

estimate_parameters()
meditation.model = specify_mean_model(negthinking ~ 1 + mindfulness, 
                                      data = meditation)

estimate_parameters(meditation.model)

For each 1-unit increase in an individual's mindfulness score, their RNT score tends to decrease by 4.9, on average.

Exercise: Estimating Mean Response

Consider individuals who score a 4 on the Mindsens index. Using this data, and assuming the deterministic portion of the model is correctly specified, what would we expect the average RNT score for these individuals to be?

meditation.model = specify_mean_model(negthinking ~ 1 + mindfulness, 
                                      data = meditation)
estimate_mean_response()
estimate_mean_response(meditation.model, mindfulness = 4)

Exercise: Hypotheses

Using mathematical notation, specify the null and alternative hypotheses which capture the following research question: is there evidence that an individual's RNT level is linearly related to their mindfulness?

$$H_0: \beta_1 = 0 \qquad \text{vs.} \qquad H_1: \beta_1 \neq 0$$

Exercise: Performing Inference with CI

Assuming the data is consistent with the conditions of the classical regression model, compute the appropriate 95% confidence interval for each of the parameters. Based on the analysis, what conclusions can we draw regarding the research objective?

estimate_parameters()
estimate_parameters(meditation.model,
                    confidence.level = 0.95,
                    assume.constant.variance = TRUE,
                    assume.normality = TRUE)

We note that the 95% CI for the slope (-5.7, -4.2) contains only negative values. Therefore, we have evidence that higher levels of mindfulness are associated with lower levels of RNT. It is plausible that those who practice mindfulness techniques tend to have lower levels of repeated negative thinking, which might improve anxiety.


reyesem/IntroAnalysis documentation built on March 29, 2025, 3:29 p.m.