LAMPIRAN
39
Lampiran 1 Deskripsi peubah-peubah penjelas Peubah
n
Minimum
Maksimum
Rataan
Median
Titik tengah
Ekonomi-Politik
1119
0
1
0.63
0.67
0.5
IdDemokrat
1119
1
5
2.72
2
3
IdGolkar
1119
1
5
2.42
2
3
IdPDIP
1119
1
5
2.38
2
3
Kualitas SBY
1098
1
10
7.9
8
5.5
Kualitas JK
1087
1
10
5.45
6
5.5
Kualitas Megawati
1092
1
10
5.86
6
5.5
Gender
1119
0
1
0.5
1
0.5
Usia
1110
17
95
40.42
39
56
Desa-Kota
1119
0
1
0.38
0
0.5
Suku
1115
0
1
0.4
0
0.5
Agama
1118
0
1
0.13
0
0.5
Pendidikan
1118
1
10
4.56
4
5.5
Pendapatan
1108
1
3
1.74
2
2
40
Lampiran 2 Dugaan parameter model regresi logistik multinomial
Model
Peubah Bebas
SBYBoediono / MegawatiPrabowo
JK-Wiranto / MegawatiPrabowo
SBYBoediono / JK-Wiranto
G / db / Sig
Analisis Satu Peubah Bebas Model 1
Konstanta Ekonomi-Politik
-0.888*** (0.189) 2.861*** (0.306)
-2.032*** (0.284) 2.186*** (0.438)
1.144*** (0.275) 0.675 (0.400)
95.974 / 2 / 0.000
Model 2
Konstanta IdDemokrat
-0.629*** (0.172) 0.559*** (0.064)
-1.293*** (0.242) 0.222* (0.091)
0.665** (0.226) 0.337*** (0.080)
90.893/ 2 / 0.000
Model 3
Konstanta IdGolkar
0.601*** (0.165) 0.096 (0.067)
-2.869 (0.288) 0.773*** (0.093)
3.470*** (0.268) -0.677*** (0.082)
85.198 / 2 / 0.000
Model 4
Konstanta IdPDIP
2.791*** (0.191) -0.774*** (0.066)
0.896*** (0.262) -0.633*** (0.097)
1.894*** (0.224) -0.141 (0.092)
154.238 / 2 / 0.000
Model 5
Konstanta Kualitas SBY
-4.752*** (0.392) 0.722*** (0.050)
-1.933*** (0.391) 0.166** (0.054)
-2.818***(0.455) 0.556*** (0.058)
310.501 / 2 / 0.000
Model 6
Konstanta Kualitas JK
1.020*** (0.189) -0.036 (0.034)
-6.423*** (0.554) 0.837*** (0.074)
7.443*** (0.543) -0.873*** (0.072)
243.774 / 2 / 0.000
Model 7
Konstanta Kualitas Megawati
6.212*** (0.389) -0.800*** (0.053)
4.956*** (0.436) -0.873*** (0.065)
1.257*** (0.232) 0.073 (0.044)
432.209 / 2 / 0.000
-0.641 (1.014)
-1.946 (1.371)
1.306 (1.182)
1.889** (0.584) 1.046*** (0.170) 0.035 (0.166) -1.037*** (0.165) 0.973*** (0.106) 0.124 (0.086) -1.045*** (0.110) -0.28 (0.277) -0.011 (0.011) 1.026*** (0.307) -0.20178 -1.657*** (0.415) 0.004 (0.074) -0.065 (0.192)
2.279** (0.838) 0.402 (0.219) 0.650** (0.211) -0.986*** (0.232) 0.155 (0.140) -1.946*** (1.371) 0.487*** (0.384) 0.487 (0.384) -0.028 (0.015) 0.123 (0.431) -0.605 (0.401) -1.201 (0.702) 0.087 (0.096) -0.051 (0.271)
-0.39 (0.706) 0.644*** (0.164) -0.615*** (0.155) -0.051 (0.189) 0.818*** (0.116) -1.123*** (0.116) 0.282*** (0.082) -0.23808 0.017 (0.012) 0.903** (0.348) -0.103 (0.332) -0.456 (0.666) -0.084 (0.075) -0.014 (0.222)
Analisis > 1 Peubah Bebas Model 8
Konstanta Ekonomi-Politik IdDemokrat IdGolkar IdPDIP Kualitas SBY Kualitas JK Kualitas Megawati Laki-laki Usia Perkotaan Suku Jawa NonMuslim Pendidikan Pendapatan
Keterangan: * p < 0.05, ** p < 0.01, *** p<0.001 ; Angka di dalam kurung adalah galat baku
1209.468 / 28 / 0.000
41
Lampiran 3 Statistik PPNP pasca-pemodelan regresi logistik multinomial Peubah
SBY-Boediono
JK-Wiranto
Megawati-Prabowo
0.5018*** (0.0415) 0.4166*** (0.0335) -0.1983*** (0.0458) -0.5303*** (0.0359) 0.8555*** (0.0149) -0.5324*** (0.0439) -0.6472*** (0.0377)
0.0397 (0.0277) -0.0718** (0.0246) 0.3674*** (0.0437) -0.061** (0.0239) -0.0876* (0.0425) 0.7033*** (0.0434) -0.1892*** (0.0321)
-0.5414*** (0.0437) -0.3449*** (0.0314) -0.1691*** (0.0337) 0.5913*** (0.0367) -0.7678*** (0.0437) -0.1709*** (0.0366) 0.8363*** (0.0228)
Analisis PPNP median > 1 peubah bebas Ekonomi-Politik 0.1572 (0.1043) IdDemokrat 0.3488*** (0.0675) IdGolkar -0.3366** (0.1224) IdPDIP -0.5835*** (0.1096) Kualitas SBY 0.9511*** (0.0145) Kualitas JK -0.7514*** (0.0757) Kualitas Megawati -0.5147*** (0.1177) Laki-laki -0.0719 (0.0509) Usia 0.0215 (0.1108) Perkotaan 0.1144* (0.047) Suku Jawa -0.0764 (0.0634) NonMuslim -0.2479* (0.1076) Pendidikan -0.068 (0.0878) Pendapatan -0.012 (0.0686)
0.0599 (0.0603) -0.1492** (0.056) 0.3844** (0.1253) -0.0706 (0.0489) -0.267 (0.1874) 0.9217*** (0.0313) -0.3626*** (0.1094) 0.0558 (0.0393) -0.1163 (0.0642) -0.0606 (0.0387) 0.0002 (0.0477) 0.0097 (0.0778) 0.0788 (0.075) 0.0015 (0.0571)
-0.2171* (0.0931) -0.1996*** (0.0567) -0.0478 (0.0435) 0.654*** (0.1162) -0.6841*** (0.188) -0.1703* (0.0697) 0.8772*** (0.0455) 0.0161 (0.035) 0.0948 (0.0946) -0.0539 (0.0295) 0.0762 (0.048) 0.2382* (0.0968) -0.0108 (0.0528) 0.0105 (0.0435)
Analisis PPNP rataan > 1 peubah bebas Ekonomi-Politik 0.1472* (0.0651) IdDemokrat 0.3541*** (0.0604) IdGolkar -0.1057 (0.0591) IdPDIP -0.5001*** (0.103) Kualitas SBY 0.9705*** (0.0092) Kualitas JK -0.7321*** (0.0641) Kualitas Megawati -0.7355*** (0.0636) Laki-laki -0.0393 (0.027) Usia -0.0302 (0.0678) Perkotaan 0.0831** (0.0266) Suku Jawa -0.0504 (0.0287) NonMuslim -0.1884* (0.0752) Pendidikan -0.0209 (0.0433) Pendapatan -0.0091 (0.0311)
0.0160 (0.0167) -0.0592* (0.023) 0.1229* (0.0505) -0.0129 (0.0148) -0.1251 (0.0959) 0.8438*** (0.049) -0.1183** (0.0458) 0.0229 (0.0141) -0.035 (0.0183) -0.0234 (0.0134) 0.0014 (0.0135) 0.0075 (0.0244) 0.0248 (0.0228) 0.0006 (0.015)
-0.1631** (0.0633) -0.2949*** (0.0615) -0.0172 (0.0337) 0.513*** (0.105) -0.8454*** (0.0993) -0.1117** (0.0433) 0.8538*** (0.0445) 0.0164 (0.0235) 0.0653 (0.0653) -0.0597** (0.0235) 0.0489 (0.0256) 0.1809* (0.0718) -0.0039 (0.0362) 0.0085 (0.0273)
Analisis PPNP titik tengah > 1 peubah bebas Ekonomi-Politik 0.3051** (0.1075) IdDemokrat 0.6874*** (0.0846) IdGolkar -0.0445 (0.1173) IdPDIP -0.5924*** (0.0914) Kualitas SBY 0.9605*** (0.013) Kualitas JK -0.1856* (0.0787) Kualitas Megawati -0.4735** (0.1501) Laki-laki -0.0689 (0.0984) Usia -0.1037 (0.1315) Perkotaan 0.204* (0.097) Suku Jawa -0.1285 (0.0963) NonMuslim -0.2982*** (0.0905) Pendidikan -0.0127 (0.1246) Pendapatan -0.0241 (0.1035)
0.1287 (0.0771) 0.0067 (0.0463) 0.2265* (0.1137) -0.158* (0.0799) -0.056 (0.0533) 0.9537*** (0.0293) -0.5125*** (0.1522) 0.0453 (0.0564) -0.1605 (0.0839) -0.0154 (0.0554) -0.0298 (0.0552) -0.05 (0.0542) 0.0615 (0.0731) -0.0048 (0.0586)
-0.4338*** (0.1199) -0.6941*** (0.0901) -0.182 (0.1601) 0.7504*** (0.0732) -0.9045*** (0.056) -0.7681*** (0.0799) 0.986*** (0.0065) 0.0236 (0.1165) 0.2642 (0.1556) -0.1887 (0.1148) 0.1583 (0.1131) 0.3482** (0.1064) -0.0488 (0.1536) 0.0289 (0.1235)
Analisis 1 peubah bebas Ekonomi-Politik IdDemokrat IdGolkar IdPDIP Kualitas SBY Kualitas JK Kualitas Megawati
Keterangan: * p < 0.05, ** p < 0.01, *** p<0.001 ; angka di dalam kurung adalah galat baku
42
Lampiran 4 Statistik RPP pasca-pemodelan regresi logistik multinomial Peubah SBY-Boediono Analisis 1 peubah bebas Ekonomi-Politik 0.4873*** (0.0549) IdDemokrat 0.1059*** (0.0100) IdGolkar -.0386** (0.0137) IdPDIP -.1281*** (0.0109) Kualitas SBY 0.1285*** (0.0064) Kualitas JK -.0445*** (0.0065) Kualitas Megawati -.0744*** (0.0051)
JK-Wiranto
Megawati-Prabowo
0.0176 (0.0377) -.0170* (0.0072) 0.0782*** (0.0097) -0.0118 (0.0084) -.0294*** (0.0051) 0.0562*** (0.0035) -.0225*** (0.0040)
-.5048*** (0.0482) -.0889*** (0.0092) -.0395*** (0.0113) 0.1400*** (0.0101) -.0991*** (0.0058) -0.0117 (0.0062) 0.0969*** (0.0037)
Analisis > 1 peubah bebas Ekonomi-Politik 0.0800 (0.0419) IdDemokrat 0.0693*** (0.0091) IdGolkar -0.0258* (0.011) IdPDIP -.0605*** (0.0122) Kualitas SBY 0.0825*** (0.0065) Kualitas JK -0.0384*** (0.0055) Kualitas Megawati -0.0368*** (0.0061) Laki-laki -0.0420* (0.0183) Usia 0.0001 (0.0007) Perkotaan 0.0827*** (0.0209) Suku Jawa -0.0371* (0.0187) NonMuslim -0.1205** (0.0371) Pendidikan -0.0032 (0.0049) Pendapatan -0.0042 (0.0134)
0.0324 (0.0309) -0.0218** (0.0068) 0.0332*** (0.0087) -0.0064 (0.0081) -0.0310*** (0.0053) 0.0523*** (0.0042) -.0228*** (0.0046) 0.0330* (0.014) -0.0008 (0.0005) -0.0336* (0.0154) -0.0004 (0.0144) 0.0048 (0.0272) 0.0039 (0.0036) 0.0007 (0.0102)
-0.1124*** (0.0333) -.0475*** (0.0071) -0.0073 (0.0085) 0.0669*** (0.0105) -0.0515*** (0.0056) -0.0139*** (0.0041) 0.0596*** (0.0044) 0.0091 (0.0146) 0.0007 (0.0006) -0.0491** (0.0168) 0.0375* (0.0152) 0.1158*** (0.0323) -0.0007 (0.0038) 0.0035 (0.0102)
Keterangan: * p < 0.05, ** p < 0.01, *** p<0.001 ; angka di dalam kurung adalah galat baku
43
Lampiran 5 Program SAS penghitungan PPNP dan RPP options pageno=1 pagesize=180 linesize=150; libname tesis 'D:\pasca ipb stt\Tesis Deni\Dataset'; PROC CORR data=tesis.pilpres2009 nomiss outp=corr noprint; VAR presiden B V_2 suku2 C income3 V_146 agama ekopolsby demokrat_id5 golkar_id5 pdip_id5 sukasby10 sukajk10 sukaMegawati10 ; weight w_pilpres_kpu; run; PROC LOGISTIC data=tesis.pilpres2009 covout outest=coef_cov_like noprint; model presiden= B V_2 suku2 C income3 V_146 agama ekopolsby demokrat_id5 golkar_id5 pdip_id5 sukasby10 sukajk10 sukaMegawati10 /link=glogit; weight w_pilpres_kpu/normalize; run;
data DATASET (KEEP=presiden B V_2 suku2 C income3 V_146 agama ekopolsby demokrat_id5 golkar_id5 pdip_id5 sukasby10 sukajk10 sukaMegawati10 w_pilpres_kpu); set tesis.pilpres2009; run; proc iml; use tesis.pilpres2009; /*trasfer dataset ke matriks*/ read all var{presiden B V_2 suku2 C income3 V_146 agama ekopolsby demokrat_id5 golkar_id5 pdip_id5 sukasby10 sukajk10 sukaMegawati10 w_pilpres_kpu} into DATASET; /*variabel independen yang digunakan*/ varnames = {presiden B V_2 suku2 C income3 V_146 agama ekopolsby demokrat_id5 golkar_id5 pdip_id5 sukasby10 sukajk10 sukaMegawati10 w_pilpres_kpu}; /*listwise deletion*/ miss_DATASET=nmiss(DATASET); obs_miss_DATASET=miss_DATASET[,+]; idx_nomiss=loc(obs_miss_DATASET=0); DATASET=DATASET[idx_nomiss,]; n_nomissing=nrow(DATASET); /*-----------------*/ create DATASET from DATASET[colname=varnames]; append from DATASET; quit;
proc means data=DATASET median n noprint; OUTPUT OUT=median median=med1-med15; weight w_pilpres_kpu; run; proc iml; n_sim=2; /* jumlah beta yang didraw*/ replikasi=1; /* jumlah replikasi subsample*/ n_rand=100; /* ukuran subsampel */ k=3; /* jumlah kategori variabel respon */ use tesis.pilpres2009; /*trasfer dataset ke matriks*/ read all var{presiden B V_2 suku2 C income3 V_146 agama ekopolsby demokrat_id5 golkar_id5 pdip_id5 sukasby10 sukajk10 sukaMegawati10} into YX; /*variabel independen yang digunakan*/ variabel={'Laki-laki', 'Usia', 'SukuJawa', 'Perkotaan', 'Income', 'Pendidikan', 'NonMuslim', 'Ekonomi-Politik', 'IDDEMOKRAT', 'IDGOLKAR', 'IDPDIP', 'Tkh:SBY', 'Tkh:JK', 'Tkh:Megawati'}; /*label variabel independen*/
44
use corr; /*transfer OUTPUT proc corr ke matriks*/ read all into corr; stdev_x=corr[2,2:ncol(corr)]; stdev_x=stdev_x`; /*listwise deletion*/ miss_YX=nmiss(YX); obs_miss_YX=miss_YX[,+]; idx_nomiss=loc(obs_miss_YX=0); YX=YX[idx_nomiss,]; n_nomissing=nrow(YX); /*-----------------*/ print 'n listwise deletion'; print n_nomissing; free miss_YX obs_miss_YX idx_nomiss; X=YX[,2:ncol(YX)]; MINMAXMED=J(3,ncol(X),0); MINMAXMED[1,]=X[><,]; MINMAXMED[2,]=X[<>,]; use MEDIAN; /*transfer OUTPUT proc means ke matriks*/ read all into MEDIAN; MINMAXMED[3,]=MEDIAN[,4:ncol(MEDIAN)]; *untuk midpoint--> MINMAXMED[3,]=(MINMAXMED[1,]+MINMAXMED[2,])/2; mattrib MINMAXMED rowname=({'Min' 'Max' 'Median'}) colname=({'Laki-laki' 'Usia' 'SukuJawa' 'Perkotaan' 'Income' 'Pendidikan' 'NonMuslim' 'Ekonomi-Politik' 'IDDEMOKRAT' 'IDGOLKAR' 'IDPDIP' 'Tkh:SBY' 'Tkh:JK' 'Tkh:Megawati'}); print MINMAXMED; X=J(nrow(X),1,1)||X; /*matrix rancangan untuk model dengan konstanta*/ iv=ncol(X); use coef_cov_like; ke matriks*/ read all into coef_cov_like;
/*transfer
covariance koefisien regresi
teta=coef_cov_like[1,1:ncol(coef_cov_like)-1]; /* vektor koefisien regresi*/ cov=coef_cov_like[2:nrow(coef_cov_like),1:ncol(coef_cov_like)-1]; /* matriks covariance koefisien regresi */ free coef_cov_like; CALL vnormal(teta_sim, teta`, cov, n_sim); /*simulasi monte-carlo untuk teta*/
/* ==================== Design matrix Covariance ======================*/ cov_row=J(ncol(cov),ncol(cov),0); m=1; do i=1 to k-1; k_plus=i; do j=1 to iv; cov_row[m,]=cov[k_plus,]; k_plus=k_plus+k-1; m=m+1; end; end;
cov_est=J(ncol(cov),ncol(cov),0); m=1; do i=1 to k-1; k_plus=i; do j=1 to iv; cov_est[,m]=cov_row[,k_plus];
45
k_plus=k_plus+k-1; m=m+1; end; end; /* --------------------------------------------------------------------*/ free cov k_plus; /* ==================== Design matrix Beta_Asli ======================*/ beta_asli=J(iv,k-1,0); /*template beta awal*/ f=1; g=f+k-2; do t=1 to iv; /*regrouping koefisien2 berdasarkan kategori respon*/ beta_asli[t,]=teta[1,f:g]; f=g+1; g=f+k-2; end; beta_asli=beta_asli||J(nrow(beta_asli),1,0); /* ---------------------------------------------------------------------*/ var_p_min=J(iv-1,k,0); var_p_max=J(iv-1,k,0);
/* PPNP MIN TO MAX METODE DELTA*/ do p=1 to iv-1; x_set_min=1||MINMAXMED[3,]; x_set_min[1,p+1]=MINMAXMED[1,p]; x_set_max=1||MINMAXMED[3,]; x_set_max[1,p+1]=MINMAXMED[2,p]; exp_XB_min=exp(x_set_min*beta_asli); denum_min=repeat(exp_XB_min[,+],1,k); /*matrix denumerator dalam pred prob*/ prob_min=exp_XB_min/denum_min; /*pred prob_i untuk sertiap ovservasi*/ free exp_XB_min denum_min; exp_XB_max=exp(x_set_max*beta_asli); denum_max=repeat(exp_XB_max[,+],1,k); /*matrix denumerator dalam pred prob*/ prob_max=exp_XB_max/denum_max; /*pred prob_j untuk sertiap ovservasi*/ free exp_XB_max denum_max; PPNP=PPNP//(prob_max-prob_min); free prob_max prob_min; start F_ROSEN(beta_fungsi) global(iv, k, x_set); exp_B=J(1,k,0); dpdb = j(k,1,0.); sv=1; ev=iv; do i=1 to k; dpdb[i]= exp((beta_fungsi[1,sv:ev])*x_set`) / ( exp(beta_fungsi[1,1:iv]*x_set`) + exp(beta_fungsi[1,iv+1:2*iv]*x_set`) + exp(beta_fungsi[1,2*iv+1:3*iv]*x_set`) ); sv=ev+1; ev=sv+iv-1; end; return(dpdb); finish F_ROSEN;
do minmax=1 to 2; parms = k; do i=1 to k; beta_fungsi=beta_fungsi||(beta_asli[,i])`; end; if minmax=1 then x_set=x_set_min; else x_set=x_set_max; CALL NLPFDD(fun,jac,crpj,"F_ROSEN",beta_fungsi,parms);
46
jac=jac[,1:iv*(k-1)]; do i=1 to k; if minmax=1 then var_p_min[p,i]=jac[i,]*cov_est*(jac[i,])`; else var_p_max[p,i]=jac[i,]*cov_est*(jac[i,])`; end; free beta_fungsi jac i fun cprj; end; end; /*-----------------*/ se_delta=sqrt(var_p_min + var_p_max); z=PPNP/se_delta; p_val=2*(1-cdf('normal',abs(z),0,1)); mattrib PPNP rowname=({'Laki-laki' 'Usia' 'SukuJawa' 'Perkotaan' 'Income' 'Pendidikan' 'NonMuslim' 'Ekonomi-Politik' 'IDDEMOKRAT' 'IDGOLKAR' 'IDPDIP' 'Tkh:SBY' 'Tkh:JK' 'Tkh:Megawati'}) colname=({'SBY-Boediono' 'JK-Wiranto' 'Megawati-Prabowo'}); mattrib z rowname=({'Laki-laki' 'Usia' 'SukuJawa' 'Perkotaan' 'Income' 'Pendidikan' 'NonMuslim' 'Ekonomi-Politik' 'IDDEMOKRAT' 'IDGOLKAR' 'IDPDIP' 'Tkh:SBY' 'Tkh:JK' 'Tkh:Megawati'}) colname=({'SBY-Boediono' 'JK-Wiranto' 'Megawati-Prabowo'}); mattrib se_delta rowname=({'Laki-laki' 'Usia' 'SukuJawa' 'Perkotaan' 'Income' 'Pendidikan' 'NonMuslim' 'Ekonomi-Politik' 'IDDEMOKRAT' 'IDGOLKAR' 'IDPDIP' 'Tkh:SBY' 'Tkh:JK' 'Tkh:Megawati'}) colname=({'SBY-Boediono' 'JK-Wiranto' 'Megawati-Prabowo'}); mattrib p_val rowname=({'Laki-laki' 'Usia' 'SukuJawa' 'Perkotaan' 'Income' 'Pendidikan' 'NonMuslim' 'Ekonomi-Politik' 'IDDEMOKRAT' 'IDGOLKAR' 'IDPDIP' 'Tkh:SBY' 'Tkh:JK' 'Tkh:Megawati'}) colname=({'SBY-Boediono' 'JK-Wiranto' 'Megawati-Prabowo'}); print PPNP; print se_delta; print z; print p_val;
replikasi_sukses=0; /* DRAW SUBSAMPLE BERUKURAN N_RAND SEBANYAK REPLIKASI */ do ulang=1 to replikasi; /*buat subsampel X berukuran n_rand x iv*/ rand_index=round((ranuni(J(n_rand,1,0))*nrow(X))+J(n_rand,1,0.5)); X_Rand_temp=J(n_rand,ncol(X),0); do r=1 to n_rand; X_Rand_temp[r,]=X[rand_index[r,],]; end; X_invertible=X_Rand_temp[,2:ncol(X_Rand_temp)]; Corr=corr(X_Invertible); rank=round(trace(ginv(Corr)*Corr)); if rank=ncol(Corr) then do; X_Rand=X_Rand//X_Rand_temp; replikasi_sukses=replikasi_sukses+1; end; end; print replikasi_sukses;
/* MENGITUNG RPP DAN STANDAR ERROR */
print n_sim replikasi replikasi_sukses n_rand; do s=1 to n_sim; /* ==================== Design matrix Beta ======================*/
47
beta=J(iv,k-1,0); /*template beta awal*/ f=1; g=f+k-2; do t=1 to iv; /*regrouping koefisien2 berdasarkan kategori respon*/ beta[t,]=teta_sim[s,f:g]; f=g+1; g=f+k-2; end; beta=beta||J(nrow(beta),1,0); /* ---------------------------------------------------------------*/
a=J(1,k*(iv-1),0); b=J(1,k*(iv-1),0); row_start=1; row_end=n_rand; do ulang=1 to replikasi_sukses; free X_i X_j wij sign; X_R=X_rand[row_start:row_end,]; row_start=row_end+1; row_end=row_start+n_rand-1; n=nrow(X_R); iv=ncol(X_R);
/*total observasi*/ /*banyaknya variabel independen + konstanta*/
do p=2 to iv; /*detik=second(datetime()); menit=minute(datetime()); jam=hour(datetime()); print p jam menit detik; /***** Augmenting X_R menjadi X_i dan X_j dan membuat matrix sign*/ X_i_temp=X_R@J(nrow(X_R),1,1); X_j_temp=X_i_temp; X_j_temp[,p]=repeat(X_R[,p],nrow(X_R),1); V_j_temp=repeat(X_R,nrow(X_R),1); sign_temp=repeat(sign(X_j_temp[,p]-X_i_temp[,p]),1,k); /*----------------------------------------------------------*/ /*Membuat sigma (matrix covariance untuk mariks data V*/ V=X_R[,remove(2:ncol(X_R),p-1)]; satu=J(nrow(v),1,1); sigma=1/(nrow(v)-1)*V`*(diag(satu)-1/nrow(v)*satu*satu`)*V; /* ----------------------------------------------------- */ /*Membuat matriks pembobot wij dengan menggunakan sigma*/ Vi=X_i_temp[,remove(2:ncol(X_i_temp),p-1)]; Vj=V_j_temp[,remove(2:ncol(X_j_temp),p-1)]; Vi_Vj=Vi-Vj; wij_temp=J(nrow(Vi),1,0); do rw=1 to nrow(Vi); wij_temp[rw,1]=1/(1+(Vi_Vj[rw,])*inv(sigma)*(Vi_Vj[rw,])`); /*pembobot ui ke vj*/ end; wij_temp=repeat(wij_temp,1,k); /* ------------------------------------------------------*/ /*Membuat matriks penyebut dalam RPP_sr (b_temp)*/ b_temp=wij_temp#(X_j_temp[,p]-X_i_temp[,p])#sign_temp; /*---------------------------------------------------*/ /*Menggabung X_i, X_j, sign, wij, dan matriks penyebut RPP_sr (b_mat) dari setiap variabel input*/ X_i=X_i//X_i_temp; X_j=X_j//X_j_temp; sign=sign//sign_temp; b_mat=b_mat//b_temp; wij=wij//wij_temp; /* -------------------------------------------------------------------------------------------- */ free X_i_temp X_j_temp V_j_temp sign_temp V satu sigma Vi Vj wij_temp b_temp; end; /*akhir do p=2 to iv*/
48
/* Membuat matrix pembilang (a_mat) untuk RPP_sr */ exp_XB_i=exp(X_i*beta); denum_i=repeat(exp_XB_i[,+],1,k); /*matrix denumerator dalam pred prob*/ prob_i=exp_XB_i/denum_i; /*pred prob_i untuk sertiap ovservasi*/ exp_XB_j=exp(X_j*beta); denum_j=repeat(exp_XB_j[,+],1,k); /*matrix denumerator dalam pred prob*/ prob_j=exp_XB_j/denum_j; /*pred prob_j untuk sertiap ovservasi*/ a_mat=wij#(prob_j-prob_i)#sign; free exp_XB_i denum_i prob_i exp_XB_j denum_j prob_j; /* --------------------------------------------------------------------------- */
/* Menjumlahkan pembilang (a) dan penyebut (b) RPP untuk setiap variabel input*/ sta=1;end=(nrow(X_R))**2; k_lo=1;k_hi=k; do p=1 to iv-1; a_p_mat=a_mat[sta:end,]; b_p_mat=b_mat[sta:end,]; a[1,k_lo:k_hi]=a[1,k_lo:k_hi]+a_p_mat[+,]; b[1,k_lo:k_hi]=b[1,k_lo:k_hi]+b_p_mat[+,]; sta=end+1; end=sta+(nrow(X_R))**2-1; k_lo=k_hi+1; k_hi=k_lo+k-1; end; /* --------------------------------------------------------------------------- */ free sta end k_lo k_hi a_p_mat b_p_mat a_mat b_mat; end; /*akhir do ulang=1 to replikasi_sukses;*/ RPP_s=a/b; RPP_gab=RPP_gab//RPP_s; free RPP_s; end; /*akhir do s=1 to n_sim;*/ create tesis.RPP_gab from RPP_gab; append from RPP_gab; RPP_gab_kum=J(nrow(RPP_gab),ncol(RPP_gab),0); do urut=1 to nrow(RPP_gab); temp=RPP_gab[1:urut,]; RPP_gab_kum[urut,]=temp[:,]; end; beta_ke=1:nrow(RPP_gab); RPP_gab_kum=beta_ke`||RPP_gab_kum; create tesis.RPP_gab_kum from RPP_gab_kum; append from RPP_gab_kum;
/* Menghitung RPP dan SE */ RPP_vec=RPP_gab[:,]; mean=repeat(rpp_vec,n_sim,1); dev=rpp_gab-mean; se_vec=sqrt(dev[##,]/(n_sim-1)); rpp=J(iv-1,k,0); se=J(iv-1,k,0); ks=1;ke=k;
49
do j=1 to iv-1; rpp[j,]=rpp_vec[1,ks:ke]; se[j,]=se_vec[1,ks:ke]; ks=ke+1; ke=ks+k-1; end; Z=rpp/SE; ABS_rpp=abs(rpp); ABS_AVG_CHG=ABS_rpp[,:]; ABS_AVG_CHG_WEIGHT=ABS_AVG_CHG#stdev_x; ABS_AVG_CHG=round(ABS_AVG_CHG,0.000001); ABS_AVG_CHG_WEIGHT=round(ABS_AVG_CHG_WEIGHT,0.000001); AVG_CHG=ABS_AVG_CHG_WEIGHT||ABS_AVG_CHG; rpp=round(rpp,0.000001); SE=round(rpp,0.000001); p_val=2*(1-cdf('normal',abs(z),0,1)); sig_95=(p_val<0.05); sig_99=(p_val<0.01); sig_999=(p_val<0.001); sig=sig_95+sig_99+sig_999; /*print rpp; print SE; print Z;*/ star={'***' '***' '***'}; star_temp={'***' '***' '***'}; indep=iv-1; do d=1 to indep; do e=1 to k; if sig[d,e]=0 then star[d,e]=' '; else if sig[d,e]=1 then star[d,e]='* '; else if sig[d,e]=2 then star[d,e]='** '; else star[d,e]='***'; end; if d
create append create append create append
variabel from variabel[colname=vNames]; from variabel; ndat from rpp[colname=nNames]; from rpp; cdat from star[colname=cNames]; from star;
create append create append
ABS_AVG_CHG_WEIGHT from ABS_AVG_CHG_WEIGHT[colname=avgNames_w]; from ABS_AVG_CHG_WEIGHT; ABS_AVG_CHG from ABS_AVG_CHG[colname=avgNames]; from ABS_AVG_CHG;
quit; data dat (KEEP=variabel Avg_abs_Chg_w Avg_abs_Chg SBY_Boediono MEGAWATI_Prabowo); set variabel; set ABS_AVG_CHG_WEIGHT; set ABS_AVG_CHG; set ndat; set cdat; if n1<0 then n1_c=put(n1,6.5); else n1_c=put(n1,6.4);
JK_Wiranto
50
if n2<0 then n2_c=put(n2,6.5); else if n3<0 then n3_c=put(n3,6.5); else if n4<0 then n4_c=put(n4,6.5); else if n5<0 then n5_c=put(n5,6.5); else if n6<0 then n6_c=put(n6,6.5); else if n7<0 then n7_c=put(n7,6.5); else if n8<0 then n8_c=put(n8,6.5); else if n9<0 then n9_c=put(n9,6.5); else SBY_Boediono=cat(of n1_c c1); JK_Wiranto=cat(of n2_c c2); MEGAWATI_Prabowo=cat(of n3_c c3); run; TITLE 'RPP'; proc print data=dat noobs SPLIT='/' ;run; TITLE '';
n2_c=put(n2,6.4); n3_c=put(n3,6.4); n4_c=put(n4,6.4); n5_c=put(n5,6.4); n6_c=put(n6,6.4); n7_c=put(n7,6.4); n8_c=put(n8,6.4); n9_c=put(n9,6.4);