rcModelPLMr          package:preprocessCore          R Documentation

_F_i_t _r_o_b_u_s_t _r_o_w-_c_o_l_u_m_n _m_o_d_e_l_s _t_o _a _m_a_t_r_i_x

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

     These functions fit row-column effect models to matrices using
     PLM-r and variants

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

     rcModelPLMr(y)
     rcModelPLMrr(y)
     rcModelPLMrc(y)
     rcModelWPLMr(y, w)
     rcModelWPLMrr(y, w)
     rcModelWPLMrc(y, w)

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

       y: A numeric matrix

       w: A matrix or vector of weights. These should be non-negative.

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

     These functions fit row-column models to the specified input
     matrix. Specifically the model 

                       y_ij = r_i + c_j + e_ij

     with r_i and c_j as row and column effects respectively. Note that
     these functions treat the row effect as the parameter to be
     constrained using sum to zero.

     The 'rcModelPLMr' and 'rcModelWPLMr' functions use  the PLM-r
     fitting procedure. This adds column and row robustness to single
     element robustness.

     The 'rcModelPLMrc' and 'rcModelWPLMrc' functions use  the PLM-rc
     fitting procedure. This adds column robustness to single element
     robustness.

     The 'rcModelPLMrr' and 'rcModelWPLMrr' functions use  the PLM-rr
     fitting procedure. This adds row robustness to single element
     robustness.

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

     A list with following items: 

Estimates: The parameter estimates. Stored in column effect then row
          effect order

 Weights: The final weights used

Residuals: The residuals

StdErrors: Standard error estimates. Stored in column effect then row
          effect order

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

     B. M. Bolstad bmb@bmbolstad.com

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

     col.effects <- c(10,11,10.5,12,9.5)
     row.effects <- c(seq(-0.5,-0.1,by=0.1),seq(0.1,0.5,by=0.1))

     y <- outer(row.effects, col.effects,"+")
     w <- runif(50)

     rcModelPLMr(y)
     rcModelWPLMr(y, w)

     ### An example where there no or only occasional outliers
     y <- y + rnorm(50,sd=0.1)
     par(mfrow=c(2,2))
     image(1:10,1:5,rcModelPLMr(y)$Weights,xlab="row",ylab="col",main="PLM-r",zlim=c(0,1))
     image(1:10,1:5,rcModelPLMrc(y)$Weights,xlab="row",ylab="col",main="PLM-rc",zlim=c(0,1))
     image(1:10,1:5,rcModelPLMrr(y)$Weights,xlab="row",ylab="col",main="PLM-rr",zlim=c(0,1))
     matplot(y,type="l")

     ### An example where there is a row outlier
     y <- outer(row.effects, col.effects,"+")
     y[1,] <- 11+ rnorm(5)

     y <- y + rnorm(50,sd=0.1)

     par(mfrow=c(2,2))
     image(1:10,1:5,rcModelPLMr(y)$Weights,xlab="row",ylab="col",main="PLM-r",zlim=c(0,1))
     image(1:10,1:5,rcModelPLMrc(y)$Weights,xlab="row",ylab="col",main="PLM-rc",zlim=c(0,1))
     image(1:10,1:5,rcModelPLMrr(y)$Weights,xlab="row",ylab="col",main="PLM-rr",zlim=c(0,1))
     matplot(y,type="l")

     ### An example where there is a column outlier
     y <- outer(row.effects, col.effects,"+")
     w <- rep(1,50)

     y[,4] <- 12 + rnorm(10)
     y <- y + rnorm(50,sd=0.1)

     par(mfrow=c(2,2))
     image(1:10,1:5,rcModelWPLMr(y,w)$Weights,xlab="row",ylab="col",main="PLM-r",zlim=c(0,1))
     image(1:10,1:5,rcModelWPLMrc(y,w)$Weights,xlab="row",ylab="col",main="PLM-rc",zlim=c(0,1))
     image(1:10,1:5,rcModelWPLMrr(y,w)$Weights,xlab="row",ylab="col",main="PLM-rr",zlim=c(0,1))
     matplot(y,type="l")

     ### An example where there is both column and row outliers
     y <- outer(row.effects, col.effects,"+")
     w <- rep(1,50)

     y[,4] <- 12 + rnorm(10)
     y[1,] <- 11+ rnorm(5)

     y <- y + rnorm(50,sd=0.1)

     par(mfrow=c(2,2))
     image(1:10,1:5,rcModelWPLMr(y,w)$Weights,xlab="row",ylab="col",main="PLM-r",zlim=c(0,1))
     image(1:10,1:5,rcModelWPLMrc(y,w)$Weights,xlab="row",ylab="col",main="PLM-rc",zlim=c(0,1))
     image(1:10,1:5,rcModelWPLMrr(y,w)$Weights,xlab="row",ylab="col",main="PLM-rr",zlim=c(0,1))
     matplot(y,type="l")

