reggeom                package:xgobi                R Documentation

_G_e_o_m_e_t_r_y _o_f _R_e_g_r_e_s_s_i_o_n _w_i_t_h _T_w_o _R_e_g_r_e_s_s_o_r_s

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

     Using XGobi for visualising the geometry of regression with two
     explanatory variables.

     The function `reggeom' has exactly the same arguments as
     `xgobi(..)', and it simply calls `xgobi', but it has different
     default values for the arguments than the defaults of `xgobi'
     itself.

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

     reggeom()

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

   matrx: the default dataset is a matrix with three columns. The rows
          represent the dependent and the two independent variables, as
          well as fitted values and residuals in the regression on one
          or both regressors, and other auxiliary variables. Since the
          matrix has three columns, each variable is represented as a
          vector in 3-dimensional space. 

  collab: column labels for `matrx', by default `"U"', `"V"', and
          `"W"', not very meaningful since the columns represent
          oblique directions in n-dimensional space. 

  rowlab: character vector of labels for the variables; by default,
          "x1" and "x2" for the independent and "y" for the dependent
          variable, "o" for the origin, and other letters for the
          auxiliary variables. 

  colors: as in `xgobi' all points are of the same color.

  glyphs: as in `xgobi' all points are drawn with the same glyph.  

   erase: as in `xgobi' no points will be erased.

   lines: the default `lines' argument displays some of the data in
          `matrx' as straight lines.  The user may want to substitute
          different lines in order to emphasize or de-emphasize certain
          relationships, as in the example given below. 

linecolors: The default line colors are:

          _p_u_r_p_l_e for the dependent variable,

          _y_e_l_l_o_w for the two independent variables,

          _g_r_e_e_n for fitted values and residuals in the full regression,

          _r_e_d for fitted values and residuals in the regression on the
               first independent variable only, and

          _l_i_g_h_t _b_l_u_e ,

          _d_a_r_k _b_l_u_e , and

          _w_h_i_t_e for auxiliary lines.

resources: by default, points and axes are not shown; only lines are.

   title: by default, `"Regression Geometry"'

 vgroups: by default, all three variables are in the same group.

     std: by default, the view is centered on the mean of the data.

nlinkable, subset, display: the same as in `xgobi'.

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

     If called without arguments, `reggeom' loads a dataset which
     represents the geometry of regression with two explanatory
     variables. The idea is to place the dataset into the rotation view
     in order to get an intuition of the geometry involved.  `reggeom'
     should only then be called with arguments if specific built-in
     defaults must be overriden.

     The explanatory variables are x1=(5,0,0) and x2=(-1,4,0), and the
     target (dependent) variable is y=(3,3,4). However all coordinates
     are multiplied by 1156, with the effect that all the points passed
     as arguments to `xgobi' have integer coordinates.

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

     As in the call of `xgobi', the UNIX `status' upon completion, i.e.
     `0' if ok.

_S_i_d_e _E_f_f_e_c_t_s:

     As in `xgobi'.

_a_u_t_h_o_r:

     Hans Ehrbar ehrbar@econ.utah.edu

_R_e_f_e_r_e_n_c_e_s:

     `reggeom' can be considered a 3-dimensional visualization of the
     figures in Davidson, R. and MacKinnon, J. G. (1993) Estimation and
     Inference in Economics, Oxford University Press, p. 22.

     The chapter ``Additional Regressors'' in Hans Ehrbar's on-line
     econometrics class notes <URL:
     http://www.econ.utah.edu/ehrbar/ecmet.pdf> uses `reggeom' for
     teaching and has several exercise questions about it.

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

     `xgobi'

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

     ## The arguments given in this example are modifications of the default,
     ## some lines dropped, some added, some line colors changed,
     ## in order to emphasize the geometry of backfitting.

     reggeom(
           lines= cbind(c(1,6,8,1,11,7,1,1,6,6,15,17,8,5,9, 5,6,14,15,16,14,15,5),
                        c(6,8,2,11,7,3,4,5,4,15,17,5,5,9,7,11,14,15,16,17,4,4,4)),
           linecolors=c("red", rep("yellow",5), "orchid", "green",
                        "slateblue", rep("skyblue",3), rep("white",3), "skyblue",
                        rep("red",4), rep("slateblue", 2), "green"),
           title="Regression Geometry - Backfitting")

