Ttest-perl
From Biolecture.org
Revision as of 18:24, 7 May 2018 by imported>MSL
# ttest
my @group1 = ();
my @group2 = ();
# 두 샘플의 입력과정 어떻게 하죠?
my $size1 = @group1;
my $size2 = @group2;
my $sum1 = 0;
my $sum2 = 0;
for($i=0;$i<size1,$i++)
{
$sum1 += @group1[i];
}
for($i=0;$i<size2,$i++)
{
$sum2 += @group2[i];
}
my $mean1 = $sum1 / $size1
my $mean2 = $sum2 / $size2
my $stdv1 = standardDeviation(@group1, 0)
my $stdv2 = standardDeviation(@group2, 0)
my $t = ($mean1 - $mean2)/sqrt((($stdv1**2)/$size1 + ($stdv2**2)/$size2))
# 다음 과정을 더 작성하자