Anda di halaman 1dari 16

LECTURE 13:

UJI KESAMAAN RATA-


RATA POPULASI

Pelajari: Multivariate normal distribution. Chapter


4, p.149 J-W. And Ch 5 Inferences about a Mean
Inferences About a Mean Vector:
Univariate vs Multivariate

One of the central messages of multivariate analysis is that p


correlated variables must be analyzed jointly.
Let us start by recalling the univariate theory for determining
whether a specific value is a plausible value for the population
mean . From the point of view of hypothesis testing, this problem
can be formulated as a test of the competing hypotheses

Perhatikan uji kesamaan rata-rata populasi untuk univariat dimana


kita melakukan uji hipotesis dengan suatu harga yakni

Gunakan t-test (study!)


Perhatikan contoh pada Lecture 3:

Untuk kasus multivariat (kasus ini 2 variat), kita mengajukan uji hipotesis tentang vektor
rata-rata:

Untuk itu ambil sampel yang berukuran 3 untuk setiap variat. Telah dihitung bahwa mean

Untuk menguji hipotesis tersebut, gunakan statistik uji yang disebut sebagai statistik
Hotelling

 
 Perhatikan contoh p.213
Prosedur IML pada SAS:
Example 5.1 p.213

dm';log; clear; out; clear;‘;


Outputnya adalah sbb:
Cara lain untuk menghitung statistik T2 Hotelling di atas.
Perhatikan manipulasi penyusunan data matrix.
Outputnya:
Exercise : (dengan R)
lecture3=function (){ t2=3*t(hipomu)%*%sinv%*
x=matrix(c(6,10,8,9,6,3),3,2) %hipomu
I=matrix(1,3,1) print(x)
It=t(I) print(I)
mean=(It%*%x)/3 print(It)
xm=x-I%*%mean print(mean)
xmt=t(xm) print(xm)
s=(1/2)*xmt%*%xm print(xmt)
sinv=solve(s) print(s)
hipo=matrix(c(9,5),2,1) print(hipomu)
hipomu=t(mean)-hipo print(sinv)
print (t2)
}
Selanjutnya nilai T2 Hotelling ini dibandingkan dengan nilai kritis
distribusi F untuk alpha tertentu dengan transformasi

untuk

diperoleh

Coding SAS
 p=2; n=3;
 df1=p; df2=n-p; alpha=0.1;
 ftable=finv(1-alpha,df1,df2);
 f=(((n-1)*p)/(n-p))*ftable;
 print ftable f;
 run;
Tugas 4 (lihat di GC)
Testing a multivariate mean vector with T2
Gunakan sweat data (p.214 J-W).

Perspiration from 20 healthy females was analyzed. Three


components, X1 = sweat rate, X2= sodium content, and X3=
potassium content, were measured, and the results, which we
call the sweat data, are presented in Table 5.1 (p.215). Test the
hypothesis that

against

at level of significance
 Note: data tidak perlu diketik.
 Gunakan cara berikut, jika mungkin:
 1. Copy-paste data dari buku ke SAS/R, atau
 2. Copy-paste data ke Word. Highlite data yang
akan di copy, kemudian kemudian click insert-
table –convert text to table.
 dm'; log; clear; out; clear;';  proc iml;
 data sweat;  use sweat;
 input x1 x2 x3;  read all into x; * baca dan simpan data ke
 cards; dalam matrix x;
 3.7 48.5 9.3  n=nrow(x);
 5.7 65.1 8  one=j(n,1,1); * vektor n*1 yang memuat
 3.8 47.2 10.9 elemen 1;
 3.2 53.2 12  mean=(one`*x)/n;
 3.1 55.5 9.7  xm=x-one*mean;
 4.6 36.1 7.9
 s=(1/(n-1))*xm`*xm;
 2.4 24.8 14
 sinv=inv(s);
 7.2 33.1 7.6
 6.7 47.4 8.5
 hipo={4, 50, 10};
 5.4 54.1 11.3
 hipomu=mean`-hipo;
 3.9 36.9 12.7  t2=n*hipomu`*sinv*hipomu;
 4.5 58.8 12.3  p=3;
 3.5 27.8 9.8 df1=p; df2=n-p;
ftable=finv(0.90,df1,df2);
 4.5 40.2 8.4
f=((n-1)*p)/((n-p))*ftable;
 1.5 13.5 10.1 print x one; print mean; print xm;
 8.5 56.4 7.1 print hipomu; print s sinv; print t2;
 4.5 71.6 8.2 print f ftable;
run;
 6.5 52.8 10.9
 4.1 44.1 11.2
 5.5 40.9 9.4
 ;
HIPOMU
0.64
-4.6
-0.035
S SINV
2.8793684 10.01 -1.809053 0.5861553 -0.022086 0.2579687
10.01 199.78842 -5.64 -0.022086 0.0060672 -0.001581
-1.809053 -5.64 3.6276579 0.2579687 -0.001581 0.4018468
T2
9.7387729

F FTABLE
 8.1725725 2.4374339

Anda mungkin juga menyukai