Question
A few years ago my friend from grad school, Craig, moved his successful mouse research lab from Wisconsin to Colorado. He wanted to study the
A few years ago my friend from grad school, Craig, moved his successful mouse research lab from Wisconsin to Colorado. He wanted to study the effects of cannabinoids on mouse physiology and this was at a time when Colorado was leading the nation in relaxing regulations aimed at Cannabis products. One of his preliminary experiments involved feeding what he referred to as a THC cocktail to female mice and recording their weight. In his study the test variable was diet, with two treatment levels: high THC and low THC. The response variable was mass, measured in grams. He measured the mass of each mouse twiceonce at the beginning of the study, and again at the end. He should have summarized these values in his data set by simply indicating the change in mass, but he didnt. He also should have standardized the change in mass for individual mice by converting it to a proportion of starting mass gained or lost. His results are provided in the .csv file available separately in Canvas. Use Craigs data to complete the following tasks using R. As you work, compose all of your R commands in the script pane of R Studio, so that they may be saved as one R file. Be sure to annotate your work in the script pane as you go, using the pound sign (#) to write me notes. This is necessary so that I know which of your commands provides an answer to which of the questions/tasks below. Try to be as helpful and as descriptive as possible with your annotations
2. Use a dplyr function to transform Craigs raw data. You want to use dplyr to do what Craig should have done: add a column for the proportional change in mass for each mouse observed. I think of this as a two-step process of subtraction followed by division (I will leave it up to you to figure out what is being subtracted and divided). If it is easier for you to separate the two steps by adding a column for each arithmetic function, thats fine. If you would rather just add one column with the desired transformed variable in it, thats fine too. Whatever you decide, be sure to annotate!
cage_id mouse_id diet mass_start mass_end 1 1 high 24 26 1 2 high 26 27 1 3 high 30 30 2 1 high 24 27 2 2 high 27 30 2 3 high 25 26 3 1 low 34 33 3 2 low 29 29 3 3 low 23 24 4 1 low 25 25 4 2 low 24 25 4 3 low 28 28 cage_id mouse_id diet mass_start mass_end 1 1 high 24 26 1 2 high 26 27 1 3 high 30 30 2 1 high 24 27 2 2 high 27 30 2 3 high 25 26 3 1 low 34 33 3 2 low 29 29 3 3 low 23 24 4 1 low 25 25 4 2 low 24 25 4 3 low 28 28
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started