Message Boards Message Boards

GROUPS:

Perform a regression analysis with a moderating variable?

Posted 2 months ago
698 Views
|
2 Replies
|
1 Total Likes
|

Hi all! I'm quite new to Mathematica (and coming from SPSS) and now I feel a bit lost. I would like to run a regression analysis, with one moderator variable. If this is helpful, I attached a sample file. If you could provide some guidance, or some initial steps to take, I would really appreciate it. Thanks a lot

2 Replies

It's extremely easy. The term "moderator variable" so far as I can determine simply means that the basis functions of the regression should not simply be the variables themselves. Suppose, for example that the effect of the x dependent variable on the independent variable z depended not just on x but on the value of y. One could write the following code:

LinearModelFit[data,{x,y,x*y},{x,y}]

In your data, it's not clear to me which of the variables V1,V2,V3, and V4, the "Moderator Variable" is supposed to moderate or if the relationship was multiplicative, but if it were V3 and multiplicative, you could write:

LinearModelFit[data,{V1,V2,V3,V4,V3*ModeratorVariable},{ModeratorVariable,V1,V2,V3,V4}]

Another option would be to use Predict, a form of automated machine learning (AutoML) in which you wouldn't have to specify the model at all, and the data would do the talking.

Posted 2 months ago

Hi Seth, thanks a lot for your response

Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract