bnlr                  package:gnlm                  R Documentation

_B_i_n_o_m_i_a_l _N_o_n_l_i_n_e_a_r _R_e_g_r_e_s_s_i_o_n _M_o_d_e_l_s

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

     'bnlr' fits user-specified nonlinear regression equations to
     binomial data with various link functions ('logit', 'probit',
     'comp log log', 'log log', 'Cauchy', 'Student t', 'stable', or
     'mixture'). The mixture link is a logistic link with extra
     probability mass for 'y=0' and 'y=n'.

     Nonlinear regression models can be supplied as formulae where
     parameters are unknowns in which case factor variables cannot be
     used and parameters must be scalars. (See 'finterp'.)

     The printed output includes the -log likelihood (not the
     deviance), the corresponding AIC, the maximum likelihood
     estimates, standard errors, and correlations.

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

     bnlr(y, link="logit", mu=NULL, linear=NULL, pmu=NULL,
             pshape=NULL, wt=1, envir=parent.frame(), print.level=0,
             typsiz=abs(p),ndigit=10, gradtol=0.00001, stepmax=10*sqrt(p%*%p),
             steptol=0.00001, iterlim=100, fscale=1)

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

       y: A two column matrix of binomial data or censored data or an
          object of class, 'response' (created by 'restovec') or
          'repeated' (created by 'rmna' or 'lvna'). If the 'repeated'
          data object contains more than one response variable, give
          that object in 'envir' and give the name of the response
          variable to be used here.

    link: A character string containing the name of the link function.
          The 'Student t', 'stable', and 'mixture' links contain an
          unknown parameter to be estimated, respectively the logarithm
          of the degrees of freedom, the tail parameter transformed by
          log(tail/(2-tail)), and logit of the mixture probability, so
          that they lie on the whole real line.

      mu: A user-specified function of 'pmu', and possibly 'linear',
          giving the regression equation for the location. This may
          contain a linear part as the second argument to the function.
          It may also be a formula beginning with ~, specifying either
          a linear regression function for the location parameter in
          the Wilkinson and Rogers notation or a general function with
          named unknown parameters. If it contains unknown parameters,
          the keyword 'linear' may be used to specify a linear part. If
          nothing is supplied, the location is taken to be constant
          unless the linear argument is given.

  linear: A formula beginning with ~ in W&R notation, specifying the
          linear part of the regression function for the location
          parameter or list of two such expressions for the location
          and/or shape parameters.

     pmu: Vector of initial estimates for the location parameters. If
          'mu' is a formula with unknown parameters, their estimates
          must be supplied either in their order of appearance in the
          expression or in a named list.

  pshape: If the 'link' is 'Student t', an initial estimate of the
          degrees of freedom; if it is 'stable', an estimate of the
          tail parameter; if it is 'mixture', an estimate of the
          mixture probability.

      wt: Weight vector.

   envir: Environment in which model formulae are to be interpreted or
          a data object of class, 'repeated', 'tccov', or 'tvcov'; the
          name of the response variable should be given in 'y'. If 'y'
          has class 'repeated', it is used as the environment.

  others: Arguments controlling 'nlm'.

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

     A list of class 'gnlm' is returned that contains all of the
     relevant information calculated, including error codes.

_A_u_t_h_o_r(_s):

     J.K. Lindsey

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

     'finterp', 'glm', 'gnlr', 'gnlr3'

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

     # assay to estimate LD50
     y <- c(9,9,10,4,1,0,0)
     y <- cbind(y,10-y)
     dose <- log10(100/c(2.686,2.020,1.520,1.143,0.860,0.647,0.486))

     summary(glm(y~dose, family=binomial))
     bnlr(y, mu=~dose, pmu=c(1,1))
     summary(glm(y~dose, family=binomial(link=probit)))
     bnlr(y, link="probit", mu=~dose, pmu=c(1,1))
     bnlr(y, link="log log", mu=~dose, pmu=c(1,1))
     bnlr(y, link="comp log log", mu=~dose, pmu=c(1,1))
     bnlr(y, link="Cauchy", mu=~dose, pmu=c(60,-30))
     bnlr(y, link="Student", mu=~dose, pmu=c(60,-30), pshape=0.1)
     bnlr(y, link="stable", mu=~dose, pmu=c(20,-15), pshape=0, stepmax=1)
     bnlr(y, link="mixture", mu=~dose, pmu=c(60,-30), pshape=-2.5)
     #
     mu <- function(p) -p[1]*(log10(p[2])-dose)
     bnlr(y, mu=mu, pmu=c(1,100))
     bnlr(y, link="probit", mu=mu, pmu=c(1,100))

