Message Boards Message Boards

0
|
5375 Views
|
2 Replies
|
1 Total Likes
View groups...
Share
Share this post:

Perform a regression analysis with a moderating variable?

Posted 2 years ago

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

POSTED BY: Maya Novak
2 Replies
Posted 2 years ago

Hi Seth, thanks a lot for your response

POSTED BY: Maya Novak

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 BY: Seth Chandler
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