Open main menu

Biolecture.org β

Ttest-perl

Revision as of 18:23, 7 May 2018 by imported>MSL (Created page with "<p># ttest</p> <p>my @group1 = ();<br /> my @group2 = ();</p> <p># 두 샘플의 입력과정 어떻게 하죠?</p> <p>my $size1 = @group1;<br /> my $size2 = @group2;<br /> my...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

# 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))

  1. 다음 과정을 더 작성하자