LAMPIRAN
Lampiran 1 Format Data Pengamatan Cluster Sampling Single Stage
Format Data Pengamatan Cluster Sampling Single Stage – Equal Size
Cluster
i
Banyaknya elemen dalam
cluster terpilih ke –i (
m
i)Nilai karakteristik populasi (
y
i) 1 m1 y1 2 m2 y2 : : : : : : n mn yn Total∑
= n i im
1∑
= n i iy
1Dalam Equal Size m1 = m2 = …. = mn sehingga total adalah nxm.
Format data pengamatan diatas digunakan sebagai panduan untuk
memasukan data input pada program aplikasi. Pembuatan format diatas
dilakukan pada waktu pengolahan data mentah hasil observasi.
Keterangan:
mi = banyaknya unit terpilih dalam cluster ke-i
i
Format Data Pengamatan Cluster Sampling Single Stage – Un Equal Size
Cluster
i
Banyaknya elemen dalam
cluster terpilih ke –i (
m
i)Nilai karakteristik populasi (
y
i) 1 m1 y1 2 m2 y2 : : : : : : n mn yn Total∑
= n i im
1∑
= n i iy
1Dalam Un Equal Size m1 ≠m2 ≠ …. ≠mn .
Format data pengamatan diatas digunakan sebagai panduan untuk
memasukan data input pada program aplikasi. Pembuatan format diatas
dilakukan pada waktu pengolahan data mentah hasil observasi.
Keterangan:
mi = banyaknya unit terpilih dalam cluster ke-i
i
Format Data Pengamatan Cluster Sampling Single Stage – Penduga proporsi
Cluster
i
Banyaknya elemen dalam
cluster terpilih ke –i (
m
i)Nilai proporsi populasi (
a
i) 1 m1 a1 2 m2 a2 : : : : : : n mn an Total∑
= n i im
1∑
= n i ia
1Format data pengamatan diatas digunakan sebagai panduan untuk
memasukan data input pada program aplikasi. Pembuatan format diatas
dilakukan pada waktu pengolahan data mentah hasil observasi.
Keterangan:
mi = banyaknya unit terpilih dalam cluster ke-i
ai = total banyaknya elemen dalam cluster ke-i yang memiliki
karakteristik yang diobservasi atau nilai proporsi nilai
Lampiran 2 Format Data Pengamatan Cluster Sampling Two Stages
Format Data Pengamatan Cluster Sampling Two Stages
yij cluster i Mi mi 1 2 .. .. mi yi i
y
1 1M
m
1y
11y
12 .. ..y
1miy
1y
1 2 2M
m
2y
21y
22 .. .. i my
2y
2y
2 : : : : : : : : : : : : : : : : : : : : n nM
m
ny
n1y
n2 .. ..y
nmiy
ny
n Total∑
= n i iM
1∑
= n i im
1∑
= n i iy
1∑
= n i iy
1Format data pengamatan diatas digunakan sebagai panduan untuk
memasukan data input pada program aplikasi. Pembuatan format diatas
dilakukan pada waktu pengolahan data mentah hasil observasi.
Keterangan:
Mi = banyaknya unit dalam cluster ke-I populasi
mi = banyaknya unit terpilih dalam cluster ke-i
ij
y
= nilai pengamatan ke-j dalam sampel dari cluster ke-ii
y
=∑
= i m j ij iy
m
11
Format Data Pengamatan Cluster Sampling Two Stages - Penduga Proporsi aij cluster i Mi mi 1 2 .. .. ai ai pi 1 1
M
m
1 a11 a12 .. ..a
1mi a1p
1 2 2M
m
2 a21 a22 .. .. i ma
2 a2 2p
: : : : : : : : : : : : : : : : : : : : n nM
m
n an1 an2 .. ..a
nmi anp
n Total∑
= n i iM
1∑
= n i im
1∑
= n i ia
1∑
= n i ip
1Format data pengamatan diatas digunakan sebagai panduan untuk
memasukan data input pada program aplikasi. Pembuatan format diatas
dilakukan pada waktu pengolahan data mentah hasil observasi.
Keterangan:
Mi = banyaknya unit dalam cluster ke-i populasi
mi = banyaknya unit terpilih dalam cluster ke-i
ai = banyaknya elemen dalam sampel yang ditarik dari cluster ke-i
yang memiliki karakteristik tertentu yang diobservasi
pi = proporsi dari elemen-elemen dalam sampel yang ditarik dari
Lampiran 3 Kode Program
unit kenal;procedure TFkenal.FormCreate(Sender: TObject); var kotak1,kotak2,kotak3,kotak4,kotak5: HRGN; begin kotak1:=CreateRectRgn(30,30,Fkenal.Width-10,Fkenal.Height-10); kotak2:=CreateRectRgn(30,30,100,100); kotak3:=CreateRectRgn(470,300,570,370); kotak4:=CreateRectRgn(30,300,100,370); kotak5:=CreateRectRgn(470,30,570,100); CombineRgn(kotak1,kotak1,kotak2,RGN_DIFF); CombineRgn(kotak1,kotak1,kotak3,RGN_DIFF); CombineRgn(kotak1,kotak1,kotak4,RGN_DIFF); CombineRgn(kotak1,kotak1,kotak5,RGN_DIFF); SetWindowRgn(handle,kotak1,true); DeleteObject(kotak1); DeleteObject(kotak2); DeleteObject(kotak3); DeleteObject(kotak4); DeleteObject(kotak5); next.BevelWidth:=4; next.Color:=clBlue; end;
procedure TFkenal.nextMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin next.BevelInner := bvLowered; next.BevelOuter:=bvLowered; next.Color:=clNavy; next.Font.Color := clSkyBlue; end;
procedure TFkenal.nextMouseUp(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin next.BevelInner:=bvNone; next.BevelOuter:=bvRaised; next.Color:=clBlue; next.Font.Color:=clWhite; end;
procedure TFkenal.nextClick(Sender: TObject); begin
fkenal.Hide; futama.Show; end;
unit Utama;
procedure TFutama.FormCreate(Sender: TObject); begin
StatusBarutama.Panels.Items[1].Text:='Tanggal :' + FormatDateTime('dddd, dd mmmm yyyy',Now );
StatusBarutama.Panels.Items[3].Text:='Merry Magdalena '; timer1.Enabled:=True;
StatusBarutama.Panels.Items[0].Text:='Pengolahan Data - Cluster Samping';
exit.BevelWidth:=4; exit.Color:=clBlue;
info1.Caption := '1. Program dapat digunakan untuk data yang telah diketahui ' +#13+ ' bahwa bentuk populasi sudah terbentuk kerangka sampelnya yaitu data berkluster.';
info2.Caption := '2. Program digunakan untuk menguji 1 nilai karakteristik parameter populasi'
+#13+ ' dan data yang digunakan adalah data kuantitatif. ' ; info3.Caption := '3. Metode SRS yang dipakai adalah sistem without replacement. ' ;
info4.Caption := '4. Didalam tahap Multistages hanya dibatasi dengan 2 tahap saja.' ;
info5.Caption := '5. Program aplikasi dapat digunakan untuk pendugaan nilai parameter populasi. ';
end;
procedure TFutama.Timer1Timer(Sender: TObject); begin
StatusBarutama.Panels.Items[2].Text:=timetostr(time); end;
procedure TFutama.exitClick(Sender: TObject); begin
Application.Terminate; end;
procedure TFutama.EqualSize1Click(Sender: TObject); begin
Futama.Hide;
FsingleEQUAL.Show; end;
procedure TFutama.EqualSize2Click(Sender: TObject); begin
Futama.Hide;
FsingleUNequal.Show; end;
procedure TFutama.info1Click(Sender: TObject); begin
info:='';
label3.Visible:=true;
info := ' User HARUS sudah Menetapkan kluster-kluster yang sesuai dari populasi itu,'+#13 + ' kemudian mendaftaran semua kluster yang telah ditetapkan itu kedalam kerangka penarikan contoh (sampling frame).';
memo_info.Caption:=info; end;
procedure TFutama.info2Click(Sender: TObject); begin
info:='';
label3.Visible:=true;
info := ' User dapat menggunakan Program aplikasi untuk membantu mengoptimalkan pengolahan data sampel berkluster '+#13
+ ' dari 1 data informasi yang tersedia dari sampel terpilih untuk menduga parameter populasi seperti rata-rata populasi, '+#13 + ' total populasi, ragam populasi, galat baku, batas galat dan selang kepercayaan +#13+#13 + ' 1 data informasi berupa total keseluruhan elemen dalam kluster terpilih.';
memo_info.Caption:=info; end;
procedure TFutama.info3Click(Sender: TObject); begin
info:='';
label3.Visible:=true;
info := ' Metode SRS (Simple Random Sampling) adalah salah satu metode penarikan sampel yang digunakan, '+#13
+' untuk memilih sampel dari populasi dengan cara sedemikian rupa sehingga setiap anggota populasi '+#13
+' mempunyai peluang yang sama besar untuk diambil sebagai sampel. '+#13+#13 +' Penarikan sampel tanpa pengembalian (Without Replacement), umum dipakai pada populasi acak tak terbatas,'+#13 +' artinya penarikan sampel dilakukan dengan tidak
mengembalikan kembali individu yang telah terambil '+#13 +' sebagai sampel ke dalam kerangka sampel. '; memo_info.Caption:=info;
end;
procedure TFutama.info4Click(Sender: TObject); begin
info:='';
label3.Visible:=true;
info:= ' Pengolahan Data Cluster Sampling - Multi Stages, hanya untuk kasus Two Stages saja. '+#13 +' Dimana penarikan sampel dan
subsampelnya dilakukan dua tahap. '; memo_info.Caption:=info;
end;
procedure TFutama.info5Click(Sender: TObject); begin
info:='';
label3.Visible:=true;
info:= ' Pengolahan Data dapat menghitung pendugaan terhadap nilai parameter populasi, seperti :'+#13
+' nilai rata-rata, nilai total, dan nilai proporsi'+#13 +' Dan data yang tersedia di dalam sampling frame harus LENGKAP';
memo_info.Caption:=info; end;
procedure TFutama.woStages1Click(Sender: TObject); begin
ftwostages.Show; futama.Hide; end;
procedure TFutama.About1Click(Sender: TObject); begin
fabout.show; futama.Hide; end;
procedure TFutama.SRS1Click(Sender: TObject); begin
fsrs.show; futama.Hide; end;
unit SRS;
procedure TfSRS.FormCreate(Sender: TObject); begin
StatusBarutama.Panels.Items[1].Text:='Tanggal :' + FormatDateTime('dddd, dd mmmm yyyy',Now );
StatusBarutama.Panels.Items[3].Text:='Merry Magdalena '; timer1.Enabled:=True;
StatusBarutama.Panels.Items[0].Text:='Pengolahan Data - Cluster Samping';
exit.BevelWidth:=4; exit.Color:=clBlue;
bantuan.Caption := ''+#13+#13+'Alokasi Sampel - SRS'; end;
procedure TfSRS.Timer1Timer(Sender: TObject); begin
StatusBarutama.Panels.Items[2].Text:=timetostr(time); end;
procedure TfSRS.exitClick(Sender: TObject); begin
Application.Terminate; end;
procedure TfSRS.backUTAMAClick(Sender: TObject); begin
fSRS.Hide; futama.Show; end;
procedure TfSRS.lanjutSRS1MouseDown(Sender: TObject;
Button: TMouseButton; Shift: TShiftState; X, Y: Integer); begin lanjutSRS1.BevelInner := bvLowered; lanjutSRS1.BevelOuter:=bvLowered; lanjutSRS1.Color:=clNavy; lanjutSRS1.Font.Color := clYellow; end;
procedure TfSRS.lanjutSRS1MouseUp(Sender: TObject;
Button: TMouseButton; Shift: TShiftState; X, Y: Integer); begin lanjutSRS1.BevelInner:=bvNone; lanjutSRS1.BevelOuter:=bvRaised; lanjutSRS1.Color:=clBlue; lanjutSRS1.Font.Color:=clWhite; end;
procedure TfSRS.lanjutSRS1Click(Sender: TObject); begin
fsrs_tahap_1.show; fsrs.Hide;
end; end.
unit SRS_tahap1; //---save ke file --- procedure TfSRS_tahap_1.saveToFile(Sender:Tobject); var e,f,g:integer; filee:TIniFile ; begin
mysave.Filter:='reset files (*.INI)|*.INI'; g:=strtoint(np.Text); if mysave.Execute then begin if RightStr(mysave.FileName,4)='.ini' then filee:=TIniFile.Create(mysave.filename) else filee :=TIniFile.Create(mysave.FileName+'.ini'); filee.WriteString('General','Nama',judul.Text); filee.WriteString('General','Np',np.Text); for e:=1 to g do begin for f:=1 to 2 do filee.WriteString('General','Data'+IntToStr(e)+IntToStr(f),input_data.C ells[f,e]); end; end; end;
//procedure read from file---
procedure TfSRS_tahap_1.readFile(Sender:TObject); var
e,f,g:integer; xfilee:TIniFile ; begin
myopen.Filter:='reset files (*.ini)|*.ini'; if myopen.Execute then begin xfilee:=TIniFile.Create(myopen.FileName ); judul.Text:=xfilee.ReadString('General','Nama','fail'); np.Text:= xfilee.ReadString('General','Np','0'); g:= strtoint(np.Text); input_data.RowCount:= g+1; for e:=1 to g do begin for f:=1 to 2 do begin input_data.Cells[f,e]:=''; input_data.Cells[0,e]:= IntToStr(e); input_data.Cells[f,e]:=xfilee.ReadString('General','Data'+IntToStr(e)+I ntToStr(f),'0'); end; end; end; end;
procedure TfSRS_tahap_1.FormCreate(Sender: TObject); begin
input_data.ColCount :=3; input_data.RowCount:= 2;
input_data.Cells[0,0]:= 'KLUSTER ke-i'; input_data.Cells[1,0]:= 'mi'; input_data.Cells[2,0]:= 'yi'; input_data.Cells[0,1]:='1'; input_data.ColWidths[1]:=45; input_data.ColWidths[2]:=100; StatusBarutama.Panels.Items[1].Text:='Tanggal :' + FormatDateTime('dddd, dd mmmm yyyy',Now ); StatusBarutama.Panels.Items[3].Text:='Merry Magdalena '; timer1.Enabled:=True;
StatusBarutama.Panels.Items[0].Text:='Pengolahan Data - Cluster Samping';
exit.BevelWidth:=4; exit.Color:=clBlue;
bantu := 'Selamat Datang ke Cluster Sampling - SRS' +#13 +#13 +'Baru : Pengolahan data baru'
+#13 +#13 +'Buka : Ambil data yang pernah disimpan' +#13 +#13 +'Simpan : Menyimpan data'
+#13 +#13 +'Banyaknya kluster dalam populasi = N' +#13 +#13 +'Banyaknya kluster terpilih = n' +#13 +#13 +'Banyaknya unit dalam kluster terpilih = mi'
+#13 +#13 +'Total dari semua pengamatan dlm kluster ke-i =yi' ; bantuan.Caption := bantu;
end;
procedure TfSRS_tahap_1.Timer1Timer(Sender: TObject); begin
StatusBarutama.Panels.Items[2].Text:=timetostr(time); end;
procedure TfSRS_tahap_1.exitClick(Sender: TObject); begin
application.Terminate; end;
procedure TfSRS_tahap_1.backUTAMAClick(Sender: TObject); var a : integer;
begin
a:= MessageDlg('Data tidak akan diproses, Yakin akan ke Menu Utama SRS?',mtConfirmation,mbOKCancel,0); if a = mrCancel then fsrs_tahap_1.Show else begin Fsrs.show; Fsrs_tahap_1.Hide; end; end;
procedure TfSRS_tahap_1.isi_dataClick(Sender: TObject); var i,l: integer;
begin
if strlen(pchar(judul.Text))=0 then
ShowMessage( '> Judul tidak boleh kosong' ) else
if strlen(pchar(np.Text))= 0 then
ShowMessage( '> Jumlah Kluster dlm populasi tidak boleh kosong') else begin l:=StrToInt(np.Text); input_data.ColCount :=3; input_data.RowCount:= l+1; for i:=1 to (l+1) do begin input_data.Cells[0,i]:= IntToStr(i); input_data.Cells[1,i]:= ''; input_data.Cells[2,i]:= ''; input_data.Enabled:=true; end end end;
procedure TfSRS_tahap_1.input_dataClick(Sender: TObject); var InputString : string; c,d :integer; begin c:=input_data.Col; d:=input_data.Row; if c=1 then begin
InputString:= InputBox('Masukkan data', 'Data Kolom mi'+' Baris ke '+inttostr(d), '');
input_data.Cells [c,d]:=InputString; end
else begin
InputString:= InputBox('Masukkan data', 'Data Kolom yi'+' Baris ke '+inttostr(d), '');
input_data.Cells [c,d]:=InputString; end
end;
procedure TfSRS_tahap_1.bukaClick(Sender: TObject); begin
tahap1.Show; ReadFile(sender);
input_data.Enabled:=true; end;
procedure TfSRS_tahap_1.simpanClick(Sender: TObject); var a,i,j :integer;
salah :string; begin tahap1.Show; a:=input_data.RowCount-1; salah:=''; if strlen(pchar(judul.Text))=0 then
salah :=salah+'> Judul tidak boleh kosong' +#13; if strlen(pchar(np.Text))= 0 then
salah :=salah+'> Jumlah Kluster dlm populasi tidak boleh kosong' +#13;
for i:=1 to a do begin
for j :=1 to 2 do begin
if strlen(pchar(input_data.Cells[j,i]))=0 then
salah:=salah+ 'Input ['+inttostr(j)+','+inttostr(i)+'] kosong'+#13; end; end; if salah='' then saveToFile(sender) else begin
showmessage(salah+'Data HARUS LENGKAP'); end;
end;
procedure TfSRS_tahap_1.baruClick(Sender: TObject); var e,g : integer;
begin tahap1.Show; isi_data.Visible:=true; judul.Text:=''; np.Text:=''; g := input_data.RowCount; for e:=1 to g do begin input_data.Cells[1,e]:= ''; input_data.Cells[2,e]:= ''; end; end;
procedure TfSRS_tahap_1.FormShow(Sender: TObject); begin
PageControl.ActivePage:=tahap1; end;
procedure TfSRS_tahap_1.ltabelClick(Sender: TObject); begin
tahap1.Hide; tahap2.Show; end;
procedure TfSRS_tahap_1.lanjut_1Click(Sender: TObject); var n_1,j,k, nppp:integer; h :array[1..1000] of integer; sama:Boolean; begin Randomize; n_1:= StrToInt(nn1.Text); nppp:=StrToInt(np.Text); if n_1>nppp then
ShowMessage('Besar Sampel yang yang dimasukkan harus lebih kecil dari besar populasi!!')
else begin
hasil.ColCount:=3; hasil.RowCount:=n_1+1;
for j:=1 to n_1 do begin repeat sama:=False; h[j]:= random(nppp)+1; for k:= j-1 downto 1 do begin if h[j] = h[k] then sama:=true; end;
until not sama;
hasil.Cells[0,j]:= inttostr(h[j]); hasil.Cells[1,j]:= input_data.Cells[1,h[j]]; hasil.Cells[2,j]:= input_data.Cells[2,h[j]]; end; end; end;
procedure TfSRS_tahap_1.Tahap2Show(Sender: TObject); begin
hasil.Cells[0,0]:= 'KLUSTER ke-i'; hasil.Cells[1,0]:= 'mi';
hasil.Cells[2,0]:= 'yi'; hasil.ColWidths[1]:=45; hasil.ColWidths[2]:=100; end;
procedure TfSRS_tahap_1.simpan_1Click(Sender: TObject); var
e,f,g:integer; filee:TIniFile ; begin
mysave.Filter:='reset files (*.INI)|*.INI'; g:=strtoint(nn1.Text); if mysave.Execute then begin if RightStr(mysave.FileName,4)='.ini' then filee:=TIniFile.Create(mysave.filename) else filee :=TIniFile.Create(mysave.FileName+'.ini'); filee.WriteString('General','Nama',judul.Text); filee.WriteString('General','N',nn1.Text); filee.WriteString('General','Np',np.Text); for e:=1 to g do begin for f:=1 to 2 do filee.WriteString('General','Data'+IntToStr(e)+IntToStr(f),input_data.C ells[f,e]); end; end; end; end.
unit singleEQUAL;
procedure TFsingleEQUAL.FormCreate(Sender: TObject); begin
StatusBarutama.Panels.Items[1].Text:='Tanggal :' + FormatDateTime('dddd, dd mmmm yyyy',Now );
StatusBarutama.Panels.Items[3].Text:='Merry Magdalena '; timer1.Enabled:=True;
StatusBarutama.Panels.Items[0].Text:='Pengolahan Data - Cluster Samping';
exit.BevelWidth:=4; exit.Color:=clBlue;
bantuan.Caption := ''+ #13+#13
+'Single Stage Equal Size' +#13 +#13
+'Jumlah unit dalam kluster yang terpilih'+#13 + 'SAMA BESAR ukurannya ';
end;
procedure TFsingleEQUAL.Timer1Timer(Sender: TObject); begin
StatusBarutama.Panels.Items[2].Text:=timetostr(time); end;
procedure TFsingleEQUAL.exitClick(Sender: TObject); begin
Application.Terminate; end;
procedure TFsingleEQUAL.backUTAMAClick(Sender: TObject); begin
FsingleEqual.Hide; futama.Show;
end;
procedure TFsingleEQUAL.lanjutEQUAL1Click(Sender: TObject); begin
Fsingleequal.Hide;
Fsingleequal_tahap_1.Show; end;
unit singleEQUAL_tahap_1; //---save ke file --- procedure TFsingleEQUAL_tahap_1.saveToFile(Sender:Tobject); var e,f,g:integer; filee:TIniFile ; begin
mysave.Filter:='reset files (*.INI)|*.INI'; g:=strtoint(n.Text); if mysave.Execute then begin if RightStr(mysave.FileName,4)='.ini' then filee:=TIniFile.Create(mysave.filename) else filee :=TIniFile.Create(mysave.FileName+'.ini'); filee.WriteString('General','Nama',judul.Text); filee.WriteString('General','N',n.Text); filee.WriteString('General','Np',np.Text); filee.WriteString('General','MMi',mmi.Text); for e:=1 to g do begin for f:=1 to 2 do filee.WriteString('General','Data'+IntToStr(e)+IntToStr(f),input_data.C ells[f,e]); end; end; end;
//procedure read from file---
procedure TFsingleEQUAL_tahap_1.readFile(Sender:TObject); var
e,f,g:integer; xfilee:TIniFile ; begin
myopen.Filter:='reset files (*.ini)|*.ini'; if myopen.Execute then begin xfilee:=TIniFile.Create(myopen.FileName ); judul.Text:=xfilee.ReadString('General','Nama','fail'); n.Text:= xfilee.ReadString('General','N','0'); np.Text:= xfilee.ReadString('General','Np','0'); mmi.Text:= xfilee.ReadString('General','MMi','0'); g:= strtoint(n.Text); input_data.RowCount:= g+1; for e:=1 to g do begin for f:=1 to 2 do begin input_data.Cells[f,e]:=''; input_data.Cells[0,e]:= IntToStr(e); input_data.Cells[f,e]:= xfilee.ReadString('General','Data'+IntToStr(e)+IntToStr(f),'0'); end; end; end; end;
procedure TFsingleEQUAL_tahap_1.FormCreate(Sender: TObject); begin PageControl.ActivePage:=tahap1; QuickRep1.Visible:=false; QuickRep2.Visible:=false; input_data.ColCount :=3; input_data.RowCount:= 2;
input_data.Cells[0,0]:= 'KLUSTER ke-i'; input_data.Cells[1,0]:= 'mi'; input_data.Cells[2,0]:= 'yi'; input_data.Cells[0,1]:='1'; input_data.ColWidths[1]:=45; input_data.ColWidths[2]:=100; StatusBarutama.Panels.Items[1].Text:='Tanggal :' + FormatDateTime('dddd, dd mmmm yyyy',Now ); StatusBarutama.Panels.Items[3].Text:='Merry Magdalena '; timer1.Enabled:=True;
StatusBarutama.Panels.Items[0].Text:='Pengolahan Data - Cluster Samping';
exit.BevelWidth:=4; exit.Color:=clBlue;
bantu := 'Selamat Datang ke Cluster Sampling - Equal Size' +#13 +#13 +'Baru : Pengolahan data baru'
+#13 +#13 +'Buka : Ambil data yang pernah disimpan' +#13 +#13 +'Simpan : Menyimpan data'
+#13 +#13 +'Banyaknya kluster dalam populasi = N' +#13 +#13 +'Banyaknya kluster terpilih = n' +#13 +#13 +'Banyaknya unit dalam kluster terpilih = mi' +#13 +#13 +'Banyaknya elemen dalam kluster terpilih = M'
+#13 +#13 +'Total dari semua pengamatan dlm kluster ke-i = yi'; bantuan.Caption := bantu;
end;
procedure TFsingleEQUAL_tahap_1.Timer1Timer(Sender: TObject); begin
StatusBarutama.Panels.Items[2].Text:=timetostr(time); end;
procedure TFsingleEQUAL_tahap_1.exitClick(Sender: TObject); begin
application.Terminate; end;
procedure TFsingleEQUAL_tahap_1.backUTAMAClick(Sender: TObject); var a : integer;
begin
a:= MessageDlg('Data tidak akan diproses, Yakin akan ke Menu utama "Equal Size"?',mtConfirmation,mbOKCancel,0); if a = mrCancel then Fsingleequal_tahap_1.Show else begin Fsingleequal.Show; Fsingleequal_tahap_1.Hide; end; end;
procedure TFsingleEQUAL_tahap_1.isi_dataClick(Sender: TObject); var i,k,l,o: integer;
begin
if strlen(pchar(judul.Text))=0 then
ShowMessage( '> Judul tidak boleh kosong' ) else
if strlen(pchar(np.Text))= 0 then
ShowMessage( '> Jumlah Kluster dlm populasi tidak boleh kosong') else
if strlen(pchar(n.Text))=0 then
ShowMessage('> Jumlah Kluster terpilih tidak boleh kosong') else
if strlen(pchar(mmi.Text))=0 then
ShowMessage('> Jumlah unit dalam setiap kluster terpilih tidak boleh kosong') else begin k:=StrToInt(n.Text); l:=StrToInt(np.Text); o:=StrToInt(mmi.Text); if(k>l) then
ShowMessage('> Kluster terpilih harus lebih kecil dari kluster populasi') else begin input_data.ColCount :=3; input_data.RowCount:= k+1; for i:=1 to (k+1) do begin input_data.Cells[0,i]:= IntToStr(i); input_data.Cells[1,i]:= IntToStr (o); input_data.Cells[2,i]:= ''; input_data.Enabled:=true; end; end; end; end;
procedure TFsingleEQUAL_tahap_1.input_dataClick(Sender: TObject); var InputString : string; c,d :integer; begin c:=input_data.Col; d:=input_data.Row; if c=1 then begin
InputString:= InputBox('Masukkan data', 'Data Kolom mi'+' Baris ke '+inttostr(d), '');
input_data.Cells [c,d]:=InputString; end
else begin
InputString:= InputBox('Masukkan data', 'Data Kolom yi'+' Baris ke '+inttostr(d), '');
input_data.Cells [c,d]:=InputString; end
procedure TFsingleEQUAL_tahap_1.bukaClick(Sender: TObject); begin tahap1.Show; ReadFile(sender); input_data.Enabled:=true; end;
procedure TFsingleEQUAL_tahap_1.simpanClick(Sender: TObject); var a,i,j :integer;
salah :string; begin tahap1.Show; a:=input_data.RowCount-1; salah:=''; if strlen(pchar(judul.Text))=0 then
salah :=salah+'> Judul tidak boleh kosong' +#13; if strlen(pchar(np.Text))= 0 then
salah :=salah+'> Jumlah Kluster dlm populasi tidak boleh kosong' +#13;
if strlen(pchar(n.Text))=0 then
salah :=salah+'> Jumlah Kluster terpilih tidak boleh kosong' +#13; if strlen(pchar(mmi.Text))=0 then
salah :=salah+'> Jumlah unit dalam setiap kluster terpilih tidak boleh kosong' +#13;
for i:=1 to a do begin
for j :=1 to 2 do begin
if strlen(pchar(input_data.Cells[j,i]))=0 then
salah:=salah+ 'Input ['+inttostr(j)+','+inttostr(i)+'] kosong'+#13; end; end; if salah='' then saveToFile(sender) else begin
showmessage(salah+'Data HARUS LENGKAP'); end;
end;
procedure TFsingleEQUAL_tahap_1.baruClick(Sender: TObject); var e,g : integer;
begin tahap1.Show; isi_data.Visible:=true; judul.Text:=''; n.Text:=''; np.Text:=''; mmi.Text:=''; g := input_data.RowCount; for e:=1 to g+1 do begin input_data.Cells[1,e]:= ''; input_data.Cells[2,e]:= ''; end; end;
procedure TFsingleEQUAL_tahap_1.lanjutunEQUAL2Click(Sender: TObject); var nn,nnp,i,baris :integer;
begin nn:=strtoint(n.Text); nnp :=strtoint(np.Text); tahap1.Hide; tahap2.Show; panel5.Visible:=true; panel6.Visible:=false; //inisialisasi u1:=0; tot1:=0; tot2:=0; rata:=0; tot11:=0; tot12:=0; tot121:=0; tot13:=0; temp:=0; temp1:=0; temp11:=0; temp12:=0; sp1:=0; sp2:=0; sp11:=0; sp12:=0; baris :=input_data.RowCount-1; for i:=1 to baris do
begin
tot1:= tot1+ StrToFloat(input_data.Cells[1,i]); tot2:= tot2+ StrToFloat(input_data.Cells[2,i]); end;
rata:= rata+(tot2/tot1); rata:=roundto(rata,-3); tot121:=tot121+(tot1/nn); tot121:=roundto(tot121,-3); for i:=1 to baris do
begin tot12:= tot12+ (StrToFloat(input_data.Cells[1,i])*StrToFloat(input_data.Cells[1,i])); tot11:= tot11+ (StrToFloat(input_data.Cells[2,i])*StrToFloat(input_data.Cells[2,i])); tot13:= tot13+ (StrToFloat(input_data.Cells[1,i])*StrToFloat(input_data.Cells[2,i])); end; temp:=temp+(tot11-(2*rata*tot13)+(rata*rata*tot12)); u1:=u1+temp; temp:=((Nnp-nn)/Nnp)*(1/(nn*tot121*tot121))*(temp/(nn-1)); temp1:=temp1+(sqrt(temp)); temp:=roundto(temp,-4); temp1:=roundto(temp1,-3); temp11:=temp11+(1.96*temp1); temp12:=temp12+(2.575*temp1); temp11:=roundto(temp11,-3); temp12:=roundto(temp12,-3); sp1:=sp1+(rata-temp11);
sp2:=sp2+(rata+temp11); sp1:=roundto(sp1,-3); sp2:=roundto(sp2,-3); sp11:=sp11+(rata-temp12); sp12:=sp12+(rata+temp12); sp11:=roundto(sp11,-3); sp12:=roundto(sp12,-3); hasil1.Cells[1,1]:=FormatFloat('#,##0.000',tot1); hasil1.Cells[2,1]:=FormatFloat('#,##0.000',tot2); hasil2.Cells[1,1]:=FormatFloat('#,##0.000',rata); hasil2.Cells[1,2]:=FormatFloat('#,##0.0000',temp); hasil2.Cells[1,3]:=FormatFloat('#,##0.000',temp1); hasil3.Cells[1,1]:=FormatFloat('#,##0.000',temp11); hasil3.Cells[2,1]:=FormatFloat('#,##0.000',temp12); hasil3.Cells[1,2]:='['+FormatFloat('#,##0.000',sp1)+';'+FormatFloat('#, ##0.000',sp2)+']'; hasil3.Cells[2,2]:='['+FormatFloat('#,##0.00',sp11)+';'+FormatFloat('#, ##0.00',sp12)+']';
ket := ''+#13 + ' 1.> Rata-rata populasi diperkirakan sebesar ' + hasil2.Cells[1,1]+' .'+#13 +#13
+ ' 2.> Dengan menggunakan taraf kepercayaan 95% diyakini bahwa penyimpangan yang terjadi atas '+ #13
+ ' pendugaan no.1 akan lebih kecil dari '+hasil3.Cells[1,1]+' .'+#13+#13
+ ' 3.> Dengan menggunakan taraf kepercayaan 99% diyakini bahwa penyimpangan yang terjadi atas '+ #13
+ ' pendugaan no.1 akan lebih kecil dari '+hasil3.Cells[2,1]+' .'+#13 +#13
+ ' 4.> Dengan menggunakan taraf kepercayaan 95% diyakini bahwa selang nilai '+ hasil3.Cells[1,2]+ #13
+ ' akan mencakup rata-rata yang sesungguhnya dari populasi. '+#13 +#13
+ ' 5.> Dengan menggunakan taraf kepercayaan 99% diyakini bahwa selang nilai '+ hasil3.Cells[2,2] + #13
+ ' akan mencakup rata-rata yang sesungguhnya dari populasi. '+#13 +#13 ;
KETERangan.Caption:=ket; end;
procedure TFsingleEQUAL_tahap_1.tahap2Show(Sender: TObject); begin hasil1.Cells[1,0]:= 'mi'; hasil1.Cells[2,0]:= 'yi'; hasil1.Cells[0,1]:= 'Total'; hasil2.Cells[1,0]:= 'Hasil'; hasil2.Cells[0,1]:= 'Rata-rata'; hasil2.Cells[0,2]:= 'Ragam'; hasil2.Cells[0,3]:= 'Galat Baku'; hasil3.Cells[0,0]:= 'Alpha'; hasil3.Cells[1,0]:= ' 5%'; hasil3.Cells[2,0]:= '1%';
hasil3.Cells[0,1]:= 'Batas Galat';
hasil3.Cells[0,2]:= 'Selang kepercayaan'; end;
procedure TFsingleEQUAL_tahap_1.FormShow(Sender: TObject); begin
PageControl.ActivePage:=tahap1; end;
procedure TFsingleEQUAL_tahap_1.cetak1Click(Sender: TObject); begin
QRjudul.Caption:='PENGOLAHAN DATA "Cluster Sampling Single Stage - Equal Size"'; QR1.Caption:= judul.Text; QR2.Caption:= np.Text; QR3.Caption:= n.Text; with hasil1 do begin QR4.Caption:= hasil1.Cells[1,1]; QR5.Caption:= hasil1.Cells[2,1]; end; with hasil2 do begin QR6.Caption:= hasil2.Cells[1,1]; QR7.Caption:= hasil2.Cells[1,2]; QR8.Caption:= hasil2.Cells[1,3]; end; with hasil3 do begin QR9.Caption:= hasil3.Cells[1,1]; QR10.Caption:= hasil3.Cells[1,2];; QR11.Caption:= hasil3.Cells[2,1]; QR12.Caption:= hasil3.Cells[2,2];; end; QRMemo1.Lines.Clear;
QRMemo1.Lines.Add(' 1.> Rata-rata populasi diperkirakan sebesar '+ QR6.Caption );
QRMemo1.Lines.Add('');
QRMemo1.Lines.Add(' 2.> Dengan menggunakan taraf kepercayaan 95% diyakini bahwa penyimpangan yang terjadi atas');
QRMemo1.Lines.Add(' pendugaan no.1 akan lebih kecil dari '+ QR9.Caption+' .');
QRMemo1.Lines.Add('');
QRMemo1.Lines.Add(' 3.> Dengan menggunakan taraf kepercayaan 95% diyakini bahwa selang nilai '+ QR10.Caption);
QRMemo1.Lines.Add(' akan mencakup rata-rata yang sesungguhnya dari populasi. ');
QRMemo1.Lines.Add('');
QRMemo1.Lines.Add(' 4.> Dengan menggunakan taraf kepercayaan 99% diyakini bahwa penyimpangan yang terjadi atas');
QRMemo1.Lines.Add(' pendugaan no.1 akan lebih kecil dari '+ QR11.Caption+'.');
QRMemo1.Lines.Add('');
QRMemo1.Lines.Add(' 5.> Dengan menggunakan taraf kepercayaan 95% diyakini bahwa selang nilai '+ QR12.Caption);
QRMemo1.Lines.Add(' akan mencakup rata-rata yang sesungguhnya dari populasi. ');
QRMemo1.Lines.Add(''); QRMemo1.Show;
QuickRep1.Preview; end;
procedure TFsingleEQUAL_tahap_1.totalClick(Sender: TObject); begin panel6.Visible:=true; panel5.Visible:=false; tahap2.Hide; tahap3.Show; end;
procedure TFsingleEQUAL_tahap_1.yaClick(Sender: TObject); begin
hitung.Visible:=true; label10.Visible:=true; m.Visible:=true;
Label11.Caption:= 'Hasil Pendugaan Nilai Total Populasi dengan M diketahui'; hasil4.Cells[1,1]:=''; hasil4.Cells[1,2]:=''; hasil4.Cells[1,3]:=''; hasil5.Cells[1,1]:=''; hasil5.Cells[2,1]:=''; hasil5.Cells[1,2]:=''; hasil5.Cells[2,2]:=''; end;
procedure TFsingleEQUAL_tahap_1.tahap3Show(Sender: TObject); begin
hasil4.Cells[1,0]:= 'Hasil';
hasil4.Cells[0,1]:= 'Nilai Total'; hasil4.Cells[0,2]:= 'Ragam';
hasil4.Cells[0,3]:= 'Galat Baku'; hasil5.Cells[0,0]:= 'Alpha'; hasil5.Cells[1,0]:= ' 5%'; hasil5.Cells[2,0]:= '1%';
hasil5.Cells[0,1]:= 'Batas Galat';
hasil5.Cells[0,2]:= 'Selang kepercayaan'; end;
procedure TFsingleEQUAL_tahap_1.hitungClick(Sender: TObject); var mm :Extended; y1: string; begin cetak2.Visible:=true; mm:=StrToFloat(m.Text); temp2:=0; sp3:=0; temp3:=0; sp4:=0; temp4:=0; temp5:=0; temp6:=0; sp31:=0; sp41:=0; temp2:=temp2+ (mm*rata); temp2:=roundto(temp2,-3); temp3:=temp3+(mm*mm*temp); temp3:=roundto(temp3,-3);
temp4:=temp4+(sqrt(temp3)); temp4:=roundto(temp4,-3); temp5:=temp5+(1.96*temp4); temp6:=temp6+(2.575*temp4); temp5:=roundto(temp5,-3); temp6:=roundto(temp6,-3); sp3:=sp3+(temp2-temp5); sp4:=sp4+(temp2+temp5); sp3:=roundto(sp3,-3); sp4:=roundto(sp4,-3); sp31:=sp31+(temp2-temp6); sp41:=sp41+(temp2+temp6); sp31:=roundto(sp31,-3); sp41:=roundto(sp41,-3); y1:=''; y1:=y1+FormatFloat('0',temp2); hasil4.Cells[1,1]:=FormatFloat('#,##0.000',temp2); hasil4.Cells[1,2]:=FormatFloat('#,##0.000',temp3); hasil4.Cells[1,3]:=FormatFloat('#,##0.000',temp4); hasil5.Cells[1,1]:=FormatFloat('#,##0.000',temp5); hasil5.Cells[2,1]:=FormatFloat('#,##0.000',temp6); hasil5.Cells[1,2]:='['+FormatFloat('#,##0.000',sp3)+' ; '+FormatFloat('#,##0.000',sp4)+']'; hasil5.Cells[2,2]:='['+FormatFloat('#,##0.000',sp31)+' ; '+FormatFloat('#,##0.000',sp41)+']';
ket1 := ''+#13 + ' 1.> Total populasi diperkirakan sebesar ' + hasil4.Cells[1,1]+' . Dibulatkan menjadi = '+y1+' .'+#13 +#13
+ ' 2.> Dengan menggunakan taraf kepercayaan 95% diyakini bahwa penyimpangan yang terjadi atas '+ #13
+ ' pendugaan no.1 akan lebih kecil dari '+hasil5.Cells[1,1]+' .'+#13+#13
+ ' 3.> Dengan menggunakan taraf kepercayaan 99% diyakini bahwa penyimpangan yang terjadi atas '+ #13
+ ' pendugaan no.1 akan lebih kecil dari '+hasil5.Cells[2,1]+' .'+#13 +#13
+ ' 4.> Dengan menggunakan taraf kepercayaan 95% diyakini bahwa selang nilai '+ hasil5.Cells[1,2]+ #13
+ ' akan mencakup total seluruh elemen dari populasi. '+#13 +#13 + ' 5.> Dengan menggunakan taraf kepercayaan 99% diyakini bahwa selang nilai '+ hasil5.Cells[2,2] + #13
+ ' akan mencakup total seluruh elemen dari populasi. '+#13 +#13 ;
KEt2.Caption:=ket1; end;
procedure TFsingleEQUAL_tahap_1.tidakClick(Sender: TObject); var nn,nnp :integer; y1 :string; begin m.Text:=''; cetak2.Visible:=true; nn:=StrToInt(n.Text); nnp:=StrToInt(np.Text);
Label11.Caption:= 'Hasil Pendugaan Nilai Total Populasi dengan M tidak diketahui';
sp3:=0; temp3:=0; sp4:=0; temp4:=0; temp5:=0; temp6:=0; temp7:=0; sp31:=0; sp41:=0; label10.Visible:=false; m.Visible:=false; hitung.Visible:=false; hasil4.Cells[1,1]:=''; hasil4.Cells[1,2]:=''; hasil4.Cells[1,3]:=''; hasil5.Cells[1,1]:=''; hasil5.Cells[2,1]:=''; hasil5.Cells[1,2]:=''; hasil5.Cells[2,2]:=''; temp2:=temp2+ ((nnp*tot2)/nn); temp2:=roundto(temp2,-3); temp3:=temp3+((nnp-nn)/nnp); temp3:=roundto(temp3,-3); temp4:=temp4+(tot11-((tot2*tot2)/nn)); temp4:=((nnp*nnp*temp3*temp4)/(nn*(nn-1))); temp4:=roundto(temp4,-3); temp5:=temp5+(sqrt(temp4)); temp5:=roundto(temp5,-3); temp6:=temp6+(1.96*temp5); temp7:=temp7+(2.575*temp5); temp6:=roundto(temp6,-3); temp7:=roundto(temp7,-3); sp3:=sp3+(temp2-temp6); sp4:=sp4+(temp2+temp6); sp3:=roundto(sp3,-3); sp4:=roundto(sp4,-3); sp31:=sp31+(temp2-temp7); sp41:=sp41+(temp2+temp7); sp31:=roundto(sp31,-3); sp41:=roundto(sp41,-3); y1:=''; y1:=y1+FormatFloat('0',temp2); hasil4.Cells[1,1]:=FormatFloat('#,##0.000',temp2); hasil4.Cells[1,2]:=FormatFloat('#,##0.000',temp4); hasil4.Cells[1,3]:=FormatFloat('#,##0.000',temp5); hasil5.Cells[1,1]:=FormatFloat('#,##0.000',temp6); hasil5.Cells[2,1]:=FormatFloat('#,##0.000',temp7); hasil5.Cells[1,2]:='['+FormatFloat('#,##0.000',sp3)+' ; '+FormatFloat('#,##0.000',sp4)+']'; hasil5.Cells[2,2]:='['+FormatFloat('#,##0.000',sp31)+' ; '+FormatFloat('#,##0.000',sp41)+']'; ket3 := ''+#13
+ '1.> Total populasi diperkirakan sebesar ' + hasil4.Cells[1,1]+' . Dibulatkan menjadi = '+y1+' .'+#13 +#13
+ ' 2.> Dengan menggunakan taraf kepercayaan 95% diyakini bahwa penyimpangan yang terjadi atas '+ #13
+ ' pendugaan no.1 akan lebih kecil dari '+hasil5.Cells[1,1]+' .'+#13+#13
+ ' 3.> Dengan menggunakan taraf kepercayaan 99% diyakini bahwa penyimpangan yang terjadi atas '+ #13
+ ' pendugaan no.1 akan lebih kecil dari '+hasil5.Cells[2,1]+' .'+#13 +#13
+ ' 4.> Dengan menggunakan taraf kepercayaan 95% diyakini bahwa selang nilai '+ hasil5.Cells[1,2]+ #13 + ' akan mencakup total seluruh elemen dari populasi. '+#13 +#13 + ' 5.> Dengan menggunakan taraf kepercayaan 99% diyakini bahwa selang nilai '+ hasil5.Cells[2,2] + #13 + ' akan mencakup total seluruh elemen dari populasi. '+#13 +#13 ;
KEt2.Caption:=ket3; end;
procedure TFsingleEQUAL_tahap_1.cetak2Click(Sender: TObject); begin
QRjudul2.Caption:='PENGOLAHAN DATA "Cluster Sampling Single Stage - Equal Size"'; QR13.Caption:= judul.Text; QR14.Caption:= np.Text; QR15.Caption:= n.Text; with hasil1 do begin QR16.Caption:= hasil1.Cells[1,1]; QR17.Caption:= hasil1.Cells[2,1]; end; with hasil2 do begin QR18.Caption:= hasil2.Cells[1,1]; QR19.Caption:= hasil2.Cells[1,2]; QR20.Caption:= hasil2.Cells[1,3]; end; with hasil3 do begin QR21.Caption:= hasil3.Cells[1,1]; QR22.Caption:= hasil3.Cells[1,2];; QR23.Caption:= hasil3.Cells[2,1]; QR24.Caption:= hasil3.Cells[2,2];; end; if strlen(pchar(m.Text))= 0 then QR25.Caption:= ' tidak diketahui ' else QR25.Caption:= m.Text; with hasil4 do begin QR26.Caption:= hasil4.Cells[1,1]; QR27.Caption:= hasil4.Cells[1,2]; QR28.Caption:= hasil4.Cells[1,3]; end; with hasil5 do begin QR29.Caption:= hasil5.Cells[1,1]; QR30.Caption:= hasil5.Cells[1,2];; QR31.Caption:= hasil5.Cells[2,1]; QR32.Caption:= hasil5.Cells[2,2];; end;
QRMemo2.Lines.Clear;
QRMemo2.Lines.Add(' 1.> Rata-rata populasi diperkirakan sebesar '+ QR18.Caption );
QRMemo2.Lines.Add('');
QRMemo2.Lines.Add(' 2.> Dengan menggunakan taraf kepercayaan 95% diyakini bahwa penyimpangan yang terjadi atas');
QRMemo2.Lines.Add(' pendugaan no.1 akan lebih kecil dari '+ QR21.Caption+' .');
QRMemo2.Lines.Add('');
QRMemo2.Lines.Add(' 3.> Dengan menggunakan taraf kepercayaan 95% diyakini bahwa selang nilai '+ QR22.Caption);
QRMemo2.Lines.Add(' akan mencakup rata-rata yang sesungguhnya dari populasi. ');
QRMemo2.Lines.Add('');
QRMemo2.Lines.Add(' 4.> Dengan menggunakan taraf kepercayaan 99% diyakini bahwa penyimpangan yang terjadi atas');
QRMemo2.Lines.Add(' pendugaan no.1 akan lebih kecil dari '+ QR23.Caption+'.');
QRMemo2.Lines.Add('');
QRMemo2.Lines.Add(' 5.> Dengan menggunakan taraf kepercayaan 95% diyakini bahwa selang nilai '+ QR24.Caption);
QRMemo2.Lines.Add(' akan mencakup rata-rata yang sesungguhnya dari populasi. ');
QRMemo2.Lines.Add(''); QRMemo2.Show;
QRMemo3.Lines.Clear;
QRMemo3.Lines.Add(' 1.> Total populasi diperkirakan sebesar '+ QR26.Caption );
QRMemo3.Lines.Add('');
QRMemo3.Lines.Add(' 2.> Dengan menggunakan taraf kepercayaan 95% diyakini bahwa penyimpangan yang terjadi atas');
QRMemo3.Lines.Add(' pendugaan no.1 akan lebih kecil dari '+ QR29.Caption+' .');
QRMemo3.Lines.Add('');
QRMemo3.Lines.Add(' 3.> Dengan menggunakan taraf kepercayaan 95% diyakini bahwa selang nilai '+ QR30.Caption);
QRMemo3.Lines.Add(' akan mencakup rata-rata yang sesungguhnya dari populasi. ');
QRMemo3.Lines.Add('');
QRMemo3.Lines.Add(' 4.> Dengan menggunakan taraf kepercayaan 99% diyakini bahwa penyimpangan yang terjadi atas');
QRMemo3.Lines.Add(' pendugaan no.1 akan lebih kecil dari '+ QR31.Caption+'.');
QRMemo3.Lines.Add('');
QRMemo3.Lines.Add(' 5.> Dengan menggunakan taraf kepercayaan 95% diyakini bahwa selang nilai '+ QR32.Caption);
QRMemo3.Lines.Add(' akan mencakup rata-rata yang sesungguhnya dari populasi. ');
QRMemo3.Lines.Add(''); QRMemo3.Show;
QuickRep2.Preview; end;
procedure TFsingleEQUAL_tahap_1.ukuranClick(Sender: TObject); begin
panel5.Visible:=true; panel6.Visible:=false;
tahap3.Hide; tahap4.Show; end;
procedure TFsingleEQUAL_tahap_1.hitung2Click(Sender: TObject); var info :string;
u4,z,gg :extended; nnnp,nnn :integer; begin z:=0; u2:=0; u3:=0; u4:=0; gg:=StrToFloat(g.Text); nnnp:=StrToInt(Np.Text); nnn:=strtoint(n.Text); if A95.Checked=true then begin z:= z+1.96;
info := ' Jika ingin melakukan survei dimasa yang akan datang dengan ketentuan : '+#13
+ ' 1.> Galat tidak boleh menyimpang lebih besar dari ' +G.Text +#13 + ' Dengan Taraf kepercayaan 95 %. Dan ' +#13
+ ' 2.> Ukuran Kluster dalam populasi sebesar '+Np.Text+' kluster'+#13 end;
if A99.Checked=true then z:= z+2.575; begin
info := ' Jika ingin melakukan survei dimasa yang akan datang dengan ketentuan : '+#13
+ ' 1.> Galat tidak boleh menyimpang lebih besar dari ' +G.Text +#13 + ' Dengan Taraf kepercayaan 99 %. Dan ' +#13
+ ' 2.> Ukuran Kluster dalam populasi sebesar '+Np.Text+'kluster'+#13; end; u2:=u2+(u1/(nnn-1)); u2:=roundto(u2,-3); u3:=u3+((nnnp*z*z*u2)/((nnnp*gg*gg*tot121*tot121)+(z*z*u2))); u3:=roundto(u3,-3); u4:=u4+u3; u4:=roundto(u4,0); nn1.Caption:=FormatFloat('#,##0.000',u3);
ket4.Caption:=info +#13+ ' Maka Ukuran Sampel Kluster yang harus terpilih sebanyak ' + nn1.Caption+' kluster' +#13
+' dibulatkan menjadi =' +FloatToStr(u4)+' Kluster'; end;
unit singleUNequal;
procedure TFsingleUNequal.FormCreate(Sender: TObject); begin
StatusBarutama.Panels.Items[1].Text:='Tanggal :' + FormatDateTime('dddd, dd mmmm yyyy',Now );
StatusBarutama.Panels.Items[3].Text:='Merry Magdalena '; timer1.Enabled:=True;
StatusBarutama.Panels.Items[0].Text:='Pengolahan Data - Cluster Samping';
exit.BevelWidth:=4; exit.Color:=clBlue;
bantuan.Caption := ''+ #13+#13
+'Single Stage Un-Equal Size' +#13 +#13 +'Jumlah unit dalam kluster yang terpilih'+#13 + 'TIDAK SAMA BESAR ukurannya ';
end;
procedure TFsingleUNequal.Timer1Timer(Sender: TObject); begin
StatusBarutama.Panels.Items[2].Text:=timetostr(time); end;
procedure TFsingleUNequal.exitClick(Sender: TObject); begin
application.Terminate; end;
procedure TFsingleUNequal.backUTAMAClick(Sender: TObject); begin
FsingleUNequal.Hide; futama.Show;
end;
procedure TFsingleUNequal.lanjutunEQUAL1Click(Sender: TObject); var a: integer;
begin
a:= MessageDlg(' Jika Ingin Melakukan Pendugaan Proporsi Pilih "YES", Jika ingin melakukan pendugaan "Rata-rata dan Total" pilih
"No"',mtConfirmation,mbYesNoCancel,0 ); if a = mrCancel then fsingleUNequal.Show else begin if a= mrYes then begin FsingleUNequal_proporsi.Show; FsingleUNequal.Hide; end else begin FsingleUNEQUAL_tahap_1.Show; FsingleUNequal.Hide; end; end; end; end.
unit singleUNequal_tahap_1; //---save ke file --- procedure TFsingleUNequal_tahap_1.saveToFile(Sender:Tobject); var e,f,g:integer; filee:TIniFile ; begin
mysave.Filter:='reset files (*.INI)|*.INI'; g:=strtoint(n.Text); if mysave.Execute then begin if RightStr(mysave.FileName,4)='.ini' then filee:=TIniFile.Create(mysave.filename) else filee :=TIniFile.Create(mysave.FileName+'.ini'); filee.WriteString('General','Nama',judul.Text); filee.WriteString('General','N',n.Text); filee.WriteString('General','Np',np.Text); for e:=1 to g do begin for f:=1 to 2 do filee.WriteString('General','Data'+IntToStr(e)+IntToStr(f),input_data.C ells[f,e]); end; end; end;
//procedure read from file---
procedure TfsingleUNequal_tahap_1.readFile(Sender:TObject); var
e,f,g:integer; xfilee:TIniFile ; begin
myopen.Filter:='reset files (*.ini)|*.ini'; if myopen.Execute then begin xfilee:=TIniFile.Create(myopen.FileName ); judul.Text:=xfilee.ReadString('General','Nama','fail'); n.Text:= xfilee.ReadString('General','N','0'); np.Text:= xfilee.ReadString('General','Np','0'); g:= strtoint(n.Text); input_data.RowCount:= g+1; for e:=1 to g do begin for f:=1 to 2 do begin input_data.Cells[f,e]:=''; input_data.Cells[0,e]:= IntToStr(e); input_data.Cells[f,e]:= xfilee.ReadString('General','Data'+IntToStr(e)+IntToStr(f),'0'); end; end; end; end;
procedure TFsingleUNequal_tahap_1.FormCreate(Sender: TObject); begin PageControl.ActivePage:=tahap1; QuickRep1.Visible:=false; QuickRep2.Visible:=false; input_data.ColCount :=3; input_data.RowCount:= 2;
input_data.Cells[0,0]:= 'KLUSTER ke-i'; input_data.Cells[1,0]:= 'mi'; input_data.Cells[2,0]:= 'yi'; input_data.Cells[0,1]:='1'; input_data.ColWidths[1]:=45; input_data.ColWidths[2]:=100; StatusBarutama.Panels.Items[1].Text:='Tanggal :' + FormatDateTime('dddd, dd mmmm yyyy',Now ); StatusBarutama.Panels.Items[3].Text:='Merry Magdalena '; timer1.Enabled:=True;
StatusBarutama.Panels.Items[0].Text:='Pengolahan Data - Cluster Samping';
bantu := 'Selamat Datang ke Cluster Sampling - UnEqual Size' +#13 +#13 +'Baru : Pengolahan data baru'
+#13 +#13 +'Buka : Ambil data yang pernah disimpan' +#13 +#13 +'Simpan : Menyimpan data'
+#13 +#13 +'Banyaknya kluster dalam populasi = N' +#13 +#13 +'Banyaknya kluster terpilih = n' +#13 +#13 +'Banyaknya unit dalam kluster terpilih = mi' +#13 +#13 +'Banyaknya elemen dalam kluster terpilih = M'
+#13 +#13 +'Total dari semua pengamatan dlm kluster ke-i =yi' ; bantuan.Caption := bantu;
end;
procedure TFsingleUNequal_tahap_1.Timer1Timer(Sender: TObject); begin
StatusBarutama.Panels.Items[2].Text:=timetostr(time); end;
procedure TFsingleUNequal_tahap_1.exitClick(Sender: TObject); begin
application.Terminate; end;
procedure TFsingleUNequal_tahap_1.backUTAMAClick(Sender: TObject); var a : integer;
begin
a:= MessageDlg('Data tidak akan diproses, Yakin akan ke Menu utama "Un Equal Size"? ',mtConfirmation,mbOKCancel,0);
if a = mrCancel then FsingleUNequal_tahap_1.Show else begin FsingleUNequal.Show; FsingleUNequal_tahap_1.Hide; end; end;
procedure TFsingleUNequal_tahap_1.isi_dataClick(Sender: TObject); var i,k,l: integer;
if strlen(pchar(judul.Text))=0 then
ShowMessage( '> Judul tidak boleh kosong' ) else
if strlen(pchar(np.Text))= 0 then
ShowMessage( '> Jumlah Kluster dlm populasi tidak boleh kosong') else
if strlen(pchar(n.Text))=0 then
ShowMessage('> Jumlah Kluster terpilih tidak boleh kosong') else
begin
k:=StrToInt(n.Text); l:=StrToInt(np.Text); if(k>l) then
ShowMessage('> Kluster terpilih harus lebih kecil dari kluster populasi') else begin input_data.ColCount :=3; input_data.RowCount:= k+1; for i:=1 to (k+1) do begin input_data.Cells[0,i]:= IntToStr(i); input_data.Cells[1,i]:= ''; input_data.Cells[2,i]:= ''; input_data.Enabled:=true; end end end end;
procedure TFsingleUNequal_tahap_1.input_dataClick(Sender: TObject); var InputString : string; c,d :integer; begin c:=input_data.Col; d:=input_data.Row; if c=1 then begin
InputString:= InputBox('Masukkan data', 'Data Kolom mi'+' Baris ke '+inttostr(d), '');
input_data.Cells [c,d]:=InputString; end
else begin
InputString:= InputBox('Masukkan data', 'Data Kolom yi'+' Baris ke '+inttostr(d), '');
input_data.Cells [c,d]:=InputString; end
end;
procedure TFsingleUNequal_tahap_1.bukaClick(Sender: TObject); begin
tahap1.Show; ReadFile(sender);
input_data.Enabled:=true; end;
procedure TFsingleUNequal_tahap_1.simpanClick(Sender: TObject); var a,i,j :integer;
salah :string; begin tahap1.Show; a:=input_data.RowCount-1; salah:=''; if strlen(pchar(judul.Text))=0 then
salah :=salah+'> Judul tidak boleh kosong' +#13; if strlen(pchar(np.Text))= 0 then
salah :=salah+'> Jumlah Kluster dlm populasi tidak boleh kosong' +#13;
if strlen(pchar(n.Text))=0 then
salah :=salah+'> Jumlah Kluster terpilih tidak boleh kosong' +#13; for i:=1 to a do begin for j :=1 to 2 do begin if strlen(pchar(input_data.Cells[j,i]))=0 then
salah:=salah+ 'Input ['+inttostr(j)+','+inttostr(i)+'] kosong'+#13; end; end; if salah='' then saveToFile(sender) else begin
showmessage(salah+'Data HARUS LENGKAP'); end;
end;
procedure TFsingleUNequal_tahap_1.baruClick(Sender: TObject); var e,g : integer;
begin tahap1.Show; isi_data.Visible:=true; judul.Text:=''; n.Text:=''; np.Text:=''; g := input_data.RowCount; for e:=1 to g+1 do begin input_data.Cells[1,e]:= ''; input_data.Cells[2,e]:= ''; end; end;
procedure TFsingleUNequal_tahap_1.lanjutunEQUAL2Click(Sender: TObject); var nn,nnp,i,baris :integer;
begin panel5.Visible:=true; panel6.Visible:=false; nn:=strtoint(n.Text); nnp :=strtoint(np.Text); tahap1.Hide; tahap2.Show; u1:=0;
tot1:=0; tot2:=0; rata:=0; tot11:=0; tot12:=0; tot121:=0; tot13:=0; temp:=0; temp1:=0; temp11:=0; temp12:=0; sp1:=0; sp2:=0; sp11:=0; sp12:=0; baris :=input_data.RowCount-1; for i:=1 to baris do
begin
tot1:= tot1+ StrToFloat(input_data.Cells[1,i]); tot2:= tot2+ StrToFloat(input_data.Cells[2,i]); end;
rata:= rata+(tot2/tot1); rata:=roundto(rata,-2); tot121:=tot121+(tot1/nn); tot121:=roundto(tot121,-2); for i:=1 to baris do
begin tot12:= tot12+ (StrToFloat(input_data.Cells[1,i])*StrToFloat(input_data.Cells[1,i])); tot11:= tot11+ (StrToFloat(input_data.Cells[2,i])*StrToFloat(input_data.Cells[2,i])); tot13:= tot13+ (StrToFloat(input_data.Cells[1,i])*StrToFloat(input_data.Cells[2,i])); end; temp:=temp+(tot11-(2*rata*tot13)+(rata*rata*tot12)); u1:=u1+temp; u1:=roundto(u1,-2); temp:=((Nnp-nn)/Nnp)*(1/(nn*tot121*tot121))*(temp/(nn-1)); temp1:=temp1+(sqrt(temp)); temp:=roundto(temp,-2); temp1:=roundto(temp1,-2); temp11:=temp11+(1.96*temp1); temp12:=temp12+(2.575*temp1); temp11:=roundto(temp11,-2); temp12:=roundto(temp12,-2); sp1:=sp1+(rata-temp11); sp2:=sp2+(rata+temp11); sp1:=roundto(sp1,-2); sp2:=roundto(sp2,-2); sp11:=sp11+(rata-temp12); sp12:=sp12+(rata+temp12); sp11:=roundto(sp11,-2); sp12:=roundto(sp12,-2); hasil1.Cells[1,1]:=FormatFloat('#,##0.00',tot1); hasil1.Cells[2,1]:=FormatFloat('#,##0.00',tot2); hasil2.Cells[1,1]:=FormatFloat('#,##0.00',rata); hasil2.Cells[1,2]:=FormatFloat('#,##0.00',temp);
hasil2.Cells[1,3]:=FormatFloat('#,##0.00',temp1); hasil3.Cells[1,1]:=FormatFloat('#,##0.00',temp11); hasil3.Cells[2,1]:=FormatFloat('#,##0.00',temp12); hasil3.Cells[1,2]:='['+FormatFloat('#,##0.00',sp1)+' ; '+FormatFloat('#,##0.00',sp2)+']'; hasil3.Cells[2,2]:='['+FormatFloat('#,##0.00',sp11)+' ; '+FormatFloat('#,##0.00',sp12)+']'; ket := ''+#13
+ ' 1.> Rata-rata populasi diperkirakan sebesar ' + hasil2.Cells[1,1]+' .'+#13 +#13
+ ' 2.> Dengan menggunakan taraf kepercayaan 95% diyakini bahwa penyimpangan yang terjadi atas '+ #13 + ' pendugaan no.1 akan lebih kecil dari '+hasil3.Cells[1,1]+' .'+#13+#13
+ ' 3.> Dengan menggunakan taraf kepercayaan 99% diyakini bahwa penyimpangan yang terjadi atas '+ #13 + ' pendugaan no.1 akan lebih kecil dari '+hasil3.Cells[2,1]+' .'+#13 +#13
+ ' 4.> Dengan menggunakan taraf kepercayaan 95% diyakini bahwa selang nilai '+ hasil3.Cells[1,2]+ #13
+ 'akan mencakup rata-rata yang sesungguhnya dari populasi.'+#13 +#13 + ' 5.> Dengan menggunakan taraf kepercayaan 99% diyakini bahwa selang nilai '+ hasil3.Cells[2,2] + #13
+'akan mencakup rata-rata yang sesungguhnya dari populasi.'+#13 +#13; KETERangan.Caption:=ket;
end;
procedure TFsingleUNequal_tahap_1.tahap2Show(Sender: TObject); begin hasil1.Cells[1,0]:= 'mi'; hasil1.Cells[2,0]:= 'yi'; hasil1.Cells[0,1]:= 'Total'; hasil2.Cells[1,0]:= 'Hasil'; hasil2.Cells[0,1]:= 'Rata-rata'; hasil2.Cells[0,2]:= 'Ragam'; hasil2.Cells[0,3]:= 'Galat Baku'; hasil3.Cells[0,0]:= 'Alpha'; hasil3.Cells[1,0]:= ' 5%'; hasil3.Cells[2,0]:= '1%';
hasil3.Cells[0,1]:= 'Batas Galat';
hasil3.Cells[0,2]:= 'Selang kepercayaan'; end;
procedure TFsingleUNequal_tahap_1.FormShow(Sender: TObject); begin
PageControl.ActivePage:=tahap1; end;
procedure TFsingleUNequal_tahap_1.cetak1Click(Sender: TObject); begin
QRjudul.Caption:='PENGOLAHAN DATA "Cluster Sampling Single Stage - UnEqual Size"'; QR1.Caption:= judul.Text; QR2.Caption:= np.Text; QR3.Caption:= n.Text; with hasil1 do begin QR4.Caption:= hasil1.Cells[1,1]; QR5.Caption:= hasil1.Cells[2,1];
end; with hasil2 do begin QR6.Caption:= hasil2.Cells[1,1]; QR7.Caption:= hasil2.Cells[1,2]; QR8.Caption:= hasil2.Cells[1,3]; end; with hasil3 do begin QR9.Caption:= hasil3.Cells[1,1]; QR10.Caption:= hasil3.Cells[1,2];; QR11.Caption:= hasil3.Cells[2,1]; QR12.Caption:= hasil3.Cells[2,2];; end; QRMemo1.Lines.Clear;
QRMemo1.Lines.Add(' 1.> Rata-rata populasi diperkirakan sebesar '+ QR6.Caption );
QRMemo1.Lines.Add('');
QRMemo1.Lines.Add(' 2.> Dengan menggunakan taraf kepercayaan 95% diyakini bahwa penyimpangan yang terjadi atas');
QRMemo1.Lines.Add('pendugaan no.1 akan lebih kecil dari'+ QR9.Caption+' .');
QRMemo1.Lines.Add('');
QRMemo1.Lines.Add(' 3.> Dengan menggunakan taraf kepercayaan 95% diyakini bahwa selang nilai '+ QR10.Caption);
QRMemo1.Lines.Add(' akan mencakup rata-rata yang sesungguhnya dari populasi. ');
QRMemo1.Lines.Add('');
QRMemo1.Lines.Add(' 4.> Dengan menggunakan taraf kepercayaan 99% diyakini bahwa penyimpangan yang terjadi atas');
QRMemo1.Lines.Add(' pendugaan no.1 akan lebih kecil dari '+ QR11.Caption+'.');
QRMemo1.Lines.Add('');
QRMemo1.Lines.Add(' 5.> Dengan menggunakan taraf kepercayaan 95% diyakini bahwa selang nilai '+ QR12.Caption);
QRMemo1.Lines.Add(' akan mencakup rata-rata yang sesungguhnya dari populasi. ');
QRMemo1.Lines.Add(''); QRMemo1.Show;
QuickRep1.Preview; end;
procedure TFsingleUNequal_tahap_1.totalClick(Sender: TObject); begin tahap2.Hide; tahap3.Show; panel6.Visible:=true; panel5.Visible:=false; end;
procedure TFsingleUNequal_tahap_1.yaClick(Sender: TObject); begin
hitung.Visible:=true; label10.Visible:=true; m.Visible:=true;
Label11.Caption:= 'Hasil Pendugaan Nilai Total Populasi dengan M diketahui';
hasil4.Cells[1,1]:=''; hasil4.Cells[1,2]:=''; hasil4.Cells[1,3]:=''; hasil5.Cells[1,1]:=''; hasil5.Cells[2,1]:=''; hasil5.Cells[1,2]:=''; hasil5.Cells[2,2]:=''; end;
procedure TFsingleUNequal_tahap_1.tahap3Show(Sender: TObject); begin
hasil4.Cells[1,0]:= 'Hasil';
hasil4.Cells[0,1]:= 'Nilai Total'; hasil4.Cells[0,2]:= 'Ragam';
hasil4.Cells[0,3]:= 'Galat Baku'; hasil5.Cells[0,0]:= 'Alpha'; hasil5.Cells[1,0]:= ' 5%'; hasil5.Cells[2,0]:= '1%';
hasil5.Cells[0,1]:= 'Batas Galat';
hasil5.Cells[0,2]:= 'Selang kepercayaan'; end;
procedure TFsingleUNequal_tahap_1.hitungClick(Sender: TObject); var mm :Extended; y1 :string; begin cetak2.Visible:=true; mm:=StrToFloat(m.Text); temp2:=0; sp3:=0; temp3:=0; sp4:=0; temp4:=0; temp5:=0; temp6:=0; sp31:=0; sp41:=0; temp2:=temp2+ (mm*rata); temp2:=roundto(temp2,-2); temp3:=temp3+(mm*mm*temp); temp3:=roundto(temp3,-2); temp4:=temp4+(sqrt(temp3)); temp4:=roundto(temp4,-2); temp5:=temp5+(1.96*temp4); temp6:=temp6+(2.575*temp4); temp5:=roundto(temp5,-2); temp6:=roundto(temp6,-2); sp3:=sp3+(temp2-temp5); sp4:=sp4+(temp2+temp5); sp3:=roundto(sp3,-2); sp4:=roundto(sp4,-2); sp31:=sp31+(temp2-temp6); sp41:=sp41+(temp2+temp6); sp31:=roundto(sp31,-2); sp41:=roundto(sp41,-2); y1:='';
y1:=y1+FormatFloat('0',temp2); hasil4.Cells[1,1]:=FormatFloat('#,##0.00',temp2); hasil4.Cells[1,2]:=FormatFloat('#,##0.00',temp3); hasil4.Cells[1,3]:=FormatFloat('#,##0.00',temp4); hasil5.Cells[1,1]:=FormatFloat('#,##0.00',temp5); hasil5.Cells[2,1]:=FormatFloat('#,##0.00',temp6); hasil5.Cells[1,2]:='['+FormatFloat('#,##0.00',sp3)+' ; '+FormatFloat('#,##0.00',sp4)+']'; hasil5.Cells[2,2]:='['+FormatFloat('#,##0.00',sp31)+' ; '+FormatFloat('#,##0.00',sp41)+']';
ket1 := ''+#13 + ' 1.> Total populasi diperkirakan sebesar ' + hasil4.Cells[1,1]+' . Dibulatkan menjadi = '+y1+' .'+#13 +#13
+ ' 2.> Dengan menggunakan taraf kepercayaan 95% diyakini bahwa penyimpangan yang terjadi atas '+ #13 + ' pendugaan no.1 akan lebih kecil dari '+hasil5.Cells[1,1]+' .'+#13+#13
+ ' 3.> Dengan menggunakan taraf kepercayaan 99% diyakini bahwa penyimpangan yang terjadi atas '+ #13 + ' pendugaan no.1 akan lebih kecil dari '+hasil5.Cells[2,1]+' .'+#13 +#13
+ ' 4.> Dengan menggunakan taraf kepercayaan 95% diyakini bahwa selang nilai '+ hasil5.Cells[1,2]+ #13
+ ' akan mencakup total seluruh elemen dari populasi. '+#13 +#13 + ' 5.> Dengan menggunakan taraf kepercayaan 99% diyakini bahwa selang nilai '+ hasil5.Cells[2,2] + #13
+ 'akan mencakup total seluruh elemen dari populasi. '+#13 +#13 ; KEt2.Caption:=ket1;
end;
procedure TFsingleUNequal_tahap_1.tidakClick(Sender: TObject); var nn,nnp :integer; y1:string; begin m.Text:=''; cetak2.Visible:=true; nn:=StrToInt(n.Text); nnp:=StrToInt(np.Text);
Label11.Caption:= 'Hasil Pendugaan Nilai Total Populasi dengan M tidak diketahui'; temp2:=0; sp3:=0; temp3:=0; sp4:=0; temp4:=0; temp5:=0; temp6:=0; temp7:=0; sp31:=0; sp41:=0; label10.Visible:=false; m.Visible:=false; hitung.Visible:=false; hasil4.Cells[1,1]:=''; hasil4.Cells[1,2]:=''; hasil4.Cells[1,3]:=''; hasil5.Cells[1,1]:=''; hasil5.Cells[2,1]:=''; hasil5.Cells[1,2]:='';
hasil5.Cells[2,2]:=''; temp2:=temp2+ ((nnp*tot2)/nn); temp2:=roundto(temp2,-2); temp3:=temp3+((nnp-nn)/nnp); temp3:=roundto(temp3,-2); temp4:=temp4+(tot11-((tot2*tot2)/nn)); temp4:=((nnp*nnp*temp3*temp4)/(nn*(nn-1))); temp4:=roundto(temp4,-2); temp5:=temp5+(sqrt(temp4)); temp5:=roundto(temp5,-2); temp6:=temp6+(1.96*temp5); temp7:=temp7+(2.575*temp5); temp6:=roundto(temp6,-2); temp7:=roundto(temp7,-2); sp3:=sp3+(temp2-temp6); sp4:=sp4+(temp2+temp6); sp3:=roundto(sp3,-2); sp4:=roundto(sp4,-2); sp31:=sp31+(temp2-temp7); sp41:=sp41+(temp2+temp7); sp31:=roundto(sp31,-2); sp41:=roundto(sp41,-2); y1:=''; y1:=y1+FormatFloat('0',temp2); hasil4.Cells[1,1]:=FormatFloat('#,##0.00',temp2); hasil4.Cells[1,2]:=FormatFloat('#,##0.00',temp4); hasil4.Cells[1,3]:=FormatFloat('#,##0.00',temp5); hasil5.Cells[1,1]:=FormatFloat('#,##0.00',temp6); hasil5.Cells[2,1]:=FormatFloat('#,##0.00',temp7); hasil5.Cells[1,2]:='['+FormatFloat('#,##0.00',sp3)+' ; '+FormatFloat('#,##0.00',sp4)+']'; hasil5.Cells[2,2]:='['+FormatFloat('#,##0.00',sp31)+' ; '+FormatFloat('#,##0.00',sp41)+']'; ket3 := ''+#13
+ ' 1.> Total populasi diperkirakan sebesar ' +
hasil4.Cells[1,1]+'. Dibulatkan menjadi = '+y1+' .'+#13 +#13
+ ' 2.> Dengan menggunakan taraf kepercayaan 95% diyakini bahwa penyimpangan yang terjadi atas '+ #13
+ ' pendugaan no.1 akan lebih kecil dari '+hasil5.Cells[1,1]+' .'+#13+#13
+ ' 3.> Dengan menggunakan taraf kepercayaan 99% diyakini bahwa penyimpangan yang terjadi atas '+ #13
+ ' pendugaan no.1 akan lebih kecil dari '+hasil5.Cells[2,1]+' .'+#13 +#13
+ ' 4.> Dengan menggunakan taraf kepercayaan 95% diyakini bahwa selang nilai '+ hasil5.Cells[1,2]+ #13
+ ' akan mencakup total seluruh elemen dari populasi. '+#13 +#13 + ' 5.> Dengan menggunakan taraf kepercayaan 99% diyakini bahwa selang nilai '+ hasil5.Cells[2,2] + #13
+ 'akan mencakup total seluruh elemen dari populasi. '+#13 +#13 ; KEt2.Caption:=ket3;
end;
procedure TFsingleUNequal_tahap_1.cetak2Click(Sender: TObject); begin
QRjudul2.Caption:='PENGOLAHAN DATA "Cluster Sampling Single Stage - UnEqual Size"';
QR13.Caption:= judul.Text; QR14.Caption:= np.Text; QR15.Caption:= n.Text; with hasil1 do begin QR16.Caption:= hasil1.Cells[1,1]; QR17.Caption:= hasil1.Cells[2,1]; end; with hasil2 do begin QR18.Caption:= hasil2.Cells[1,1]; QR19.Caption:= hasil2.Cells[1,2]; QR20.Caption:= hasil2.Cells[1,3]; end; with hasil3 do begin QR21.Caption:= hasil3.Cells[1,1]; QR22.Caption:= hasil3.Cells[1,2];; QR23.Caption:= hasil3.Cells[2,1]; QR24.Caption:= hasil3.Cells[2,2];; end; if strlen(pchar(m.Text))= 0 then QR25.Caption:= ' tidak diketahui ' else QR25.Caption:= m.Text; with hasil4 do begin QR26.Caption:= hasil4.Cells[1,1]; QR27.Caption:= hasil4.Cells[1,2]; QR28.Caption:= hasil4.Cells[1,3]; end; with hasil5 do begin QR29.Caption:= hasil5.Cells[1,1]; QR30.Caption:= hasil5.Cells[1,2];; QR31.Caption:= hasil5.Cells[2,1]; QR32.Caption:= hasil5.Cells[2,2];; end; QRMemo2.Lines.Clear;
QRMemo2.Lines.Add(' 1.> Rata-rata populasi diperkirakan sebesar '+ QR18.Caption );
QRMemo2.Lines.Add('');
QRMemo2.Lines.Add(' 2.> Dengan menggunakan taraf kepercayaan 95% diyakini bahwa penyimpangan yang terjadi atas');
QRMemo2.Lines.Add(' pendugaan no.1 akan lebih kecil dari '+ QR21.Caption+' .');
QRMemo2.Lines.Add('');
QRMemo2.Lines.Add(' 3.> Dengan menggunakan taraf kepercayaan 95% diyakini bahwa selang nilai '+ QR22.Caption);
QRMemo2.Lines.Add(' akan mencakup rata-rata yang sesungguhnya dari populasi. ');
QRMemo2.Lines.Add('');
QRMemo2.Lines.Add(' 4.> Dengan menggunakan taraf kepercayaan 99% diyakini bahwa penyimpangan yang terjadi atas');
QRMemo2.Lines.Add(' pendugaan no.1 akan lebih kecil dari '+ QR23.Caption+'.');
QRMemo2.Lines.Add(' 5.> Dengan menggunakan taraf kepercayaan 95% diyakini bahwa selang nilai '+ QR24.Caption);
QRMemo2.Lines.Add(' akan mencakup rata-rata yang sesungguhnya dari populasi. ');
QRMemo2.Lines.Add(''); QRMemo2.Show;
QRMemo3.Lines.Clear;
QRMemo3.Lines.Add(' 1.> Total populasi diperkirakan sebesar '+ QR26.Caption );
QRMemo3.Lines.Add('');
QRMemo3.Lines.Add(' 2.> Dengan menggunakan taraf kepercayaan 95% diyakini bahwa penyimpangan yang terjadi atas');
QRMemo3.Lines.Add(' pendugaan no.1 akan lebih kecil dari '+ QR29.Caption+' .');
QRMemo3.Lines.Add('');
QRMemo3.Lines.Add(' 3.> Dengan menggunakan taraf kepercayaan 95% diyakini bahwa selang nilai '+ QR30.Caption);
QRMemo3.Lines.Add(' akan mencakup rata-rata yang sesungguhnya dari populasi. ');
QRMemo3.Lines.Add('');
QRMemo3.Lines.Add(' 4.> Dengan menggunakan taraf kepercayaan 99% diyakini bahwa penyimpangan yang terjadi atas');
QRMemo3.Lines.Add(' pendugaan no.1 akan lebih kecil dari '+ QR31.Caption+'.');
QRMemo3.Lines.Add('');
QRMemo3.Lines.Add(' 5.> Dengan menggunakan taraf kepercayaan 95% diyakini bahwa selang nilai '+ QR32.Caption);
QRMemo3.Lines.Add(' akan mencakup rata-rata yang sesungguhnya dari populasi. ');
QRMemo3.Lines.Add(''); QRMemo3.Show;
QuickRep2.Preview; end;
procedure TFsingleUNequal_tahap_1.hitung2Click(Sender: TObject); var info :string;
z,u4,gg :extended; nnnp,nnn :integer; begin z:=0; u2:=0; u3:=0; u4:=0; gg:=StrToFloat(g.Text); nnnp:=StrToInt(Np.Text); nnn:=strtoint(n.Text); if A95.Checked=true then begin z:= z+1.96;
info := ' Jika ingin melakukan survei dimasa yang akan datang dengan ketentuan : '+#13
+ ' 1.> Galat tidak boleh menyimpang lebih besar dari ' +G.Text +#13
+ ' Dengan Taraf kepercayaan 95 %. Dan ' +#13
+ ' 2.> Ukuran Kluster dalam populasi sebesar '+Np.Text+' kluster'+#13
if A99.Checked=true then z:= z+2.575; begin
info := ' Jika ingin melakukan survei dimasa yang akan datang dengan ketentuan : '+#13
+'1.> Galat tidak boleh menyimpang lebih besar dari ' +G.Text +#13 +'Dengan Taraf kepercayaan 99 %. Dan ' +#13
+'2.> Ukuran Kluster dalam populasi sebesar '+Np.Text+' kluster'+#13; end; u2:=u2+(u1/(nnn-1)); u2:=roundto(u2,-3); u3:=u3+((nnnp*z*z*u2)/((nnnp*gg*gg*tot121*tot121)+(z*z*u2))); u3:=roundto(u3,-3); nn1.Caption:=FormatFloat('#,##0.000',u3); u4:=u4+u3; u4:=roundto(u4,0);
ket4.Caption:=info +#13+ ' Maka Ukuran Sampel Kluster yang harus terpilih sebanyak ' + nn1.Caption+' kluster' +#13
+' dibulatkan menjadi =' +FloatToStr(u4)+' Kluster'; end;
procedure TFsingleUNequal_tahap_1.ukuranClick(Sender: TObject); begin panel5.Visible:=true; panel6.Visible:=false; tahap4.Show; tahap3.Hide; end; end.
unit singleUNequal_proporsi; procedure TFsingleUNequal_proporsi.saveToFile(Sender:Tobject); var e,f,g:integer; filee:TIniFile ; begin
mysave.Filter:='reset files (*.INI)|*.INI'; g:=strtoint(n.Text); if mysave.Execute then begin if RightStr(mysave.FileName,4)='.ini' then filee:=TIniFile.Create(mysave.filename) else filee :=TIniFile.Create(mysave.FileName+'.ini'); filee.WriteString('General','Nama',judul.Text); filee.WriteString('General','N',n.Text); filee.WriteString('General','Np',np.Text); for e:=1 to g do begin for f:=1 to 2 do filee.WriteString('General','Data'+IntToStr(e)+IntToStr(f),input_data.C ells[f,e]); end; end; end;
//procedure read from file---
procedure TFsingleUNequal_proporsi.readFile(Sender:TObject); var
e,f,g:integer; xfilee:TIniFile ; begin
myopen.Filter:='reset files (*.ini)|*.ini'; if myopen.Execute then begin xfilee:=TIniFile.Create(myopen.FileName ); judul.Text:=xfilee.ReadString('General','Nama','fail'); n.Text:= xfilee.ReadString('General','N','0'); np.Text:= xfilee.ReadString('General','Np','0'); g:= strtoint(n.Text); input_data.RowCount:= g+1; for e:=1 to g do begin for f:=1 to 2 do begin input_data.Cells[f,e]:=''; input_data.Cells[0,e]:= IntToStr(e); input_data.Cells[f,e]:= xfilee.ReadString('General','Data'+IntToStr(e)+IntToStr(f),'0'); end; end; end; end;
procedure TFsingleUNequal_proporsi.FormCreate(Sender: TObject); begin
QuickRep1.Visible:=false; input_data.ColCount :=3; input_data.RowCount:= 2;
input_data.Cells[0,0]:= 'KLUSTER ke-i'; input_data.Cells[1,0]:= 'mi'; input_data.Cells[2,0]:= 'yi'; input_data.Cells[0,1]:='1'; input_data.ColWidths[1]:=45; input_data.ColWidths[2]:=100; StatusBarutama.Panels.Items[1].Text:='Tanggal :' + FormatDateTime('dddd, dd mmmm yyyy',Now ); StatusBarutama.Panels.Items[3].Text:='Merry Magdalena '; timer1.Enabled:=True;
StatusBarutama.Panels.Items[0].Text:='Pengolahan Data - Cluster Samping';
exit.BevelWidth:=4; exit.Color:=clBlue;
bantu := 'Selamat Datang ke Cluster Sampling - UnEqual Size' +#13 +#13 +'Baru : Pengolahan data baru'
+#13 +#13 +'Buka : Ambil data yang pernah disimpan' +#13 +#13 +'Simpan : Menyimpan data'
+#13 +#13 +'N = Banyaknya kluster dalam populasi' +#13 +#13 +'n = Banyaknya kluster terpilih'
+#13 +#13 +'mi = Banyaknya unit dalam kluster terpilih = mi' +#13 +#13 +'M = Banyaknya elemen dalam kluster terpilih = M' +#13 +#13 +'ai = Total dari banyaknya elemen dalam cluster ke-i ' +#13 +#13 +' yang memiliki karakteristik yang dipelajari. '; bantuan.Caption := bantu;
end;
procedure TFsingleUNequal_proporsi.Timer1Timer(Sender: TObject); begin
StatusBarutama.Panels.Items[2].Text:=timetostr(time); end;
procedure TFsingleUNequal_proporsi.exitClick(Sender: TObject); begin
application.Terminate; end;
procedure TFsingleUNequal_proporsi.backUTAMAClick(Sender: TObject); var a : integer;
begin
a:= MessageDlg('Data tidak akan diproses, Yakin akan ke Menu utama "Un Equal Size"? ',mtConfirmation,mbOKCancel,0);
if a = mrCancel then FsingleUNequal_tahap_1.Show else begin FsingleUNequal.Show; FsingleUNequal_tahap_1.Hide; end; end;
procedure TFsingleUNequal_proporsi.isi_dataClick(Sender: TObject); var i,k,l: integer;