Anda di halaman 1dari 9

TUGAS KULIAH

MATA KULIAH : Analisis Multivariat

TUGAS KE- : 3 (Tiga)

TANGGAL : 25 November 2019

DEADLINE : 1 Minggu

MATERI : 1. Mengolah data sweet dengan PROC IML


2. Mengolah data bisit dengan PROC GML MANOVA
(Menggunakan SPSS)

DISUSUN OLEH

NAMA : NISHA THAHIRA

NIM : 1703111233

PROGRAM STUDI S1 STATISTIKA


JURUSAN MATEMATIKA

FAKULTAS MATEMATIKA DAN ILMU PENGETAHUAN ALAM


UNIVERSITAS RIAU
2019
1. Kerjakan data sweet dengan menggunakan PROC IML

• 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.
• Test the hypothesis H0 : 𝜇 ’ = [4, 50, 10] against H1 : 𝜇 ’ ≠ [4, 50, 10] at the level of
significance 𝛼 = 10%

Penyelesaian :

Untuk menyelesaikan permasalahan diatas, kita dapat menggunakan prosedure IML melalui
programan SAS dengan kode input sebagai berikut :

dm';log;clear;out;clear,';
title prosedure IML untuk manipulasi matrix;
data temp;
input x1 x2 x3;
cards;
3.7 48.5 9.3
5.7 65.1 8.0
3.8 47.2 10.9
3.2 53.2 12.0
3.1 55.5 9.7
4.6 36.1 7.9
2.4 24.8 14.0
7.2 33.1 7.6
6.7 47.4 8.5
5.4 54.1 11.3
3.9 36.9 12.7
4.5 58.8 12.3
3.5 27.8 9.8
4.5 40.2 8.4
1.5 13.5 10.1
8.5 56.4 7.1
4.5 71.6 8.2
6.5 52.8 10.9
4.1 44.1 11.2
5.5 40.9 9.4
;
proc iml;
use temp;
read all into x; *baca dan simpan data ke dalam matrix x;
n=nrow(x);
one=j(n,1,1); *vektor n*1 yang memuat elemen 1;
mean=(one`*x)/n;
xm=x-one*mean;
s=(1/2)*xm`*xm;
sinv=inv(s);
hipo={4, 50, 10};
hipomu=mean`-hipo;
t2=20*hipomu`*sinv*hipomu;
print x one;
print mean;
print xm;
print hipomu;
print s sinv;
print t2;
run;

Dari kode diatas, maka otput yang di hasilkan adalah :

prosedure IML untuk manipulasi matrix 1


04:56 Tuesday, November 25, 2003
X ONE
3.7 48.5 9.3 1
5.7 65.1 8 1
3.8 47.2 10.9 1
3.2 53.2 12 1
3.1 55.5 9.7 1
4.6 36.1 7.9 1
2.4 24.8 14 1
7.2 33.1 7.6 1
6.7 47.4 8.5 1
5.4 54.1 11.3 1
3.9 36.9 12.7 1
4.5 58.8 12.3 1
3.5 27.8 9.8 1
4.5 40.2 8.4 1
1.5 13.5 10.1 1
8.5 56.4 7.1 1
4.5 71.6 8.2 1
6.5 52.8 10.9 1
4.1 44.1 11.2 1
5.5 40.9 9.4 1

MEAN
4.64 45.4 9.965

XM
-0.94 3.1 -0.665
1.06 19.7 -1.965
-0.84 1.8 0.935
-1.44 7.8 2.035
-1.54 10.1 -0.265
-0.04 -9.3 -2.065
-2.24 -20.6 4.035
2.56 -12.3 -2.365
2.06 2 -1.465
0.76 8.7 1.335
-0.74 -8.5 2.735
-0.14 13.4 2.335
-1.14 -17.6 -0.165
-0.14 -5.2 -1.565
-3.14 -31.9 0.135
3.86 11 -2.865
-0.14 26.2 -1.765
1.86 7.4 0.935
-0.54 -1.3 1.235
0.86 -4.5 -0.565

prosedure IML untuk manipulasi matrix 2

04:56 Tuesday, November 25, 2003

HIPOMU
0.64
-4.6
-0.035

S SINV
27.354 95.095 -17.186 0.0617006 -0.002325 0.0271546
95.095 1897.99 -53.58 -0.002325 0.0006387 -0.000166
-17.186 -53.58 34.46275 0.0271546 -0.000166 0.0422997

T2
1.025134

2. Kerjakan data bisnit dengen PROC GLM MANOVA

• Berikut ini adalah data keuangan untuk perusahaan yang masuk kategori “Most-
admired’ dan ‘Least-admired’.
Dengan menggunakan proc manova dan proc iml, uji apakah terdapat perbedaan vektor
rata-rata2 kedua kelompok perusahaan tersebut.
Penyelesaian :

Untuk menyelesaikan permasalahan diatas, kita dapat menggunakan prosedure GLM MANOVA
melalui programan SAS dengan kode input sebagai berikut :

dm';log;clear;out;clear;';
title MANOVA dengan prosedure GLM;
data hipo1way;
input group x1 x2;
cards;
1 0.158 0.182
1 0.210 0.206
1 0.207 0.188
1 0.280 0.236
1 0.197 0.193
1 0.227 0.173
1 0.148 0.196
1 0.254 0.212
1 0.079 0.147
2 -0.012 -0.031
2 0.036 0.053
2 0.038 0.036
2 -0.063 -0.074
2 -0.054 -0.119
2 0.000 -0.005
2 0.005 0.039
2 0.091 0.122
2 -0.036 -0.072 ;
proc glm data=hipo1way;
class group;
model x1 x2=group;
manova h=group/printe;
run;

Dari kode diatas, maka otput yang di hasilkan adalah :

MANOVA dengan prosedure GLM 1


10:10 Tuesday, November 25, 2003
The GLM Procedure

Class Level Information


Class Levels Values
group 2 1 2

Number of observations 18

MANOVA dengan prosedure GLM 2


10:10 Tuesday, November 25, 2003
The GLM Procedure
Dependent Variable: x1
Sum of
Source DF Squares Mean Square F Value Pr > F
Model 1 0.17111250 0.17111250 56.45 <.0001
Error 16 0.04850244 0.00303140
Corrected Total 17 0.21961494

R-Square Coeff Var Root MSE x1 Mean


0.779148 56.14998 0.055058 0.098056

Source DF Type I SS Mean Square F Value Pr > F


group 1 0.17111250 0.17111250 56.45 <.0001
Source DF Type III SS Mean Square F Value Pr > F
group 1 0.17111250 0.17111250 56.45 <.0001

MANOVA dengan prosedure GLM 3


10:10 Tuesday, November 25, 2003
The GLM Procedure

Dependent Variable: x2
Sum of
Source DF Squares Mean Square F Value Pr > F
Model 1 0.17681422 0.17681422 55.39 <.0001
Error 16 0.05107622 0.00319226
Corrected Total 17 0.22789044

R-Square Coeff Var Root MSE x2 Mean


0.775874 60.46387 0.056500 0.093444
Source DF Type I SS Mean Square F Value Pr > F
group 1 0.17681422 0.17681422 55.39 <.0001
Source DF Type III SS Mean Square F Value Pr > F
group 1 0.17681422 0.17681422 55.39 <.0001

MANOVA dengan prosedure GLM 4


10:10 Tuesday, November 25, 2003
The GLM Procedure
Multivariate Analysis of Variance

E = Error SSCP Matrix


x1 x2
x1 0.0485024444 0.0385285556
x2 0.0385285556 0.0510762222

Partial Correlation Coefficients from the Error SSCP Matrix / Prob > |r|

DF = 16 x1 x2
x1 1.000000 0.774090
0.0003
x2 0.774090 1.000000
0.0003

MANOVA dengan prosedure GLM 5


10:10 Tuesday, November 25, 2003
The GLM Procedure
Multivariate Analysis of Variance

Characteristic Roots and Vectors of: E Inverse * H, where


H = Type III SSCP Matrix for group
E = Error SSCP Matrix

Characteristic Characteristic Vector V'EV=1


Root Percent x1 x2
3.94047572 100.00 2.49989599 2.26154273
0.00000000 0.00 -6.72260555 6.61332553

MANOVA Test Criteria and Exact F Statistics for the Hypothesis of No Overall
group Effect
H = Type III SSCP Matrix for group
E = Error SSCP Matrix

S=1 M=0 N=6.5


Statistic Value F Value Num DF Den DF Pr > F
Wilks' Lambda 0.20240966 29.55 2 15 <.0001
Pillai's Trace 0.79759034 29.55 2 15 <.0001
Hotelling-Lawley Trace 3.94047572 29.55 2 15 <.0001
Roy's Greatest Root 3.94047572 29.55 2 15 <.0001

Anda mungkin juga menyukai