cnormal1                package:VGAM                R Documentation

_C_e_n_s_o_r_e_d _N_o_r_m_a_l _D_i_s_t_r_i_b_u_t_i_o_n

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

     Maximum likelihood estimation for the normal distribution with
     left and right censoring.

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

     cnormal1(lmu="identity", lsd="loge", imethod=1, zero=2)

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

lmu, lsd: Parameter link functions applied to the mean and standard
          deviation parameters. See 'Links' for more choices. The
          standard deviation is a positive quantity, therefore a log
          link  is the default.

 imethod: Initialization method. Either 1 or 2, this specifies two
          methods for obtaining initial values for the parameters.

    zero: An integer vector, containing the value 1 or 2. If so, the
          mean or standard deviation respectively are modelled as an
          intercept only. Setting 'zero=NULL' means both
          linear/additive predictors are modelled as functions of the
          explanatory variables.

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

     This function is like 'normal1' but handles observations that are
     left-censored (so that the true value would be less than the
     observed value) else right-censored (so that the true value would
     be greater than the observed value). To indicate which type of
     censoring, input 'extra = list(leftcensored = vec1, rightcensored
     = vec2)' where 'vec1' and 'vec2' are logical vectors the same
     length as the response. If the two components of this list are
     missing then the logical values are taken to be 'FALSE'. The
     fitted object has these two components stored in the 'extra' slot.

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

     An object of class '"vglmff"' (see 'vglmff-class'). The object is
     used by modelling functions such as 'vglm', and 'vgam'.

_N_o_t_e:

     This function was adapted from 'tobit'. The Tobit model is a
     special case of this 'VGAM' family function because the
     observations have a common lower censoring point and upper
     censoring point. If there are no censored observation then
     'normal1' is recommended instead.

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

     T. W. Yee

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

     'tobit', 'normal1', 'dcnormal1'.

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

     n = 1000
     x = runif(n)
     ystar  = rnorm(n, mean=100 + 15 * x, sd=exp(3)) # True values
     ## Not run: hist(ystar)
     L = runif(n,  80,  90) # Lower censoring points
     U = runif(n, 130, 140) # Upper censoring points
     y = pmax(L, ystar) # Left  censored
     y = pmin(U, y)     # Right censored
     ## Not run: hist(y)
     extra = list(leftcensored = ystar < L, rightcensored = ystar > U)
     fit = vglm(y ~ x, cnormal1(zero=2), trace=TRUE, extra=extra)
     coef(fit, matrix=TRUE)
     Coef(fit)
     names(fit@extra)

