criando testes usando randomizações. m = c(120,107,110,116,114,111,113,117,114,112) > f =...

29
Criando testes usando randomizações

Upload: gabriel-gallagher

Post on 26-Mar-2015

215 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Criando testes usando randomizações. m = c(120,107,110,116,114,111,113,117,114,112) > f = c(110,111,107,108,110,105,107,106,111,111) boxplot(m,f, names

Criando testes usando randomizações

Page 2: Criando testes usando randomizações. m = c(120,107,110,116,114,111,113,117,114,112) > f = c(110,111,107,108,110,105,107,106,111,111) boxplot(m,f, names

• m = c(120,107,110,116,114,111,113,117,114,112)• > f = c(110,111,107,108,110,105,107,106,111,111)• boxplot(m,f, names = c("machos", "fêmeas"))

Page 3: Criando testes usando randomizações. m = c(120,107,110,116,114,111,113,117,114,112) > f = c(110,111,107,108,110,105,107,106,111,111) boxplot(m,f, names
Page 4: Criando testes usando randomizações. m = c(120,107,110,116,114,111,113,117,114,112) > f = c(110,111,107,108,110,105,107,106,111,111) boxplot(m,f, names

• require(boot)• media = function(x,i)mean(x[i])• bootm = boot(m, media, 1000)

Page 5: Criando testes usando randomizações. m = c(120,107,110,116,114,111,113,117,114,112) > f = c(110,111,107,108,110,105,107,106,111,111) boxplot(m,f, names

• plot (bootm)

Page 6: Criando testes usando randomizações. m = c(120,107,110,116,114,111,113,117,114,112) > f = c(110,111,107,108,110,105,107,106,111,111) boxplot(m,f, names
Page 7: Criando testes usando randomizações. m = c(120,107,110,116,114,111,113,117,114,112) > f = c(110,111,107,108,110,105,107,106,111,111) boxplot(m,f, names

• > names(bootm)• [1] "t0" "t" "R" "data" "seed" "statistic"• [7] "sim" "call" "stype" "strata" "weights"

Page 8: Criando testes usando randomizações. m = c(120,107,110,116,114,111,113,117,114,112) > f = c(110,111,107,108,110,105,107,106,111,111) boxplot(m,f, names

• hist(bootm$t, xlab =NULL, main = NULL )• •

Page 9: Criando testes usando randomizações. m = c(120,107,110,116,114,111,113,117,114,112) > f = c(110,111,107,108,110,105,107,106,111,111) boxplot(m,f, names
Page 10: Criando testes usando randomizações. m = c(120,107,110,116,114,111,113,117,114,112) > f = c(110,111,107,108,110,105,107,106,111,111) boxplot(m,f, names

• hist(bootm$t, xlab ="comprimento do crânio", ylab = "freqüência",main = "Machos", freq = F )

• > curve (dnorm(x, mean = 113.4, sd=3.7178),lwd = 3, add = T)

Page 11: Criando testes usando randomizações. m = c(120,107,110,116,114,111,113,117,114,112) > f = c(110,111,107,108,110,105,107,106,111,111) boxplot(m,f, names
Page 12: Criando testes usando randomizações. m = c(120,107,110,116,114,111,113,117,114,112) > f = c(110,111,107,108,110,105,107,106,111,111) boxplot(m,f, names
Page 13: Criando testes usando randomizações. m = c(120,107,110,116,114,111,113,117,114,112) > f = c(110,111,107,108,110,105,107,106,111,111) boxplot(m,f, names

• cranio = data.frame(m,f)• > cranio• m f• 1 120 110• 2 107 111• 3 110 107• 4 116 108• 5 114 110• 6 111 105• 7 113 107• 8 117 106• 9 114 111• 10 112 111

Page 14: Criando testes usando randomizações. m = c(120,107,110,116,114,111,113,117,114,112) > f = c(110,111,107,108,110,105,107,106,111,111) boxplot(m,f, names

• dmf = function (x,i)mean(cranio$m[i])-mean(cranio$f[i])• > bootdmf= boot(cranio,dmf, 1000)• > boxplot (bootdmf$t, ylab= "diferença de comprimentos")

Page 15: Criando testes usando randomizações. m = c(120,107,110,116,114,111,113,117,114,112) > f = c(110,111,107,108,110,105,107,106,111,111) boxplot(m,f, names
Page 16: Criando testes usando randomizações. m = c(120,107,110,116,114,111,113,117,114,112) > f = c(110,111,107,108,110,105,107,106,111,111) boxplot(m,f, names

• hist(bootdmf$t, xlab ="diferença de comprimento do crânio", main = NULL, freq = F )

• curve (dnorm(x, mean = 4.8, sd=1.329), add = T)• curve (dnorm(x, mean = 0, sd=1.329), lwd = 3, col = 2, add =

T, pch = 4)

Page 17: Criando testes usando randomizações. m = c(120,107,110,116,114,111,113,117,114,112) > f = c(110,111,107,108,110,105,107,106,111,111) boxplot(m,f, names
Page 18: Criando testes usando randomizações. m = c(120,107,110,116,114,111,113,117,114,112) > f = c(110,111,107,108,110,105,107,106,111,111) boxplot(m,f, names
Page 19: Criando testes usando randomizações. m = c(120,107,110,116,114,111,113,117,114,112) > f = c(110,111,107,108,110,105,107,106,111,111) boxplot(m,f, names
Page 20: Criando testes usando randomizações. m = c(120,107,110,116,114,111,113,117,114,112) > f = c(110,111,107,108,110,105,107,106,111,111) boxplot(m,f, names

• bootdmf

• ORDINARY NONPARAMETRIC BOOTSTRAP

• Call:• boot(data = cranio, statistic = dmf, R = 1000)

• Bootstrap Statistics :• original bias std. error• t1* 4.8 -0.0274 1.329382

Page 21: Criando testes usando randomizações. m = c(120,107,110,116,114,111,113,117,114,112) > f = c(110,111,107,108,110,105,107,106,111,111) boxplot(m,f, names

• pmf = function (x,i)mean(cranio$m[i])/mean(cranio$f[i])• > bootpmf= boot(cranio,pmf, 1000)• > bootpmf

• ORDINARY NONPARAMETRIC BOOTSTRAP

• Call:• boot(data = cranio, statistic = pmf, R = 1000)

• Bootstrap Statistics :• original bias std. error• t1* 1.044199 -0.0002888062 0.01231848

Page 22: Criando testes usando randomizações. m = c(120,107,110,116,114,111,113,117,114,112) > f = c(110,111,107,108,110,105,107,106,111,111) boxplot(m,f, names

• quantile(bootpmf$t, c(0.01, 0.99))• 1% 99% • 1.013604 1.071238 • > min(bootpmf$t)• [1] 1.00271

Page 23: Criando testes usando randomizações. m = c(120,107,110,116,114,111,113,117,114,112) > f = c(110,111,107,108,110,105,107,106,111,111) boxplot(m,f, names

• hist(bootpmf$t, xlab ="índice de comprimento m/f", main = NULL, freq = F )

• > curve (dnorm(x, mean = 1, sd=0.01231848), add = T)

Page 24: Criando testes usando randomizações. m = c(120,107,110,116,114,111,113,117,114,112) > f = c(110,111,107,108,110,105,107,106,111,111) boxplot(m,f, names
Page 25: Criando testes usando randomizações. m = c(120,107,110,116,114,111,113,117,114,112) > f = c(110,111,107,108,110,105,107,106,111,111) boxplot(m,f, names
Page 26: Criando testes usando randomizações. m = c(120,107,110,116,114,111,113,117,114,112) > f = c(110,111,107,108,110,105,107,106,111,111) boxplot(m,f, names

• > hist(bootpmf$t, xlab ="índice de comprimento m/f",ylab = "densidade", main = NULL, freq = F )

• > curve (dnorm(x, mean = 1, sd=0.01231848), lwd = 2, col = 3,add = T)

• > curve (dnorm(x, mean = 1.044199, sd=0.01231848), lwd = 2, col = 1,add = T)

Page 27: Criando testes usando randomizações. m = c(120,107,110,116,114,111,113,117,114,112) > f = c(110,111,107,108,110,105,107,106,111,111) boxplot(m,f, names
Page 28: Criando testes usando randomizações. m = c(120,107,110,116,114,111,113,117,114,112) > f = c(110,111,107,108,110,105,107,106,111,111) boxplot(m,f, names
Page 29: Criando testes usando randomizações. m = c(120,107,110,116,114,111,113,117,114,112) > f = c(110,111,107,108,110,105,107,106,111,111) boxplot(m,f, names