VLT.STATS.POWER.POWER2CORRCOEF-CalculatestatisticalpowerforacorrelationtestbysimulationP=VLT.STATS.POWER.POWER2CORRCOEF(SAMPLE1,SAMPLE2,CORRELATIONS,...)Calculatesthestatisticalpowerofacorrelationtestbysimulation.Thisfunctionassessestheprobabilityofcorrectlydetectingasignificantcorrelationofaspecifiedmagnitude.Foreachtargetcorrelationvalueinthe`correlations`vector,itrunsmultiplesimulations.Ineachsimulation,itgeneratesnewdatabyre-pairing`sample1`and`sample2`tohavethattargetrankcorrelation,andthenperformsastatisticaltesttoseeifasignificantcorrelationisfound.Thefractionofsimulationsthatyieldasignificantresultistheestimatedpower.Thismethodpreservestheexactmarginaldistributionsoftheoriginalsamples.Inputs:-SAMPLE1:Anumericalvectorofsamples.-SAMPLE2:Anumericalvectorofsamples,samesizeasSAMPLE1.-CORRELATIONS:Avectoroftargetcorrelationcoefficientstoexamine.OptionalName-ValuePairs:-'test'('corrcoef'|'corrcoefResample'):Thestatisticaltesttouse.'corrcoef'usesMATLAB's built-in `corr` function (t-test based). 'corrcoefResample' uses `vlt.stats.corrcoefResample` for a permutation-based test. Default is 'corrcoef'. - 'alpha' (0 < alpha < 1): The significance level. Default is 0.05. - 'numSimulations' (integer > 0): The number of simulations. Default is 1000. - 'resampleNum' (integer > 0): Number of resamples for 'corrcoefResample'. Default is 1000. - 'verbose' (logical): If true, displays progress. Default is true. - 'plot' (logical): If true, plots the power curve. Default is true. - 'titleText' (string): The title for the plot. - 'xLabel' (string): The x-axis label for the plot. - 'yLabel' (string): The y-axis label for the plot. Output: - P: A vector the same size as CORRELATIONS, indicating the fraction of simulations where the test yielded a significant correlation. Example: % Generate some data and calculate power sample1 = randn(1, 20); sample2 = randn(1, 20); correlations = -1:0.2:1; p = vlt.stats.power.power2corrcoef(sample1, sample2, correlations, 'test', 'corrcoef'); See also: VLT.STATS.POWER.IMPOSECORRELATIONBYREORDERING, CORR, VLT.STATS.CORRCOEFRESAMPLE