Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Assuming that you read the flowers.csv file into an R object called flower.data,

ID: 3204839 • Letter: A

Question

Assuming that you read the flowers.csv file into an R object called flower.data, run the following R code (do not paste the ">” character into R). Note that we are not rounding the numbers here. Use the output for the next five tasks:

> table(flower.data$Sepal.Width)

> plot(table(flower.data$Sepal.Width))

9. What is the sum of the first three frequencies in the frequency table for sepal width? _____

10. What does your answer to the previous question represent (in terms of sepal width and frequency and the percentage of all sepal measurements) ____

11. What is the sum of the last three frequencies in the frequency table for sepal width? _____

12. How many flowers in the sample had sepal widths less than 4 (do NOT round the sepal width numbers for this, but you can round your final answer to 3 decimal places)? _________

13. What does the tallest bar in the plot represent?_________

Explanation / Answer

9. 8 is the sum of first three frequencies 1+3+4

10. see output below for all percentages of all the sepal measurements

11. 3  is the sum of last three frequencies 1+1+1

12. 146 flowers had sepal width less than 4

13 frequency of flowerswith sepal width 3 is maximum in number i.e it is 26.

R codings :

flower.data=Iris
flower.data
table(flower.data$Sepal.Width)
plot(table(flower.data$Sepal.Width))
v=table(flower.data$Sepal.Length)
prop.table(v)

R output :

> table(flower.data$Sepal.Width)

data for sepal.widh of different flowers: 2 2.2 2.3 2.4 2.5 2.6 2.7 2.8 2.9 3 3.1 3.2 3.3 3.4 3.5 3.6 3.7 3.8 3.9 4 4.1 4.2 4.4
these are frequencies for above length respectively :1 3 4 3 8 5 9 14 10 26 11 13 6 12 6 4 3 6 2 1 1 1 1

> prop.table(v)

4.3 4.4 4.5 4.6 4.7 4.8 4.9 5
0.006666667 0.020000000 0.006666667 0.026666667 0.013333333 0.033333333 0.040000000 0.066666667
5.1 5.2 5.3 5.4 5.5 5.6 5.7 5.8
0.060000000 0.026666667 0.006666667 0.040000000 0.046666667 0.040000000 0.053333333 0.046666667
5.9 6 6.1 6.2 6.3 6.4 6.5 6.6
0.020000000 0.040000000 0.040000000 0.026666667 0.060000000 0.046666667 0.033333333 0.013333333
6.7 6.8 6.9 7 7.1 7.2 7.3 7.4
0.053333333 0.020000000 0.026666667 0.006666667 0.006666667 0.020000000 0.006666667 0.006666667
7.6 7.7 7.9
0.006666667 0.026666667 0.006666667
>