R Code for Power Example from Lecture 22