Henri G. answered 01/09/23
Statistical Researcher using "Big Data" and Cluster Computing
If you're interested in examining the effect of a moderator, this is similar to assessing whether there is a statistical interaction. You mention there's a positive correlation, I'm wondering if you're just analyzing a standard Pearson's correlation, or whether you've implemented a regression model. If not, I'd suggest fitting either a linear regression (if you want to keep all your variables continuous as a score) or a logistic regression (if you want to make your outcome, anxiety, a binary yes/no variable based on some cutoff for the STAI).
Then, you can stratify by intervention in one of two ways: (1) subset your data so that you are running two models, Anxiety = Intercept + Beta*Stress among those without the intervention, and then the same regression model among those with the intervention; or (2) you can include an interaction term in your regression model, which would look like Anxiety = Intercept + Beta1*Stress + Beta2*Intervention + Beta3*Stress*Intervention.
If you do it the latter way, you'll end up with a p-value on that Beta3 coefficient for the interaction, which will directly test if there is a moderating effect (e.g., the effect of stress on anxiety changes in the presence of the intervention). A p-value < 0.05 generally indicates there's statistically significant evidence of an interactive effect here. For interpretation, though, you'll need to do a linear combination of the terms and add them together. So for example, if you're trying to say what the effect of stress is among the intervention group, accounting for this interaction, it would be Beta1*Stress+ Beta2*Intervention + Beta3*Stress*Intervention. If you want to talk about the effect of stress among those without the intervention, it would simply be Beta1*Stress (since Intervention = 0 which would set the Beta2 and Beta3 to 0).
That's generally how I would start approaching moderators in my model, and I'm happy to go into more detail if you'd like!