Solution (source code)

= Solution

For a two-sided 5% test, the critical values are $\pm1.96$. Since $|-1.89|<1.96$, \b[do not reject the null at the 5% level].

For the prespecified directional alternative $q>p$, the numerator $\widehat p-\widehat q$ tends to be negative. Use the lower-tail critical region $Z<-1.64$ at the 5% level. Since $-1.89<-1.64$, \b[reject in favor of $q>p$ in the one-sided test]. The direction should be chosen from the additional scientific information rather than selected after inspecting the sign of this same statistic.