voting                  package:gnm                  R Documentation

_D_a_t_a _o_n _S_o_c_i_a_l _M_o_b_i_l_i_t_y _a_n_d _t_h_e _L_a_b_o_u_r _V_o_t_e

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

     Voting data from the 1987 British general election,
     cross-classified by the class of the head of household and the
     class of their father.

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

     data(voting)

_F_o_r_m_a_t:

     A data frame with 25 observations on the following 4 variables.

     '_p_e_r_c_e_n_t_a_g_e' the percentage of the cell voting Labour.

     '_t_o_t_a_l' the cell count.

     '_o_r_i_g_i_n' a factor describing the father's class with levels '1:5'. 

     '_d_e_s_t_i_n_a_t_i_o_n' a factor describing the head of household's class
          with levels '1:5'. 

_S_o_u_r_c_e:

     Clifford, P. and Heath, A. F. (1993) The Political Consequences of
     Social Mobility. _J. Roy. Stat. Soc. A_, *156(1)*, 51-61.

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

     ### (Results differ slightly from paper - possible transcription error in
     ### published data?)
     set.seed(1)
     data(voting)
     ## reconstruct counts voting Labour/non-Labour
     count <- with(voting, percentage/100 * total)
     yvar <- cbind(count, voting$total - count)

     ## fit diagonal reference model with constant weights
     classMobility <- gnm(yvar ~ Nonlin(Dref(origin, destination)), 
                          family = binomial, data = voting)
     prop.table(exp(coef(classMobility)[2:3]))

     ## create factors indicating movement in and out of salariat (class 1)
     upward <- with(voting, origin != 1 & destination == 1)
     downward <- with(voting, origin == 1 & destination != 1)

     ## fit separate weights for the "socially mobile" groups
     socialMobility <- gnm(yvar ~ Nonlin(Dref(origin, destination,
                                              formula = ~ 1 + downward + upward)),
                           family = binomial, data = voting)
     prop.table(exp(coef(socialMobility)[c(4, 7)] + coef(socialMobility)[c(2, 5)]))
     prop.table(exp(coef(socialMobility)[c(3, 6)] + coef(socialMobility)[c(2, 5)]))
     prop.table(exp(coef(socialMobility)[c(2, 5)]))

     ## fit separate weights for downwardly mobile groups only
     downwardMobility <- gnm(yvar ~ Nonlin(Dref(origin, destination,
                                                formula = ~ 1 + downward)),
                             family = binomial, data = voting)
     downwardMobility
     prop.table(exp(coef(downwardMobility)[c(3, 5)] + 
                    coef(downwardMobility)[c(2, 4)]))
     prop.table(exp(coef(downwardMobility)[c(2, 4)]))

