  Denote by $p(n)$ the number of partitions of $n$ and by $N(a,M;n)$ the number
of partitions of $n$ with rank congruent to $a$ modulo $M$. By considering the
deviation \begin{equation*} D(a,M) := \sum_{n= 0}^{\infty}\left(N(a,M;n) -
\frac{p(n)}{M}\right) q^n, \end{equation*} we give new proofs of recent results
of Andrews, Berndt, Chan, Kim and Malik on mock theta functions and ranks of
partitions. By considering deviations of cranks, we give new proofs of Lewis
and Santa-Gadea's rank-crank identities. We revisit ranks and cranks modulus
$M=5$ and $7$, with our results on cranks appearing to be new. We also
demonstrate how considering deviations of ranks and cranks gives first proofs
of Lewis's conjectured identities and inequalities for rank-crank differences
of modulus $M=8$.
