I want to find a way to generate a three by four matrix of different plots. The first row of the matrix will look at a random sample size of 10. The second row, looks at sample 100, and the third will look at 1000 random samples. I'm a bit lost on how to relate my plots to the QQ plots or if thats even how I should go about this.
I'm using the Boston dataset from library(MASS) to practice.
My current VERY ROUGH code is:
library(MASS)
x <- rnorm(10) #normal distribution of 10 random observations
y <- rnorm(100) #normal distribution of 100 random observations
z <- rnorm(1000) #normal distribution of 1000 random observations
par(mfrow = c(3,4)) #creates the matrix of 3 x 4
plot(Boston$indus,Boston$lstat) #I want these four plots to show a sample size of x
plot(Boston$age,Boston$dis) #I want these four plots to show a sample size of x
plot(Boston$age,Boston$ptratio) #I want these four plots to show a sample size of x
plot(Boston$tax,Boston$medv) #I want these four plots to show a sample size of x
# in row 2, I want the same plots, but sample size y, and then row 3 would be sample size z
#I also believe that i need to use the qqnorm() as the question is asking for normal probability plots which made me think it should be a qq plot
Instead of plot(), should I use qqnorm for each of my desired comparisons or would that be added later?
Aucun commentaire:
Enregistrer un commentaire