-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.Rhistory
267 lines (267 loc) · 9.19 KB
/
.Rhistory
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
binom.test(10, 24, 0,5)
binom.test(10, 24, 0.5)
binom.test(7, 20, "two sided", 0,95)
binom.test(7, 20, 0.5, "two sided", 0.95)
binom.test(7, 20, 0.5, "two.sided", 0.95)
binom.test(8, 30, 0.5, "two.sided", 0.95)
binom.test(10, 24, 0.5)
binom.test(7, 20, 0.5, "two.sided", 0.95)
binom.test(8, 30, 0.5, "two.sided", 0.95)
binom.test(4, 13, 0.5)
binom.test(5, 20, 0.5, alternative = "less")
binom.test(15, 20, 0.5, alternative = "greater")
binom.test(24, 30, 0.5, alternative = "greater")
binom.test(6, 30, 0.5, alternative = "less")
binom.test(3, 10, 0.5, "two.sided")
binom.test(4, 10, 0.5, alternative = "two.sided")
binom.test(4, 10, 0.5, "two.sided")
pengunjung<- matrix(c(64, 76, 60), dimnames=list(c("Lab A", "Lab B", "Lab C"), c("Jumlah")))
pengunjung
chisq.test(pengunjung)
hadiah<- matrix(c(183, 142, 175), dimnames=list(c("T-Shirt", "Anting-anting", "mug"), c("Jumlah")))
hadiah
chisq.test(hadiah)
pil_kepala_desa <- matrix(c(200, 100), dimnames = list(c("Pria", "Wanita"), c("Jumlah")))
pil_kepala_desa
chisq.test(pil_kepala_desa)
pilihan_cat <- matrix(c(1000, 900, 600, 500),
dimnames = list(c("Biru", "Merah", "Putih", "Lainnya"),
c("Jumlah")))
pilihan_cat
chisq.test(pilihan_cat)
kemasan <- matrix(c(19, 9, 7, 5),
dimnames = list(c("Kemasan 1", "Kemasan 2", "Kemasan 3", "Kemasan 4"),
c("Frekuensi (hari)")))
kemasan
chisq.test(kemasan)
binom.test(5, 20, 0.5, alternative = "less")
binom.test(15, 20, 0.5, alternative = "greater")
pilihan_cat <- matrix(c(1000, 900, 600, 500),
dimnames = list(c("Biru", "Merah", "Putih", "Lainnya"),
c("Jumlah")))
pilihan_cat
chisq.test(pilihan_cat)
kemasan <- matrix(c(19, 9, 7, 5),
dimnames = list(c("Kemasan 1", "Kemasan 2", "Kemasan 3", "Kemasan 4"),
c("Frekuensi (hari)")))
kemasan
chisq.test(kemasan)
skor<- factor(c("+", "-", "+", "+", "+", "+", "-", "+", "+", "+", "-", "-", "-", "-", "+", "-", "-", "+", "+", "-", "-", "-", "-"))
skor
library(series)
install.packages("series")
skor<- factor(c("+", "-", "+", "+", "+", "+", "-", "+", "+", "+", "-", "-", "-", "-", "+", "-", "-", "+", "+", "-", "-", "-", "-"))
skor
install.packages("series")
library(series)
library(series)
library(series)
install.packages("series")
writeLines('PATH="${RTOOLS40_HOME}\\usr\\bin;${PATH}"', con = "~/.Renviron")
install.packages("zoo") # Atau package lain sesuai kebutuhanmu
library(zoo)
runs.test(skor)
install.packages("series")
install.packages("tseries")
library(zoo)
runs.test(skor)
skor
runs.test(skor)
skor
runs.test(skor)
skor<- factor(c("+", "-", "+", "+", "+", "+", "-", "+", "+", "+", "-", "-", "-", "-", "+", "-", "-", "+", "+", "-", "-", "-", "-"))
runs.test(skor)
library(zoo)
runs.test(skor)
library(series)
library(series)
skor<- factor(c("+", "-", "+", "+", "+", "+", "-", "+", "+", "+", "-", "-", "-", "-", "+", "-", "-", "+", "+", "-", "-", "-", "-"))
skor
install.packages("tseries")
library(series)
library(tseries)
runs.test(skor)
median_value <- median(unlist(list_skor_petani))
list_skor_petani<-list(45, 65, 35, 70, 60, 50, 30, 90, 85, 90, 40, 80, 55, 30, 75)
median_value <- median(unlist(list_skor_petani))
print(median_value)
tanda <- sapply(unlist(list_skor_petani), function(x) {
if (x <= median_value) {
return("-")
} else {
return("+")
}
})
tanda
skor_petani<-factor(c("-" "+" "-" "+" "-" "-" "-" "+" "+" "+" "-" "+" "-" "-" "+"))
skor_petani<- factor(c("-" "+" "-" "+" "-" "-" "-" "+" "+" "+" "-" "+" "-" "-" "+"))
skor_petani <- factor(c("-", "+", "-", "+", "-", "-", "-", "+", "+", "+", "-", "+", "-", "-", "+"))
print(skor_petani)
install.packages("tseries")
library(tseries)
runs.test(skor_petani)
skor_petani <- factor(c("-", "+", "-", "+", "-", "-", "+", "+", "+", "-", "+", "-", "-", "+"))
print(skor_petani)
library(tseries)
runs.test(skor_petani)
# Data asli: P untuk pria, W untuk wanita
data_gender <- c("P", "P", "W", "W", "P", "W", "P", "W", "P", "W",
"P", "P", "P", "P", "W", "P", "W", "W", "W", "P",
"W", "P", "W", "P", "W", "P", "P", "W", "P", "P",
"W", "P", "P", "P", "P", "W", "P", "W", "P", "P")
# Mengonversi "P" menjadi "+" dan "W" menjadi "-"
peserta_latihan <- factor(ifelse(data_gender == "P", "+", "-"))
# Menampilkan hasil
print(peserta_latihan)
library(tseries)
runs.test(peserta_latiha)
runs.test(peserta_latihan)
peserta_latihan <- factor(ifelse(data_gender == "W", "+", "-"))
print(peserta_latihan)
library(tseries)
runs.test(peserta_latihan)
peserta_latihan <- factor(ifelse(data_gender == "P", "+", "-"))
print(peserta_latihan)
library(tseries)
runs.test(peserta_latihan)
skor_adop<-list(45, 65, 35, 70, 50, 30, 90, 85, 90, 40, 80, 55, 30, 75)
median_skor_adopsi<- median(unlist(skor_adop))
print(median_skor_adopsi)
tanda <- sapply(unlist(skor_adop), function(x) {
if (x <= median_value) {
return("-")
} else {
return("+")
}
})
tanda
skor_adop<-list(45, 65, 35, 70, 50, 30, 90, 85, 90, 40, 80, 55, 30, 75)
median_skor_adopsi<- median(unlist(skor_adop))
print(median_skor_adopsi)
tanda2 <- sapply(unlist(skor_adop), function(x) {
if (x <= median_value) {
return("-")
} else {
return("+")
}
})
tanda2
peserta_latihan<- factor(c(""))
data_gender <- c("P", "P", "W", "W", "P", "W", "P", "W", "P", "W",
"P", "P", "P", "P", "W", "P", "W", "W", "W", "P",
"W", "P", "W", "P", "W", "P", "P", "W", "P", "P",
"W", "P", "P", "P", "P", "W", "P", "W", "P", "P")
peserta_latihan <- factor(ifelse(data_gender == "P", "+", "-"))
print(peserta_latihan)
library(tseries)
runs.test(peserta_latihan)
library(tseries)
runs.test(plus_minus_skor_adopsi)
## PPT hal 65
skor_adop<-list(45, 65, 35, 70, 50, 30, 90, 85, 90, 40, 80, 55, 30, 75)
median_skor_adopsi<- median(unlist(skor_adop))
print(median_skor_adopsi)
tanda2 <- sapply(unlist(skor_adop), function(x) {
if (x <= median_value) {
return("-")
} else {
return("+")
}
})
tanda2
plus_minus_skor_adopsi<- factor(c("-", "+", "-", "+", "-", "-", "+", "+", "+", "-", "+", "-", "-", "+"))
library(tseries)
runs.test(plus_minus_skor_adopsi)
binom.test(5, 20, 0.5, alternative = "less")
# PPT Hal. 30 Latihan 2
binom.test(5, 20, 0.5, alternative = "less", 0.95)
# Data nilai ujian siswa
nilai_ujian <- c(65, 45, 49, 74, 80, 90, 64, 57, 68, 54, 76, 72, 64, 52, 90, 94, 58, 60, 58, 69, 79, 83, 66, 62, 82, 84, 52, 41, 62, 76)
# Median dari data
median_nilai <- 65.5
# Mengelompokkan nilai berdasarkan median
skor <- factor(ifelse(nilai_ujian > median_nilai, "+", "-"))
# Menampilkan hasil pengelompokkan
print(skor)
# Memuat library tseries
library(tseries)
# Melakukan uji runs
hasil_uji_runs <- runs.test(skor)
# Menampilkan hasil uji runs
print(hasil_uji_runs)
# Data nilai ujian siswa
nilai_ujian <- c(65, 45, 49, 74, 80, 90, 64, 57, 68, 54, 76, 72, 64, 52, 90, 94, 58, 60, 58, 69, 79, 83, 66, 62, 82, 84, 52, 41, 62, 76)
# Menghitung median dari data nilai ujian
median_nilai <- median(nilai_ujian)
# Menampilkan median
print(paste("Median nilai ujian adalah:", median_nilai))
# Mengelompokkan nilai berdasarkan median
skor <- factor(ifelse(nilai_ujian > median_nilai, "+", "-"))
# Menampilkan hasil pengelompokkan
print(skor)
# Install paket tseries (jika belum terinstall)
# install.packages("tseries")
# Memuat library tseries
library(tseries)
# Melakukan uji runs
hasil_uji_runs <- runs.test(skor)
# Menampilkan hasil uji runs
print(hasil_uji_runs)
## PPT Hal. 66 Latihan 3
# Data nilai ujian siswa
nilai_ujian <- c(65, 45, 49, 74, 80, 90, 64, 57, 68, 54, 76, 72, 64, 52, 90, 94, 58, 60, 58, 69, 79, 83, 66, 62, 82, 84, 52, 41, 62, 76)
# Menghitung median dari data nilai ujian
median_nilai <- median(nilai_ujian)
# Menampilkan median
print(paste("Median nilai ujian adalah:", median_nilai))
# Mengelompokkan nilai berdasarkan median
skor <- factor(ifelse(nilai_ujian > median_nilai, "+", "-"))
print(skor)
library(tseries)
# Melakukan uji runs
hasil_uji_runs <- runs.test(skor)
print(hasil_uji_runs)
## PPT Hal. 66 Latihan 3
# Data nilai ujian siswa
nilai_ujian <- c(65, 45, 49, 74, 80, 90, 64, 57, 68, 54, 76, 72, 64, 52, 90, 94, 58, 60, 58, 69, 79, 83, 66, 62, 82, 84, 52, 41, 62, 76)
# Menghitung median dari data nilai ujian
median_nilai <- median(nilai_ujian)
# Menampilkan median
print(paste("Median nilai ujian adalah:", median_nilai))
# Mengelompokkan nilai berdasarkan median
skor <- factor(ifelse(nilai_ujian > median_nilai, "+", "-"))
print(skor)
library(tseries)
# Melakukan uji runs
hasil_uji_runs <- runs.test(skor)
print(hasil_uji_runs)
## Modul Praktikum Hal. 19 Latihan 4
# Data total skor responden
total_skor <- c(45, 65, 35, 70, 60, 50, 30, 90, 85, 90, 40, 80, 55, 30, 75)
# Menghitung median menggunakan fungsi median()
median_skor <- median(total_skor)
# Menampilkan median
print(paste("Median total skor adalah:", median_skor))
# Mengelompokkan skor berdasarkan median
skor <- factor(ifelse(total_skor > median_skor, "+", "-"))
print(skor)
library(tseries)
# Melakukan uji runs
hasil_uji_runs <- runs.test(skor)
print(hasil_uji_runs)
## Modul Praktikum Hal. 19 Latihan 4
# Data total skor responden
total_skor <- c(45, 65, 35, 70, 60, 50, 30, 90, 85, 90, 40, 80, 55, 30, 75)
# Menghitung median menggunakan fungsi median()
median_skor <- median(total_skor)
# Menampilkan median
print(paste("Median total skor adalah:", median_skor))
# Menghapus nilai yang sama dengan median
total_skor_filtered <- total_skor[total_skor != median_skor]
# Mengelompokkan skor berdasarkan median
skor <- factor(ifelse(total_skor_filtered > median_skor, "+", "-"))
print(skor)
library(tseries)
# Melakukan uji runs
hasil_uji_runs <- runs.test(skor)
print(hasil_uji_runs)