From a94a601c982986d57ad4146c8f974c8945ee771d Mon Sep 17 00:00:00 2001 From: Jakub Adamski Date: Mon, 23 May 2022 13:46:09 +0200 Subject: [PATCH] init projekt1 fix --- Projekt_1/T-student-single.R | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/Projekt_1/T-student-single.R b/Projekt_1/T-student-single.R index 5afcf65..d13fc49 100644 --- a/Projekt_1/T-student-single.R +++ b/Projekt_1/T-student-single.R @@ -20,14 +20,19 @@ attach(Hamulce) size_Hamulce <- length(Hamulce$Wynik) -bootstrappedData_Wynik <- ourBoot(Hamulce$Wynik, 200, size_Hamulce) - -# funkcja wbudowana -t.test(bootstrappedData_Wynik,mu=18.6,alternative='less') -# nasza funkcja -t.test_single(bootstrappedData_Wynik, m=18.6, alternative='less') - +#Z bootstrapem +wyniki <- data.frame() +for (i in 1:10) { + bootstrappedData_Wynik <- ourBoot(Hamulce$Wynik, size_Hamulce, size_Hamulce) + # nasza funkcja + ttest <- t.test_single(bootstrappedData_Wynik, m=18.6, alternative='less') + wyniki <- rbind(wyniki, ttest) +} +mean(wyniki$mean) +mean(wyniki$statistic) +mean(wyniki$p.value) +#Bez bootstrapa # funkcja wbudowana t.test(Wynik,mu=18.6,alternative='less') # nasza funkcja