

family {base}                                R Documentation

_F_a_m_i_l_y _O_b_j_e_c_t_s _f_o_r _M_o_d_e_l_s

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

     Family objects provide a convenient way to specify the
     details of the models used by functions such as `glm'.
     See the documentation for `glm' for the details on how
     such model fitting takes place.

_U_s_a_g_e_:

     family(object)

     binomial(link = "logit")
     gaussian(link ="identity")
     Gamma(link = "inverse")
     inverse.gaussian(link = "1/mu^2")
     poisson(link = "log")
     quasi(link = "identity", variance = "constant")

     print.family(x, ...)

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

    link: a specification for the model link function.  The
          `binomial' family admits the links `"logit"',
          `"probit"', `"log"', and `"cloglog"' (complemen-
          tary log-log); the `Gamma' family the links
          `"identity"', `"inverse"', and `"log"'; the `pois-
          son' family the links `"identity"', `"log"', and
          `"sqrt"'; the `quasi' family the links `"logit"',
          `"probit"', `"cloglog"',  `"identity"',
          `"inverse"', `"log"', `"1/mu^2"' and `"sqrt"'.
          The function `power' can also be used to create a
          power link function for the `quasi' family.

          The other families have only one permissible link
          function: `"identity"' for the `gaussian' family,
          and `"1/mu^2"' for the `inverse.gaussian' family.

variance: for all families, other than `quasi', the variance
          function is determined by the family.  The `quasi'
          family will accept the specifications `"con-
          stant"', `"mu(1-mu)"', `"mu"', `"mu^2"' and
          `"mu^3"' for the variance function.

  object: the function `family' accesses the `family'
          objects which are stored within objects created by
          modelling functions (e.g. `glm').

_R_e_f_e_r_e_n_c_e_s_:

     McCullagh P. and J. A. Nelder (1989).  Generalized Lin-
     ear Models.  London: Chapman and Hall.

     Dobson, A. J. (1983).  An Introduction to Statistical
     Modelling.  London: Chapman and Hall.

     Cox, D. R. and E. J. Snell (1981).  Applied Statistics;
     Principles and Examples.  London: Chapman and Hall.

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

     `glm', `power'.

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

     nf <- gaussian()# Normal family
     nf
     str(nf)# internal STRucture

     gf <- Gamma()
     gf
     str(gf)
     gf$linkinv
     all(1:10 == gf$linkfun(gf$linkinv(1:10)))# is TRUE
     gf$variance(-3:4) #- == (.)^2

     ## tests of quasi
     x <- rnorm(100)
     y <- rpois(100, exp(1+x))
     glm(y ~x, family=quasi(var="mu", link="log"))
     # which is the same as
     glm(y ~x, family=poisson)
     glm(y ~x, family=quasi(var="mu^2", link="log"))
     glm(y ~x, family=quasi(var="mu^3", link="log")) # should fail
     y <- rbinom(100, 1, plogis(x))
     # needs to set a starting value for the next fit
     glm(y ~x, family=quasi(var="mu(1-mu)", link="logit"), start=c(0,1))

