The mathematical / statistical linear model, $y_{ij} = \mu + \rho_i + \tau_j + \epsilon_{ij},$  where $\mu$ is the population mean, $\rho_i$ is the main effect of subject, $\tau_j$ is the main effect of treatment, $\epsilon_{ij}$ is the independent error ([link](http://www.docstoc.com/docs/25226940/Repeated-Measures-and-Related-Designs), p. 2), might be used to describe a single-factor repeated measures design.  
In the "reference" it is said that for the data collected in such a design we have to operate with the residuals calculated accordingly to the formula (_A_): $$\hat\epsilon_{ij} = Y_{ij} - \bar Y_{i.} - \bar Y_{.j} + \bar Y.$$  
 
The [formula](http://en.wikipedia.org/wiki/Errors_and_residuals_in_statistics) (_B_) on wiki is $$\hat\epsilon_i = Y_i - \bar Y.$$  

My question is:  
what formula is used to correctly calculate residuals in the model describing a single-factor repeated measures design to check its assumptions (multivariate normality, homoscedasticity, sphericity, linearity, additivity)?  

Thank you.  

P.S.  
D.C. Montgomery in his "Design and Analysis of Experiments" classic book provides the same model but with slightly different notations in its equation: $y_{ij} = \mu + \tau_i+ \beta_j + \epsilon_{ij}$, where $\tau$ is the effect of the $i$th treatment and $\beta$ is a parameter associated with the $j$th subject.