plot.ci                package:Zelig                R Documentation

_P_l_o_t_t_i_n_g _V_e_r_t_i_c_a_l _c_o_n_f_i_d_e_n_c_e _I_n_t_e_r_v_a_l_s

_D_e_s_c_r_i_p_t_i_o_n:

     The 'plot.ci' command generates vertical confidence intervals for
     linear or generalized linear univariate response models.

_U_s_a_g_e:

     plot.ci(x, CI = 95, qi = "ev", main = "", ylab = NULL, xlab = NULL,
             xlim = NULL, ylim = NULL, col = c("red", "blue"), ...) 

_A_r_g_u_m_e_n_t_s:

       x: stored output from 'sim'.  The 'x$x' and optional 'x$x1'
          values used to generate the 'sim' output object must have
          more than one observation.

      CI: the selected confidence interval.  Defaults to 95 percent.

      qi: the selected quantity of interest.  Defaults to expected
          values.

    main: a title for the plot.

    ylab: label for the y-axis.

    xlab: label for the x-axis.

    xlim: limits on the x-axis.

    ylim: limits on the y-axis.

     col: a vector of at most two colors for plotting the expected
          value given by 'x' and the alternative set of expected values
          given by 'x1' in 'sim'.  If the quantity of interest selected
          is not the expected value, or 'x1 = NULL', only the first
          color will be used.

     ...: Additional parameters passed to 'plot'.

_V_a_l_u_e:

     For all univariate response models, 'plot.ci()' returns vertical
     confidence intervals over a specified range of one explanatory
     variable.  You may save this plot using the commands described in
     the Zelig manual (<URL: http://gking.harvard.edu/zelig>).

_A_u_t_h_o_r(_s):

     Kosuke Imai <kimai@princeton.edu>; Gary King <king@harvard.edu>;
     Olivia Lau <olau@fas.harvard.edu>

_S_e_e _A_l_s_o:

     The full Zelig manual is available at <URL:
     http://gking.harvard.edu/zelig>, and users may also wish to see
     'plot', 'lines'.

_E_x_a_m_p_l_e_s:

     data(turnout)
     z.out <- zelig(vote ~ race + educate + age + I(age^2) + income,
                    model = "logit", data = turnout)
     age.range <- 18:95
     x.low <- setx(z.out, educate = 12, age = age.range)
     x.high <- setx(z.out, educate = 16, age = age.range)
     s.out <- sim(z.out, x = x.low, x1 = x.high)
     plot.ci(s.out, xlab = "Age in Years",
             ylab = "Predicted Probability of Voting",
             main = "Effect of Education and Age on Voting Behavior")
     legend(45, 0.52, legend = c("College Education (16 years)",
            "High School Education (12 years)"), col = c("blue","red"), 
            lty = c("solid"))

