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
icon
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)
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
steps

Step by step

Solved in 4 steps with 9 images

Blurred answer
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
MATLAB: An Introduction with Applications
MATLAB: An Introduction with Applications
Statistics
ISBN:
9781119256830
Author:
Amos Gilat
Publisher:
John Wiley & Sons Inc
Probability and Statistics for Engineering and th…
Probability and Statistics for Engineering and th…
Statistics
ISBN:
9781305251809
Author:
Jay L. Devore
Publisher:
Cengage Learning
Statistics for The Behavioral Sciences (MindTap C…
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…
Elementary Statistics: Picturing the World (7th E…
Statistics
ISBN:
9780134683416
Author:
Ron Larson, Betsy Farber
Publisher:
PEARSON
The Basic Practice of Statistics
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
Introduction to the Practice of Statistics
Statistics
ISBN:
9781319013387
Author:
David S. Moore, George P. McCabe, Bruce A. Craig
Publisher:
W. H. Freeman