simplesimint             package:BSagri             R Documentation

_S_i_m_u_l_t_a_n_e_o_u_s _c_o_n_f_i_d_e_n_c_e _i_n_t_e_r_v_a_l_s _f_r_o_m _r_a_w _e_s_t_i_m_a_t_e_s

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

     Calculates simultaneous confidence intervals for multiple
     contrasts based on a parameter vector, its variance-covariance
     matrix and (optionally) the degrees of freedom, using quantiles of
     the multivar

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

     simplesimint(coef, vcov, cmat, df = NULL, conf.level = 0.95,
      alternative = c("two.sided", "less", "greater"))

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

    coef: a single numeric vector, specifying the point estimates of
          the parameters of interest 

    vcov: the variance-covariance matrix corresponding to 'coef',
          should be of dimension P-times-P, when 'coef' is of P 

    cmat: the contrasts matrix specifying the comparisons of interest
          with respect to 'coef', should have P columns, when 'coef' is
          of length p 

      df: optional, the degree of freedom for the multivariate
          t-distribution; if specified, quantiles from the multivariate
          t-distribution are used for confidence interval estimation,
          if not specified (default), quantiles of the multivariate
          normal distribution are used

conf.level: a single numeric value between 0.5 and 1.0; the
          simultaneous confidence level 

alternative: a single character string, '"two.sided"' for intervals,
          '"less"' for upper limits, and '"greater"' for lower limits 

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

     Implements the methods formerly available in package 'multcomp',
     function 'csimint'. Input values are a vector of parameter
     estimates mu of length P, a corresponding estimate for its
     variance-covariance matrix Sigma (P times P), and a  contrast
     matrix C of dimension M times P. The contrasts L = C * mu are
     computed, the variance-covariance matrix (being a function of C
     and Sigma) and the corresponding correlation matrix R are
     computed. Finally, confidence intervals for L are computed: if df
     is given, quantiles of an M-dimensional t distribution with
     correlation matrix R are used, otherwise quantiles of an
     M-dimensional standard normal distribution with correlation matrix
     R are used.

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

     An object of class "simplesimint" 

estimate : the estimates of the contrasts

  lower : the lower confidence limits

  upper : the upper confidence limits

    cmat: the contrast matrix, as input

alternative: a character string, as input

conf.level: a numeric value, as input

quantile: a numeric value, the quantile used for confidence interval
          estimation

      df: a numeric value or NULL, as input

  stderr: the standard error of the contrasts

   vcovC: the variance covariance matrix of the contrasts

_N_o_t_e:

     This is a testversion and has not been checked extensively. Please
     report bugs.

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

     Frank Schaarschmidt

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

     See '?coef' and '?vcov' for extracting of parameter vectors and
     corresponding variance covariance matrices from variou model fits.

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

     # For the simple case of Gaussian response
     # variables with homoscedastic variance,
     # see the following example

     library(mratios)
     data(angina)

     boxplot(response ~ dose, data=angina)

     # Fit a cell means model,

     fit<-lm(response ~ 0+dose, data=angina)

     # extract cell means, the corresponding
     # variance-covariance matrix and the
     # residual degree of freedom,

     cofi<-coef(fit)
     vcofi<-vcov(fit)
     dofi<-fit$df.residual

     # define an appropriate contrast matrix,
     # here, comparisons to control

     n<-unlist(lapply(split(angina$response, f=angina$dose), length))
     names(n)<-names(cofi)

     cmat<-contrMat(n=n, type="Dunnett")
     cmat

     #

     test<-simplesimint(coef=cofi, vcov=vcofi, df=dofi, cmat=cmat, alternative="greater" )

     test

     summary(test)

     plotCI(test)

     ### Note, that the same result can be achieved much more conveniently
     ### using confint.glht in package multcomp

