Effects of a continuous variable while modulating other binary variables What statistical test would be most appropriate to investigate the following?
I have a continuous dependent variable (Y).
I have three independent variables: one is continuous (Xc), two are binary (Xb1 and Xb2).
I would like to see how Xc affects Y, while also looking at the differences in Xb1 and Xb2.  For example, I want to see how age (Xc) affects memory (Y), while also looking at dementia risk (high vs low) and sex (M vs F).  So, does older age affect memory more in high or low dementia risk? Are females more likely to experience memory declines in old age compared to males?
I was thinking of a multiple linear regression, but then would I need to be interpreting interactions somehow?  Not sure what else to use.
Thank you!
 A: Yes you can use a multivariable regression model here. In R it would look like:
Y ~ Xb1 * Xb2 * Xc

This will fit a global intercept, the estimated value of Y when all the other variables are zero (or at their reference level if categorical). For this reason you might want to centre Y
It will also fit main effects for each variable, telling you the estimated change in Y associated with a 1 unit change in each variable (or associated withthe difference between the level of the categorical variables) when the other variables are zero (or at their reference level). For example the change in memory for each addtional unit of age, in males with low dementia risk.
You will also get two-way interactions tell you how the main effects vary at different levels/values of the other variable, when the one not involved in the interaction is zero (or at its reference level). For example, the difference in the change in memory for each addtional unit of age, between males and females with low dementia risk.
And finally you will get the three-way interaction, telling you how the two-way intereractions vary with other variable. For example, the difference in the change in memory for each addtional unit of age, between males and females for those with high dementia risk compared to those with low dementia risk.
