\begin{Schunk}
\begin{Sinput}
 ## Using a Monte Carlo design, we can calculate power across sample
 ## sizes as the proportion of cases where the null was rejected in
 ## each condition.
 cond.N <- seq(from = 20, to = 150, by = 10)
 cond.N
\end{Sinput}
\begin{Soutput}
 [1]  20  30  40  50  60  70  80  90 100 110 120 130 140 150
\end{Soutput}
\begin{Sinput}
 cond.R <- c(0.30) # for now, don't vary the correlation between predictors
 conds <- expand.grid(N = cond.N, R = cond.R)
 conds$nReps <- 1000
 conds
\end{Sinput}
\begin{Soutput}
     N   R nReps
1   20 0.3  1000
2   30 0.3  1000
3   40 0.3  1000
4   50 0.3  1000
5   60 0.3  1000
6   70 0.3  1000
7   80 0.3  1000
8   90 0.3  1000
9  100 0.3  1000
10 110 0.3  1000
11 120 0.3  1000
12 130 0.3  1000
13 140 0.3  1000
14 150 0.3  1000
\end{Soutput}
\end{Schunk}
