Package 'simpr.interaction'

Title: Calculating Parameters for Simulation-Based Regression Interaction Power Analysis
Description: Provides functionality for analytically calculating parameters (via the InteractionPoweR package) useful for simulation of moderated multiple regression, based on the correlations among the predictors and outcome and the reliability of predictors.
Authors: Ethan C. Brown [aut, cre] (ORCID: <https://orcid.org/0000-0003-3419-7465>)
Maintainer: Ethan C. Brown <[email protected]>
License: GPL-2
Version: 0.1.0
Built: 2026-05-10 09:47:07 UTC
Source: https://github.com/statisfactions/simpr.interaction

Help Index


Extract simulation parameters for power analysis of regression interaction models.

Description

Extract useful simulation parameters for regression.interaction models, computed via change in R2. This function is largely a wrapper for power_interaction_r2() from the InteractionPoweR package which calculates useful quantities based on correlations and reliabilities. This function then massages the output into a more convenient format for simpr as well as calculating R2 and sigma.

Usage

interaction_params(
  r.x1.y,
  r.x2.y,
  r.x1x2.y,
  r.x1.x2,
  rel.x1 = 1,
  rel.x2 = 1,
  rel.y = 1
)

Arguments

r.x1.y

Pearson's correlation between x1 and y. Must be between -1 and 1. Has no default value. Can be a single value or a vector of values.

r.x2.y

Pearson's correlation between x2 and y. Must be between -1 and 1. Assumed to be the 'moderator' in some functions. Has no default value. Can be a single value or a vector of values.

r.x1x2.y

Pearson's correlation between the interaction term x1x2 (x1 * x2) and y. Must be between -1 and 1. Has no default value. Can be a single value or a vector of values.

r.x1.x2

Pearson's correlation between x1 and x2. Must be between -1 and 1. Has no default value. Can be a single value or a vector of values.

rel.x1

Reliability of x1 (e.g. test-retest reliability, ICC, Cronbach's alpha). Default is 1 (perfect reliability). Must be greater than 0 and less than or equal to 1.

rel.x2

Reliability of x2 (e.g. test-retest reliability, ICC, Cronbach's alpha). Default is 1 (perfect reliability). Must be greater than 0 and less than or equal to 1.

rel.y

Reliability of y (e.g. test-retest reliability, ICC, Cronbach's alpha). Default is 1 (perfect reliability). Must be greater than 0 and less than or equal to 1.

Value

A single-row dataframe with the following

Examples

params_all = interaction_params(r.x1.y = -0.18,
 r.x2.y = -0.03,
 r.x1.x2 = 0.64,
 r.x1x2.y = 0.1,
 rel.y = 0.79,
 rel.x1 = 0.89,
 rel.x2 = 0.95)