You can use any data set
Using the variables of interest, create a chart in R (use ggplot
library). This chart should be able to present to the reader what
the relationship between the two variables are. If should answer,
or hint towards an answer, to your question.
Sol:
In ggplot2 libraru use ggplot function in aesthetics take x=wt and y=mpg for the inbuikt dataset in R which is mtcars
store in an object scp
with geom_point create a scatterplot,which gives relationship between two variables
library(ggplot2)
scp <- ggplot(mtcars, aes(wt, mpg))
scp + geom_point(colour = "green",size = 3)
Intrepretationof scatterplot
There exists a strong negative realtionship between wt and mpg
As wt increase,mpg decreases
and as wt decreases,mpg increases
Form;linear
strength:strong
direction:negative
Get Answers For Free
Most questions answered within 1 hours.