Open RStu • Open a new R Script. • Copy and paste the below code in R. (to present your answer for this task, take a screenshot of your RStudio session, and paste it into your assessment solutions document). • Run the code, then copy and paste the outputs and the graphs into your assessment solutions document. • Copy and paste the code in your assignment and use comments to explain each line of the code.
Open RStu • Open a new R Script. • Copy and paste the below code in R. (to present your answer for this task, take a screenshot of your RStudio session, and paste it into your assessment solutions document). • Run the code, then copy and paste the outputs and the graphs into your assessment solutions document. • Copy and paste the code in your assignment and use comments to explain each line of the code.
MATLAB: An Introduction with Applications
6th Edition
ISBN:9781119256830
Author:Amos Gilat
Publisher:Amos Gilat
Chapter1: Starting With Matlab
Section: Chapter Questions
Problem 1P
Related questions
Question
![• Open RStudio.
• Open a new R Script.
• Copy and paste the below code in R. (to present your answer for this task, take a screenshot of
your RStudio session, and paste it into your assessment solutions document).
• Run the code, then copy and paste the outputs and the graphs into your assessment solutions
document.
• Copy and paste the code in your assignment and use comments to explain each line of the code.
Note: to get help in R, highlight the code and press F1.
Code to be copied and pasted into an R script in RStudio:
Treatment <- rep (c("Level_1", "Level_2","Level_3"), each=10)
Response <- c(11, 8, 10, 12, 8, 12, 9, 9, 4, 12,
12, 9, 12, 10, 18, 24, 17, 16, 20, 11,
14, 7, 18, 8, 12, 10, 9, 14, 12, 10)
Data Question_3<-data.frame(Treatment, Response)
View(Data_Question 3)
aggregate (Data Question_3$Response, list (Data Question_3$Treatment), mean)
aggregate (Data_Question_3$Response, list (Data Question_3$Treatment), sd)
aggregate (Response Treatment, Data Question 3, function (Response)
mean (Response)
table(Treatment)
c(length=length (Response), mean-mean (Response), sd-sd (Response),
var=var (Response)))
boxplot (Response, col 15)
LOG_Response <- log(Response)
boxplot (Response-Treatment, col = 10)
boxplot (LOG_Response, col = 12)
hist (Response, prob= TRUE, main="Response Histogram",
col="white", ylim = c(0,0.1))
x2 <
seq(min(Response), max (Response), length = 40)
Normal Curve <- dnorm(x2, mean = mean (Response), sd = sd (Response))
lines (x2, Normal_Curve, col = "green", lwd = 2)
Q3 ANOVA <- aov (Response-Treatment, data-Data_Question 3)
summary (Q3_ANOVA)](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F539a6763-4713-4bfa-959d-677fac7bd696%2Fc4b5c937-8c24-4e76-85d1-3d3f54084e7c%2F7p0jtka_processed.png&w=3840&q=75)
Transcribed Image Text:• Open RStudio.
• Open a new R Script.
• Copy and paste the below code in R. (to present your answer for this task, take a screenshot of
your RStudio session, and paste it into your assessment solutions document).
• Run the code, then copy and paste the outputs and the graphs into your assessment solutions
document.
• Copy and paste the code in your assignment and use comments to explain each line of the code.
Note: to get help in R, highlight the code and press F1.
Code to be copied and pasted into an R script in RStudio:
Treatment <- rep (c("Level_1", "Level_2","Level_3"), each=10)
Response <- c(11, 8, 10, 12, 8, 12, 9, 9, 4, 12,
12, 9, 12, 10, 18, 24, 17, 16, 20, 11,
14, 7, 18, 8, 12, 10, 9, 14, 12, 10)
Data Question_3<-data.frame(Treatment, Response)
View(Data_Question 3)
aggregate (Data Question_3$Response, list (Data Question_3$Treatment), mean)
aggregate (Data_Question_3$Response, list (Data Question_3$Treatment), sd)
aggregate (Response Treatment, Data Question 3, function (Response)
mean (Response)
table(Treatment)
c(length=length (Response), mean-mean (Response), sd-sd (Response),
var=var (Response)))
boxplot (Response, col 15)
LOG_Response <- log(Response)
boxplot (Response-Treatment, col = 10)
boxplot (LOG_Response, col = 12)
hist (Response, prob= TRUE, main="Response Histogram",
col="white", ylim = c(0,0.1))
x2 <
seq(min(Response), max (Response), length = 40)
Normal Curve <- dnorm(x2, mean = mean (Response), sd = sd (Response))
lines (x2, Normal_Curve, col = "green", lwd = 2)
Q3 ANOVA <- aov (Response-Treatment, data-Data_Question 3)
summary (Q3_ANOVA)
Expert Solution
![](/static/compass_v2/shared-icons/check-mark.png)
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 4 steps with 9 images
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
Recommended textbooks for you
![MATLAB: An Introduction with Applications](https://www.bartleby.com/isbn_cover_images/9781119256830/9781119256830_smallCoverImage.gif)
MATLAB: An Introduction with Applications
Statistics
ISBN:
9781119256830
Author:
Amos Gilat
Publisher:
John Wiley & Sons Inc
![Probability and Statistics for Engineering and th…](https://www.bartleby.com/isbn_cover_images/9781305251809/9781305251809_smallCoverImage.gif)
Probability and Statistics for Engineering and th…
Statistics
ISBN:
9781305251809
Author:
Jay L. Devore
Publisher:
Cengage Learning
![Statistics for The Behavioral Sciences (MindTap C…](https://www.bartleby.com/isbn_cover_images/9781305504912/9781305504912_smallCoverImage.gif)
Statistics for The Behavioral Sciences (MindTap C…
Statistics
ISBN:
9781305504912
Author:
Frederick J Gravetter, Larry B. Wallnau
Publisher:
Cengage Learning
![MATLAB: An Introduction with Applications](https://www.bartleby.com/isbn_cover_images/9781119256830/9781119256830_smallCoverImage.gif)
MATLAB: An Introduction with Applications
Statistics
ISBN:
9781119256830
Author:
Amos Gilat
Publisher:
John Wiley & Sons Inc
![Probability and Statistics for Engineering and th…](https://www.bartleby.com/isbn_cover_images/9781305251809/9781305251809_smallCoverImage.gif)
Probability and Statistics for Engineering and th…
Statistics
ISBN:
9781305251809
Author:
Jay L. Devore
Publisher:
Cengage Learning
![Statistics for The Behavioral Sciences (MindTap C…](https://www.bartleby.com/isbn_cover_images/9781305504912/9781305504912_smallCoverImage.gif)
Statistics for The Behavioral Sciences (MindTap C…
Statistics
ISBN:
9781305504912
Author:
Frederick J Gravetter, Larry B. Wallnau
Publisher:
Cengage Learning
![Elementary Statistics: Picturing the World (7th E…](https://www.bartleby.com/isbn_cover_images/9780134683416/9780134683416_smallCoverImage.gif)
Elementary Statistics: Picturing the World (7th E…
Statistics
ISBN:
9780134683416
Author:
Ron Larson, Betsy Farber
Publisher:
PEARSON
![The Basic Practice of Statistics](https://www.bartleby.com/isbn_cover_images/9781319042578/9781319042578_smallCoverImage.gif)
The Basic Practice of Statistics
Statistics
ISBN:
9781319042578
Author:
David S. Moore, William I. Notz, Michael A. Fligner
Publisher:
W. H. Freeman
![Introduction to the Practice of Statistics](https://www.bartleby.com/isbn_cover_images/9781319013387/9781319013387_smallCoverImage.gif)
Introduction to the Practice of Statistics
Statistics
ISBN:
9781319013387
Author:
David S. Moore, George P. McCabe, Bruce A. Craig
Publisher:
W. H. Freeman