Below are the solutions to these exercises on Conducting Power Analysis for Experimental Design. #################### # # # Exercise 1 # # # #################### install.packages(‘pwr’, dependencies = TRUE) ## Error in contrib.url(repos, “source”): trying to use CRAN without setting a mirror require(pwr) ## Loading required package: pwr #################### # # # Exercise 2 # […]

## Power Analysis: Exercises

Proper experimental design can save you a lot of headaches and wasted effort. One experimental design tool is often called a Power Analysis. A Power Analysis lets you determine if your design will have enough power to detect an effect. Statistical power is the probability of detecting a trend, given a trend actually exists. Importantly, […]

## Power Analysis Tutorial

Before starting any experiment, careful planning needs to take place. For instance, how many samples are required for your experiment? This question is important for two reasons. First, an experiment with too few of samples may not be able to determine real differences between, say a control and experimental group. And second, too many samples […]

## Mathematical Expressions in R Plots: Exercises

It is common to find yourself needing to use specific symbols or mathematical notation on R graphics. For example you may want to display R^2 values, but you also want the R^2 to be rendered nicely. R has a rich set of options for including this mathematical text on plots. We previously discussed this in […]

## Mathematical Expressions in R Plots: Solutions

Below are the solutions to these exercises on includes mathematical notation in R graphics. #################### # # # Exercise 1 # # # #################### data("LakeHuron") head(LakeHuron) ## [1] 580.38 581.86 580.97 580.80 579.79 580.39 #################### # # # Exercise 2 # # # #################### years = 1875:1972 plot(years,LakeHuron,pch=16,las=1,cex=1.2,cex.lab=1.2,xlab=’time (years)’,ylab=’lake level (feet)’) abline(lm(LakeHuron~years),lwd=2,col=’red’) model_summary = summary(lm(LakeHuron~years)) […]

## Mathematical Expressions in R Plots: Tutorial

It is quite common to want to use mathematical expressions in R. Specifically, mathematical symbols or entire equations may be needed when building plots. In this tutorial, we will examine how mathematical expressions can be included into R graphics. We will use the co2 data already found in R. The data includes the atmospheric concentrations […]

## Regression Model Assumptions Solutions

Below are the solutions to these exercises on model diagnostics using residual plots. #################### # # # Exercise 1 # # # #################### data(“cars”) head(cars) ## speed dist ## 1 4 2 ## 2 4 10 ## 3 7 4 ## 4 7 22 ## 5 8 16 ## 6 9 10 #################### # […]

## Regression Model Assumptions Exercises

You might fit a statistical model to a set of data and obtain parameter estimates. However, you are not done at this point. You need to make sure the assumptions of the particular model you used were met. One tool is to examine the model residuals. We previously discussed this in a tutorial. The residuals […]

## Regression Model Assumptions Tutorial

Regression is used to explore the relationship between one variable (often termed the response) and one or more other variables (termed explanatory). Several exercises are already available on simple linear regression or multiple regression. These are fantastic tools that are used frequently. However, each has a number of assumptions that need to be met. Unfortunately, […]