plotEst                 package:Epi                 R Documentation

_P_l_o_t _e_s_t_i_m_a_t_e_s _w_i_t_h _c_o_n_f_i_d_e_n_c_e _l_i_m_i_t_s

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

     Plots parameter estimates with confidence intervals, annotated
     with parameter names. A dot is plotted at the estimate and a
     horizontal line extending from the lower to the upper limit is
     superimposed.

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

     plotEst( ests,
                 y = dim(ests)[1]:1,
               txt = rownames(ests),
            txtpos = y, 
              ylim = range(y)-c(0.5,0),
              xlab = "",
              xtic = nice(ests[!is.na(ests)], log = xlog),
              xlim = range( xtic ),
              xlog = FALSE,
               pch = 16,
               cex = 1,
               lwd = 2,
               col = "black",
         col.lines = col,
        col.points = col,
              vref = NULL,
              grid = FALSE,
          col.grid = gray(0.9),
       restore.par = TRUE ) 

     linesEst( ests, y = dim(ests)[1]:1, pch = 16, cex = 1, lwd = 2,
               col="black", col.lines=col, col.points=col )

     pointsEst( ests, y = dim(ests)[1]:1, pch = 16, cex = 1, lwd = 2,
               col="black", col.lines=col, col.points=col )

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

    ests: Matrix with three columns: Estimate, lower limit, upper
          limit. If a model object is supplied, 'ci.lin' is invoked for
          this object first.

       y: Vertical position of the lines.

     txt: Annotation of the estimates.

  txtpos: Vertical position of the text. Defaults to 'y'.

    ylim: Extent of the vertical axis.

    xlab: Annotation of the horizontal axis.

    xtic: Location of tickmarks on the x-axis.

    xlim: Extent of the x-axis.

    xlog: Should the x-axis be logarithmic?

     pch: What symbol should be used?

     cex: Expansion of the symbol.

     col: Colour of the points and lines.

col.lines: Colour of the lines.

col.points: Colour of the symbol.

     lwd: Thickness of the lines.

    vref: Where should vertical reference line(s) be drawn?

    grid: If TRUE, vertical gridlines are drawn at the tickmarks. If a
          numerical vector is given vertical lines are drawn at 'grid'.

col.grid: Colour of the vertical gridlines

restore.par: Should the graphics parameters be restored? If set to
          'FALSE' the coordinate system will still be available for
          additional plotting, and 'par("mai")' will still have the
          very large value set in order to make room for the labelling
          of the estimates.

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

     'plotEst' make a news plot, whereas 'linesEst' and 'pointsEst'
     (identical functions) adds to an existing plot.

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

     NULL

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

     Bendix Carstensen, bxc@steno.dk, <URL:
     http://www.pubhealth.ku.dk/~bxc>

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

     ci.lin

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

     # Bogus data and a linear model
     f <- factor( sample( letters[1:5], 100, replace=TRUE ) )
     x <- rnorm( 100 )
     y <- 5 + 2 * as.integer( f ) + 0.8 * x + rnorm(100) * 2
     m1 <- lm( y ~ f )

     # Produce some confidence intervals for contrast to first level
     ( cf <- summary( m1 )$coef[2:5,1:2] %*% rbind( c(1,1,1), 1.96*(c(0,-1,1) ) ) )

     # Plots with increasing amount of bells and whistles
     par( mfcol=c(3,2), mar=c(3,3,2,1) )
     plotEst( cf )
     plotEst( cf, grid=TRUE )
     plotEst( cf, grid=TRUE, cex=2, lwd=3 )
     plotEst( cf, grid=TRUE, cex=2, col.points="red", col.lines="green" )
     plotEst( cf, grid=TRUE, cex=2, col.points="red", col.lines="green",
               xlog=TRUE, xtic=c(1:8), xlim=c(0.8,6) )
     rownames( cf )[1] <- "Contrast to fa:\n\n fb"
     plotEst( cf, grid=TRUE, cex=2, col.points=rainbow(4), col.lines=rainbow(4), vref=1 )
       

