Function

コメント・参照等
  • 指定した誤差構造およびリンク関数の下、GLMを求める関数

FUN = f_glm_result.r
function (data0, x_col = 1, y_col = 2, error_dist = "gamma", adoptedlink = "inverse") 
{
    datadf <- data0[, c(x_col, y_col)]
    colnames(datadf) <- c("X", "Y")
    result_glm <- switch(tolower(error_dist), gamma = glm(data = datadf, formula = Y ~ X, family = Gamma(link = adoptedlink)))
    return(result_glm)
}