As far as I can understand, moderators are simply modeled using an interaction term. I am currently looking to run a priori power analysis to determine minimum sample size needed for a longitudinal regression with a moderator effect. Which package and functions in R would work well for this? Or any other software. The study tracks many subjects over multiple time periods.