Choosing R when designing CMOS Amplifier
The gm of input transistor M2 is loaded by the rds of mirror transistor M4. Remembering that rds = 1/gds, we see that the input stage gain is gm_M2 / gds_M4. I will let you figure out how to include or exclude the factor of 2 that may result from the current mirror.
The second stage has amplifying transistor M7 loaded by current source transistor M8. So its gain is gm_M7 / gds_M8.
Now all you need to do is calculate the gm's and gds's, and perform the multiplications and divisions to get final gain from input to output.
As you know, gm depends on drain current. In this circuit the drain current is "IREF" times the transistor size ratios (Wm6/Wm5) and (Wm8/Wm5). IREF is equal the voltage across bias resistor "R" divided by R. Namely, (10 volts - Vth_M5)/R.
So choose an IREF that gives the gm's and gds's you need. Then calculate R = (10V - Vth_M5)/IREF.