setwd("C:/Users/luiza/Downloads") fishing<-read.csv2("fishing_intensity2.csv", sep=";") names(fishing) ### Dados brutos ### shapiro.test(fishing$dado) # p-value < 2.2e-16, sem distribuicao normal library(boot) citation("boot") citation() estatistica <- function(data, i) { amostra <- data[i] return(mean(amostra)) } resultado_bootstrap <- boot(data = fishing$dado, statistic = estatistica, R = 1000) intervalo_confianca <- boot.ci(resultado_bootstrap, type = "basic") # BOOTSTRAP CONFIDENCE INTERVAL CALCULATIONS # Based on 1000 bootstrap replicates # Intervals : # Level Basic # 95% ( 0.3908, 0.5593 ) ### Dados logaritmizados ### # Não existe log de zero, então para vários itens não foi possível calcular # Assim sendo, recalculei o logaritmo para os dados brutos novamente, mas somando uma unidade para anular os zeros fishing$log_1<-log(fishing$dado_1) shapiro.test(fishing$log_1) # p-value < 2.2e-16, sem distribuicao normal resultado_bootstrap2 <- boot(data = fishing$log_1, statistic = estatistica, R = 1000) intervalo_confianca2 <- boot.ci(resultado_bootstrap2, type = "basic") # BOOTSTRAP CONFIDENCE INTERVAL CALCULATIONS # Based on 1000 bootstrap replicates # Intervals : # Level Basic # 95% ( 0.2034, 0.2360 )