Quantcast
Channel: Statalist
Viewing all articles
Browse latest Browse all 73374

How can I add one more variable at each time while running a loop?

$
0
0
HI,
I want to run different models on different interaction terms by using a loop.
I have 3 moderating variables(x1, x2, x3) and 1 independent variable(x0). I want to create a loop where gives me a result of all possible models showing like:
Model 1: y = x0
Model 2: y= x0 + x1 + x0*x1
Model 3: y= x0 + x2 + x0*x2
​Model 4: y = x0 + x1 + x0*x1 + x2 + x0*x2
Model 5: y= x0 + x1 + x0*x1 + x2 + x0*x2 + x3 + x0*x3

All suggestions would be appreciated. Thank you. Pawinee


Viewing all articles
Browse latest Browse all 73374

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>