-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsampleSizes.R
More file actions
58 lines (43 loc) · 1.51 KB
/
sampleSizes.R
File metadata and controls
58 lines (43 loc) · 1.51 KB
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
library(tidyverse)
library(readr)
database <- read_csv("dados/experimento6.csv")
expSmall <- filter(database, request_size=="small")
expBig <- filter(database, request_size=="big")
exp1 <- expSmall
javahttp <- filter(exp1, app_name=="javahttp")
javagrpc <- filter(exp1, app_name=="javagrpc")
gohttp <- filter(exp1, app_name=="gohttp")
gogrpc <- filter(exp1, app_name=="gogrpc")
remover_outliers <- function(dados, campo) {
Q1 <- quantile(dados[[campo]], 0.25)
Q3 <- quantile(dados[[campo]], 0.75)
IQR <- Q3 - Q1
limite_inferior <- Q1 - 3.5 * IQR
limite_superior <- Q3 + 3.5 * IQR
dados_filtrados <- dados[dados[[campo]] >= limite_inferior & dados[[campo]] <= limite_superior, ]
return(dados_filtrados)
}
javahttp <- remover_outliers(javahttp, "value")
javagrpc <- remover_outliers(javagrpc, "value")
gohttp <- remover_outliers(gohttp, "value")
gogrpc <- remover_outliers(gogrpc, "value")
set.seed(77777)
javahttp <- sample_n(javahttp, 10)
javagrpc <- sample_n(javagrpc, 10)
gohttp <- sample_n(gohttp, 10)
gogrpc <- sample_n(gogrpc, 10)
xjavahttp <- mean(javahttp$value)
sjavahttp <- sd(javahttp$value)
xjavagrpc <- mean(javagrpc$value)
sjavagrpc <- sd(javagrpc$value)
xgohttp <- mean(gohttp$value)
sgohttp <- sd(gohttp$value)
xgogrpc <- mean(gogrpc$value)
sgogrpc <- sd(gogrpc$value)
n <- 10
z <- 1.833 # 95% 9df
r <- 5
szjavahttp = ((100*z*sjavagrpc)/(r*xjavahttp))^2
szjavagrpc = ((100*z*sjavagrpc)/(r*xjavagrpc))^2
szgohttp = ((100*z*sjavagrpc)/(r*xgohttp))^2
szgogrpc = ((100*z*sjavagrpc)/(r*xgogrpc))^2