0
$\begingroup$

I perform a Logistic Regression in R which looks the folllowing:

logit <- glm(result~Condition+Strength, data = combined, family = binomial)

I am mainly interested in the effect of Condition on result while controlling for Strength. So far the effect is significant. Furthermore I want to include another variable called Focus which I expect to be a Moderator for the effect of Condition on result. Can anyone tell me how to do this, while still controlling for Strength, as without this controlling variable the effect completely disappears?

$\endgroup$
1
  • $\begingroup$ Not sure to understand the question. If you want to control for the effect of FOCUS in addition to STRENGTH, simply add FOCUS to your model (result ~ condition + strength + focus). If you find that including FOCUS in the model completely changes the estimates of the other variables, then your predictors might be highly correlated (Check the correlation matrix). $\endgroup$
    – Nicolas K
    Commented May 29, 2017 at 21:35

1 Answer 1

1
$\begingroup$

Can anyone tell me how to do this, while still controlling for Strength

logit <- glm(result ~ Condition*Focus + Strength, data = combined, family = binomial)

R will automatically calculate the main effects of Condition and Focus for you (assuming that you have set both as.factor()), so you don't have to specify the Condition + Focus part if you don't want to.

as without this controlling variable the effect completely disappears?

Do not simply include a covariate because it yields significant results; this can inflate Type I error and may be considered p-hacking unless you have a solid theoretical reason to include the covariate. Including it simply for statistical significance is frowned-upon.

$\endgroup$
1
  • $\begingroup$ Is it possible to test and visualise the moderation effect? $\endgroup$
    – JetLag
    Commented Nov 13, 2017 at 1:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.