Difference between revisions of "Ttest-perl"

From Biolecture.org
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...")
 
imported>MSL
 
(One intermediate revision by the same user not shown)
Line 26: Line 26:
 
my $stdv2 = standardDeviation(@group2, 0)</p>
 
my $stdv2 = standardDeviation(@group2, 0)</p>
  
<p>my $t = ($mean1 - $mean2)/sqrt((($stdv1**2)/$size1 + ($stdv2**2)/$size2))<br />
+
<p>my $t = ($mean1 - $mean2)/sqrt((($stdv1**2)/$size1 + ($stdv2**2)/$size2))</p>
# 다음 과정을 더 작성하자</p>
+
 
 +
<p># 다음 과정을 더 작성하자</p>

Latest revision as of 18:24, 7 May 2018

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

# 다음 과정을 더 작성하자