# funcion para calcular a y b
ab_fun <- function(data, Peso, Valor){
model <- glm(log(Peso) ~ log(Valor), data=data)
pars <- summary(model)$coefficients[, 1:2]
b_par <- pars["log(Valor)", ]
a_par <- pars["(Intercept)", ]
a = as.numeric(exp(a_par[1] + 0.5*a_par[2]))
b = as.numeric(b_par[1])
ab_list = list()
ab_list$a = a
ab_list$b = b
return(ab_list)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.