test_interaction {InteractionPoweR} | R Documentation |
Test interaction
Description
Test the interaction from a single simulated data set.
Usage
test_interaction(
data,
alpha = 0.05,
detailed_results = FALSE,
q = 2,
simple = FALSE
)
Arguments
data |
Simulated data set. Output of 'generate_interaction()'. |
alpha |
The alpha. At what p-value is the interaction deemed significant? Default is 0.05. |
detailed_results |
Should results beyond the linear model (change in R2, simple slopes, correlations, and confidence intervals) be returned? Default is FALSE. |
q |
Simple slopes. How many quantiles should x2 be split into for simple slope testing? Default is 2. Simple slope testing returns the effect-size (slope) of y~x1 for the two most extreme quantiles of x2. If q=3 then the two slopes are y~x1 for the bottom 33% of x2, and the top 33% of x2. |
simple |
For internal use. Default is FALSE. |
Value
Either a named list or a data frame containing the results of the regression y~x1+x2+x1*x2, the pearson's correlation between y, x1,x2, and x1x2, and the slopes of the simple slopes.
Examples
dataset <- generate_interaction(N = 250,r.x1.y = 0,r.x2.y = .1,r.x1x2.y = -.2,r.x1.x2 = .3)
test_interaction(data = dataset, alpha=0.05, q=2)