CIGLM                 package:BSagri                 R Documentation

_W_r_a_p_p_e_r _t_o _c_o_m_p_u_t_e _c_o_n_f_i_d_e_n_c_e _i_n_t_e_r_v_a_l_s _f_r_o_m _g_l_m_s

_D_e_s_c_r_i_p_t_i_o_n:

     Computes confidence intervals from the output of a glm, by calling
     to glht(multcomp).

_U_s_a_g_e:

     CIGLM(x, conf.level = 0.95, method = c("Raw", "Adj", "Bonf"))

_A_r_g_u_m_e_n_t_s:

       x: a object of class '"glm"', '"gamlss"', or '"glm.nb"' as can
          be obtained by calling to function 'glm', function 'gamlss'
          in package 'gamlss', or function 'glm.nb' in package 'MASS'  

conf.level: confidence level, a single numeric value between 0.5 and 1 

  method: a single character string, with '"Raw"' for unadjusted
          intervals, '"Adj"' for multiplicity adjusted intervals taking
          the correlations into account, or '"Bonf"' for a Bonferroni
          adjustment 

_D_e_t_a_i_l_s:

     This is just a wrapper to 'confinf.glht' of package 'multcomp'.

     Note that except for the simple general linear model with
     assumption of Gaussian response, the resulting intervals are exact
     intervals. In other cases, the methods are only asymptotically
     correct, hence might give misleading results for small sample
     sizes!

_V_a_l_u_e:

     An object of class '"confint.glht"'

_S_e_e _A_l_s_o:

     'confint.glht' in package 'multcomp' for the function that is used
     internally, 'UnlogCI' for a simple function to bring confidence
     intervals back to the original scales when there is a log or logit
     link, with appropriate naming.

_E_x_a_m_p_l_e_s:

     data(Diptera)
     library(multcomp)

     modelfit <- glm(Ges ~ Treatment, data=Diptera, family=quasipoisson)
     comps <- glht(modelfit, mcp(Treatment="Tukey"))
     CIs<-CIGLM(comps, method="Raw")
     CIs

     CIsAdj<-CIGLM(comps, method="Adj")
     CIsAdj

     CIsBonf<-CIGLM(comps, method="Bonf")
     CIsBonf

     library(gamlss)

     modelfit2 <- gamlss(Ges ~ Treatment, data=Diptera, family=NBI)
     comps2 <- glht(modelfit2, mcp(Treatment="Tukey"))
     CIs2<-CIGLM(comps2, method="Raw")
     CIs2

     CIsAdj2<-CIGLM(comps2, method="Adj")
     CIsAdj2

     CIsBonf2<-CIGLM(comps2, method="Bonf")
     CIsBonf2

