9. Power Analysis - emboylen/Foxfish_chronology GitHub Wiki

A statistical power analysis is a statistical validation that one has correctly rejected the null hypothesis. It is the:

  • probability (rejecting the null hypothesis | the null hypothesis is false)
  • likelihood of not committing a Type II error (false negative)
Null Hypothesis (H0) is true Null Hypothesis (H0) is false
Reject Null Hypothesis (H0) Type α error
Over reacting
False Positive
Correct Outcome
True Positive
Do not reject Null Hypothesis (H0) Correct Outcome
True Negative
Type β error
False Negative
Under reacting

Note:

  • 1-α = confidence level of the test
  • 1-β = statistical power of the test

Given you have at least three of the following, you can work out the fourth:

  • significance level
  • effect size
  • sample size
  • power of test

Hence, it is very easy to simply calculate the power of a statistical test given the sample size and significance and estimating the effect size.

However, the effect size is a very important variable (particularly in my analysis). I do not want to estimate the effect size, so I will try to determine the effect size through simulation (bootstrapping).

My simulation takes a pilot study of otolith increment measurements and simulated temperature data and re-samples these 1000s of times and measures the simulated correlation between increment size and temperature. The result is a graph plotting the sample size needed (x) against the probability of obtaining a significant result (y).


####Details of simulation

Each trial of the Power Analysis will involve the generation of a set of scaled temperatures and year effects on the standardised growth zone widths over a time series of years. A sample of a specified size will then be drawn, with replacement, from the age composition of the fish in the pilot sample.

Standardised growth zone widths will then be generated for each growth zone within the otoliths of the sampled fish. The standardised widths will be averaged over all otoliths for which a growth zone has been recorded for the growth year and for which the fish from which the otolith was drawn was of a necessary age.

The correlation between the mean of the standardised widths and the scaled temperatures within the time series will be calculated and tested to determine its statistical significance. If the value is found to be statistically significant, it will be concluded that the sample size for that trial was adequate to detect the relationship between growth zone width and temperature.

Assumptions of the model:

  1. Simulated temperature year effect variables are drawn for each growth year from a bivariate normal distribution ( mean of zero and variance of 1) with correlation, rho
  2. The value of the correlation coefficient, rho, is input at the start of the model (default = 0.5)
  3. The first five growth zones in the otolith will be excluded from analysis
  4. Younger fish, i.e. fish with less than five opaque zones, will be excluded from the analysis as these fish will not have sufficient growth zones to allow fitting of a negative exponential curve, with which growth zone widths could be standardised.
  5. Data collection period is specified
  6. The sample size within each year of sampling is specified (default = 999)
  7. The growth zones measurements of the otoliths have been standardised, and we be re-sampled from a normal distribution, where the mean of the distribution is the year effect for the corresponding year of growth and the standard deviation is the grand standard deviation of the mean otolith measurement
  8. The correlation between the mean growth zone and simulated temperature will be calculated using a Student's t, on n-2 degrees of freedom, where alpha will be specified (default = 0.05)
⚠️ **GitHub.com Fallback** ⚠️