Skip to content
Snippets Groups Projects
Commit 9b7f6e60 authored by Walmes Marques Zeviani's avatar Walmes Marques Zeviani
Browse files

usa o pacote boot.

parent 7c39106b
No related branches found
No related tags found
No related merge requests found
......@@ -150,3 +150,30 @@ with(as.list(coef(n1)), {
})
#-----------------------------------------------------------------------
# Usando o pacote boot.
library(boot)
help(boot, help_type = "html")
str(turk0)
# Criar uma função com dois argumentos: o data.frame original e um vetor
# que vai representar o índice das linhas usado para reamostrar dos
# dados.
fitmodel <- function(dataset, index) {
n0 <- nls(Gain ~ Int + Ass * (1 - 2^(-A/Mei)),
data = dataset[index, ],
start = list(Int = 625, Ass = 180, Mei = 0.1))
c(coef(n0), s2 = deviance(n0)/df.residual(n0))
}
b0 <- boot(turk0,
statistic = fitmodel,
R = 999)
pairs(b0)
# TODO:
# usar o pacote boot.
# reproduzir os resultados do boot() e boot.ci().
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment