#example with a poor name choice from practice sheet
mydata = c(12,14,11)BIOL 204 Lab 1 Exercise
Lab 1 - R Basics - Instructions
We went through some basic functions and how to assign values to a vector. This assignment will help practice using this knowledge. Please follow the instructions provided here to complete the assignment in the “Lab_1_Assignment” R script tab in the Lab 1 Exercise located in your section’s shared workspace. Make sure to include comments with all of the code you generate.
Algae Bead Practice Data Set and Questions
Over the next lab unit, you will design and carry out experiments that examine various factors that could affect photosynthesis rates (i.e. their carbon dioxide consumption) in the green algae species Chlorella and/or Chlamydomonas. Suppose you wanted to compare the photosynthesis rates of the two species in the same conditions, before designing your overall experiment. You will learn about the specific methods later, but we will be measuring change in absorbance over a specific period of time as a proxy for carbon dioxide consumed. Below is the data you collected:
| Chlorella | Chlamydomonas |
|---|---|
| 0.969 | 1.203 |
| 1.317 | 0.316 |
| 1.215 | 0.942 |
| 0.407 | 0.613 |
| 0.272 | 0.735 |
| 0.380 | 0.599 |
| 0.909 | 0.142 |
| 0.615 | 0.129 |
| 0.822 | 0.294 |
| 1.471 | 0.595 |
| 1.463 | 0.660 |
| 0.790 | 0.687 |
| 0.643 | 0.196 |
| 0.893 | 0.199 |
| 0.627 | 0.388 |
1. Create vector objects with appropriate names to store the data for each algae species:
2. Calculate the standard error for the data collected for each algae species:
Remember that the equation for standard error is:
\[SE = \frac{\sigma}{\sqrt{n}}\]
where \(\sigma\) is the standard deviation and \(n\) is the sample size.
You will need to use the sd(), sqrt() and length() functions. How can you combine them together into one calculation?
length(mydata) #sample size of my data[1] 3
sd(mydata) #standard deviation of my data[1] 1.527525
sqrt(4) #square root of 4[1] 2
3. Perform T-test
What is the purpose of a T-test? Answer as a comment in your R script.
Use “?” to determine what should be included in t.test() function. HINT: x and y will be the two species you want to compare.
?t.test()- Interpret your p-value. Answer as a comment in your R script.
#Example of using the t.test() function
mydata1 = c(1,2,3,4,5)
mydata2 = c(4,5,6,7,8)
t.test(mydata1, mydata2)
Welch Two Sample t-test
data: mydata1 and mydata2
t = -3, df = 8, p-value = 0.01707
alternative hypothesis: true difference in means is not equal to 0
95 percent confidence interval:
-5.3060041 -0.6939959
sample estimates:
mean of x mean of y
3 6