Estimates the set of feasible combinations of individuals and observations per individual needed to obtain a statistical power given an effect size, alpha level and metric of interest. Based on Pirla, Taquet and Quoidbach (2021).

samplingAD(power = 0.8, metric, r, p.value = 0.05)

Arguments

power

Minimum required power. Input as a number from 0.01 to 0.99. Defaults to 0.8 (80% power).

metric

Metric of interest. Must be a single character from "Average", "Rel.SD", "SD", "RMSSD", "TKEO", "PAC" or "Autocorrelation".

r

Number from 0.01 to 0.99 indicating the expected effect size (Pearson correlation) of interest.

p.value

Alpha level. Must be one of the following numbers: 0.01, 0.05, 0.001, 0.005, 0.001. Defaults to 0.05.

References

Pirla, Taquet and Quoidbach (2021). ADD REFERENCE

Examples

samplingAD(power=0.8, metric="SD", r=0.1, p.value=0.01)
#> 
#> Number of individuals and affect reports per individual (samples) needed to achieve a power of 80 % or more to detect a Pearson correlation of size r = 0.1 between the Standard Deviation (SD) in affect. and a given variable using a two-tailed t-test and an alpha of 0.01 .
#> 
#>  Power Individuals Samples
#>    0.8        2820       5
#>    0.8        2000      10
#>    0.8        1790      15
#>    0.8        1570      20
#>    0.8        1280      25
#>    0.8        1260      35
#>    0.8        1240      40
#>    0.8        1220      45
#> 
#>  -----------------------
#> Power is estimated through a linear interpolation using the sample combinations included in our main analyses.We refrain from making power extrapolations and therefore, only consider sampling approaches that range between 10 and 5120 participants and from 5 to 50 affect reports per participant (samples). The following table presents the minimal sampling combinations included in our main analyses that yielded the specified power: 
#> 
#>  Power Individuals Samples
#>   1.00        5120       5
#>   0.96        2560      10
#>   0.80        1280      25
#> 
#>  -----------------------
#> How to report:
#> 
#> Power analysis for affect dynamic studies (Pirla et al., 2021) suggests that our sampling strategy achieved a statistical power of 80 % to detect a Pearson correlation of size r = 0.1 using a two-tailed t-test with an alpha of 0.01 .
#>  -----------------------
#> Reference:
#> 
#> Pirla, S., Taquet, M., & Quoidbach, J. (2021). Measuring Affect Dynamics: An Empirical Framework. https://doi.org/10.31219/osf.io/x2ywa