Download presentation

Presentation is loading. Please wait.

Published byGabriel Gallagher Modified over 3 years ago

1
Criando testes usando randomizações

2
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"))

3

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

5
plot (bootm)

6

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

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

9

10
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)

11

12

13
cranio = data.frame(m,f) > cranio m f

14
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")

15

16
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)

17

18

19

20
bootdmf ORDINARY NONPARAMETRIC BOOTSTRAP Call: boot(data = cranio, statistic = dmf, R = 1000) Bootstrap Statistics : original bias std. error t1*

21
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*

22
quantile(bootpmf$t, c(0.01, 0.99)) 1% 99% > min(bootpmf$t) [1]

23
hist(bootpmf$t, xlab ="índice de comprimento m/f", main = NULL, freq = F ) > curve (dnorm(x, mean = 1, sd= ), add = T)

24

25

26
> hist(bootpmf$t, xlab ="índice de comprimento m/f",ylab = "densidade", main = NULL, freq = F ) > curve (dnorm(x, mean = 1, sd= ), lwd = 2, col = 3,add = T) > curve (dnorm(x, mean = , sd= ), lwd = 2, col = 1,add = T)

27

28

29

Similar presentations

© 2017 SlidePlayer.com Inc.

All rights reserved.

Ads by Google