Question
I WANT THE FOLLOWING INSTRUCTION FOLLOWED AND QUESTIONS ANSWERED WITH RSTUDIO NOTE: ONLY CODES THAT HAS BEEN TEXTED WITHOUT BRINGING ERROR SHOULD BE USED TO
I WANT THE FOLLOWING INSTRUCTION FOLLOWED AND QUESTIONS ANSWERED WITH RSTUDIO
NOTE: ONLY CODES THAT HAS BEEN TEXTED WITHOUT BRINGING ERROR SHOULD BE USED TO ANSWER THE QUESTION.
Install MASS package in RStudio. Download crabs data set available in the MASS library. The data set contains five morphological variables measured on 200 crabs of the Leptograpsus
variegatus species that have been collected in Fremantle, Australia. Explore the data set using different operations or functions to learn more about the variables, rows, and columns. sp corresponds to variety (B=blue; O=orange); FL to the size of the frontal lobe (in mm), RW to the width of the abdomen (in mm), CL to the length of the shell (in mm), CW to the width of the shell (in mm), and BD to the body depth (in mm). Create five different graphs from the data. Compare the shell length between orange and blue female crabs using the codes below:
> crabs2<-subset(crabs,sex=="F",select=c("sp","CL"))
> B<-mean(subset(crabs2,sp=="B")$CL)
> O<-mean(subset(crabs2,sp=="O")$CL)
> ggplot(crabs2, aes(x=CL,y=..density.., fill=sp,color=sp)) +
+ geom_histogram(position="identity",alpha=0.1)+xlab(label="Shell
+ lengths (mm)")+ylab(label="Relative amounts")+
+ scale_color_manual(values=c("Blue",
+ "Orange"))+geom_density(alpha=0.3)+
+ scale_fill_manual(values=c("Blue", "Orange"))+
+ theme(legend.position="right",panel.background=element_rect(fill=
+ "white", colour="grey50"))+
+ geom_vline(aes(xintercept=B),color="blue", size=2)+
+ geom_vline(aes(xintercept=O),color="orange", size=2)
QUESTIONS
Estimate the means for the two samples. Observe the histograms, density curves, and means to determine whether the two samples follow normal distribution. Study and modify the codes above to compare the shell length between orange and blue male crabs. Estimate the means for the two samples. Observe the histograms, density curves, and means to determine whether the two samples follow normal distribution.
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