**As we talked about previously, usually the 'sig.level' = 0.05 and 'power' = 0.8. In an ideal world, the power will be 0.8, which means that you have an 80% chance of detecting a significant result if one exists.**

## Calculate effect size:

*R*

^{2}value using the following equation:

*R*

^{2}value at the bottom. So, if we tell R what the

*R*

^{2}value is from this (0.04839) we can calculate the

*F*

^{2}value straightforwardly:

*f*

^{2}values of 0.02, 0.15, and 0.35 represent small, medium, and large effect sizes, respectively.

*R*

^{2}

_{AB}is the sum of all of the variance accounted for by all of the variables (relative to a null model), and

*R*

^{2}

_{B}is the unique variance accounted for by your variable of interest (relative to a null model). Confused? Well, let's have a go at this in R.

Consider the regression we carried out previously (y ~ x). Now, we add a second continuous variable (z) to the regression to make y ~ x + z. What we want to know is the unique amount of variance accounted for by variable 'x'. If we ask R for the summary of the lm model, this will give us the overall *R*^{2}, but as we need individual values, we need to ask R to give us a little more information. We can do this by asking for the ANOVA table of the regression:

*R*

^{2}values we need.

*f*

^{2}values of 0.02, 0.15, and 0.35 represent small, medium, and large effect sizes, respectively.

## Calculate sample size:

*n*levels, and one continuous covariate. Here we would need to calculate the unique effect size for the factor of interest (presumably the categorical factor) as described above for models with more than one factor (see previous section on 'Calculating Effect Size').

This is a little complicated, so let's try an example in R. First, we type our model into R, and ask for the ANOVA table so we can see the sums of squares estimates.

Imagine, for example, our factor is 'region where the subject lives' (i.e., North, South, East, West), our covariate is 'Body Mass Index', and our response is 'Units of Alcohol consumed in a week'. So we want to know how many units are consumed as a function of location, but we want to control for the effects of BMI. As you can probably see, we can select on the basis of where someone lives to repeat this, but we are unlikely to get the same BMIs corresponding to the same unites of alcohol again, so we need to partition this out of the effect size calculation.

Using the nomenclature above, let's call the variance of our categorical factor 'B' and the total variance of our factor and covariate 'AB'. Let's type this into R: