Demand               package:SASmixed               R Documentation

_P_e_r-_c_a_p_i_t_a _d_e_m_a_n_d _d_e_p_o_s_i_t_s _b_y _s_t_a_t_e _a_n_d _y_e_a_r

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

     The `Demand' data frame has 77 rows and 8 columns of data on
     per-capita demand deposits by state and year.

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

     This data frame contains the following columns:

     _S_t_a_t_e an ordered factor with levels `WA' < `FL' < `CA' < `TX' <
            `IL' < `DC' < `NY'

     _Y_e_a_r an ordered factor with levels `1949' < ...{} < `1959'

     _d a numeric vector of per-capita demand deposits

     _y a numeric vector of permanent per-capita personal income

     _r_d a numeric vector of service charges on demand deposits

     _r_t a numeric vector of interest rates on time deposits

     _r_s a numeric vector of interest rates on savings and loan
            association shares.

     _g_r_p a dummy factor with a single level.  This is used to construct
            crossed random effects in `lme'.

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

     library(SASmixed)
     data(Demand)
     names( Demand )
     formula( Demand )
     # the "grp" factor is a dummy factor with only one level.
     unique( Demand$grp )
     # Crossed random-effects factors have to be created by pdIdent
     #  applied to the indicator variables and joined by pdBlocked.
     fm1Demand <-
       lme( log(d) ~ log(y) + log(rd) + log(rt) + log(rs), data = Demand,
       random = list(grp = pdBlocked(list(pdIdent(~ State - 1),
                                          pdIdent(~ Year - 1)))))
     summary( fm1Demand )        # compare to output 3.13, p. 132
     VarCorr( fm1Demand )

