Power analysis¶
Between-group minimum sample size¶
The minimum sample size, number of subjects per group (study arm), necessary to detect an atrophy between groups was computed based on a two-sample (unpaired) bilateral t-test using the following formula (Wang and Ji 2020; Wittes 2002):
\(n_{unpaired} = \frac{(z_{α/2} + z_{β})^2(\sigma_{(:,r1)}+\sigma_{(:,rX)})^2}{\Delta_{sub} ^2}\)
Where \(n_{unpaired}\) is the minimum sample size required to differentiate between groups with a given power (\(z_{β}\) corresponds to the power z score, e.g. 80% power gives β=0.2 and \(z_{β}\) corresponds to the significance level z score, e.g. 5% level of significance gives 𝛂=0.05 and \(z_{α/2}\) group is the difference of the mean CSA between the groups.
# create a dataframe from the csv files
df_vert = pd.DataFrame(data)
pd.set_option('display.max_rows', None)
# identify rows with missing values
print("Remove rows with missing values...")
lines_to_drop = df_vert[df_vert['MEAN(area)'] == 'None'].index
df_vert['subject'] = list(sub.split('data_processed/')[1].split('/anat')[0] for sub in df_vert['Filename'])
# remove rows with missing values
df_vert = df_vert.drop(df_vert.index[lines_to_drop])
Within-subject minimum sample size¶
the minimum sample size necessary to detect an atrophy in a within-subject (repeated-measures) study was computed based on a two-sample bilateral paired t-test using the following formula (Altmann et al. 2009):
\(n_{paired} = \frac{(z_{α/2} + z_{β})^2(\sigma_{diff})^2}{\Delta_{sub} ^2}\)
Where \(\sigma_{diff}\) is the standard deviation between longitudinal CSA measures across subjects and \(\Delta_{sub}\) is the mean of the difference between longitudinal CSA measures.
# create a dataframe from the csv files
df_vert = pd.DataFrame(data)
pd.set_option('display.max_rows', None)
# identify rows with missing values
print("Remove rows with missing values...")
lines_to_drop = df_vert[df_vert['MEAN(area)'] == 'None'].index
df_vert['subject'] = list(sub.split('data_processed/')[1].split('/anat')[0] for sub in df_vert['Filename'])
# remove rows with missing values
df_vert = df_vert.drop(df_vert.index[lines_to_drop])