ci.balance           package:GeneticsBase           R Documentation

_E_x_p_e_r_i_m_e_n_t_a_l _F_u_n_c_t_i_o_n _t_o _C_o_r_r_e_c_t _C_o_n_f_i_d_e_n_c_e _I_n_t_e_r_v_a_l_s _A_t _o_r _N_e_a_r
_B_o_u_n_d_a_r_i_e_s _o_f _t_h_e _P_a_r_a_m_e_t_e_r _S_p_a_c_e _b_y '_S_l_i_d_i_n_g' _t_h_e _I_n_t_e_r_v_a_l _o_n _t_h_e
_Q_u_a_n_t_i_l_e _S_c_a_l_e.

_D_e_s_c_r_i_p_t_i_o_n:

     Experimental function to correct confidence intervals at or near
     boundaries of the parameter space by 'sliding' the interval on the
     quantile scale.

_U_s_a_g_e:

     ci.balance(x, est, confidence=0.95, alpha=1-confidence, minval, maxval,
                na.rm=TRUE)

_A_r_g_u_m_e_n_t_s:

       x: Bootstrap parameter estimates.

     est: Observed value of the parameter.

confidence: Confidence level for the interval. Defaults to 0.95.

   alpha: Type I error rate (size) for the interval. Defaults to
          1-'confidence'.

  minval: A numeric value specifying the lower bound of the parameter
          space. Leave unspecified (the default) if there is no lower
          bound.

  maxval: A numeric value specifying the upper bound of the parameter
          space. Leave unspecified (the default) if there is no upper
          bound.

   na.rm: logical. Should missing values be removed?

_D_e_t_a_i_l_s:

     EXPERIMENTAL FUNCTION:

     This function attempts to compute a proper 'conf'*100% confidence
     interval for parameters at or near the boundary of the parameter
     space using bootstrapped parameter estimates by 'sliding' the
     confidence interval on the quantile scale.

     This is accomplished by attempting to place a 'conf' *100%
     interval symmetrically *on the quantile scale* about the observed
     value.  If a symmetric interval would exceed the observed data at
     the upper (lower) end, a one-sided interval is computed with the
     upper (lower) boundary fixed at the the upper (lower) boundary of
     the parameter space.

_V_a_l_u_e:

     A list containing: 

      ci: A 2-element vector containing the lower and upper confidence
          limits.  The names of the elements of the vector give the
          actual quantile values used for the interval or one of the
          character strings "Upper Boundary" or "Lower Boundary".

overflow.upper, overflow.lower: The number of elements beyond those
          observed that would be needed to compute a symmetric (on the
          quantile scale) confidence interval.

n.above, n.below: The number of bootstrap values which are above
          (below) the observed value.

lower.n, upper.n: The index of the value used for the endpoint of the
          confidence interval or the character string "Upper Boundary"
          ("Lower Boundary").

_A_u_t_h_o_r(_s):

     Gregory R. Warnes warnes@bst.rochester.edu 

_S_e_e _A_l_s_o:

     'boot', 'bootstrap', Used by 'diseq.ci'.

_E_x_a_m_p_l_e_s:

     # These are nonsensical examples which simply exercise the
     # computation. See the code to diseq.ci for a real example.
     #
     # FIXME: Add real example using boot or bootstrap.  

     set.seed(7981357)
     x <- abs(rnorm(100,1))
     ci.balance(x,1, minval=0)
     ci.balance(x,1)

     x <- rnorm(100,1)
     x <- ifelse(x>1, 1, x)
     ci.balance(x,1, maxval=1)
     ci.balance(x,1)

