Complete the following problems using R. Please turn in your R code and answers to all questions all in one document, with each problem clearly labeled
1.Now consider the Height data.
a.Make a box plot by speciesto show the variability of the height data
b.Make a histogram for each species’ heights to show the distribution of the data. Is the distribution roughly bell-shaped, or skewed?
c.Compute the mean value of height for each species.
d.Compute the standard deviation of height for each species.
e.What is the 90% confidence interval for height for each species?
f.What do these intervals mean, and how do they compare to each other?
treecode,location,species,dbh,height 1-W-7,eastern,MR,46.8,39.2 1-N-1,eastern,MR,47.1,37.4 1-E-4,eastern,MR,60.6,41.1 2-M-2,eastern,MR,50.1,26.9 3-E-4,eastern,MR,16.4,25.2 3-M-6,eastern,MR,29.4,27.3 3-S-4,eastern,MR,33.3,38 3-N-5,eastern,MR,37.4,22.5 3-N-6,eastern,MR,36.4,25 4-M-3,eastern,MR,7.2,3.9 4-M-2,eastern,MR,8,6.1 5-E-3,eastern,MR,19.6,14.5 7-N-5,eastern,MR,41.6,34.1 8-W-5,eastern,MR,31.7,31 8-S-7,eastern,MR,39.4,31.2 11-M-3,eastern,MR,16.3,24.3 11-M-5,eastern,MR,22.8,26.2 11-M-8,eastern,MR,23.4,30.8 11-M-4,eastern,MR,29.5,25.6 11-N-7,eastern,MR,37.5,27.6 11-S-6,eastern,MR,40.4,34.8 13-M-3,eastern,MR,31.8,27.7 13-M-2,eastern,MR,67.4,37.8 14-M-5,eastern,MR,31.1,28.7 14-M-4,eastern,MR,35.4,30.6 14-W-2,eastern,MR,34.3,33.3 14-E-3,eastern,MR,41.5,32.4 14-N-3,eastern,MR,39.1,36.8 14-M-3,eastern,MR,51,43.4 42-N-1,western,MR,57.6,35.9 43-M-4,western,MR,2.5,4.8 43-M-5,western,MR,3.4,4.8 43-M-7,western,MR,7,7 43-M-9,western,MR,10.5,9.7 44-M-3,western,MR,18.2,22.3 44-E-3,western,MR,25.6,25.3 45-M-1,western,MR,62.7,40 46-M-1,western,MR,25.6,28.3 46-M-2,western,MR,28.7,26.6 46-M-5,western,MR,43.9,26.8 46-N-9,western,MR,50.9,36.1 46-M-7,western,MR,56.3,35.2 47-N-1,western,MR,8.6,8.7 47-E-4,western,MR,22.6,19.3 48-M-2,western,MR,26,21.6 48-S-5,western,MR,30.7,23.5 49-M-7,western,MR,38.3,26.8 49-W-1,western,MR,45.4,29.6 50-M-5,western,MR,27,19 3-W-5,eastern,OW,6,6.5 3-W-3,eastern,OW,12.5,7.8 3-M-4,eastern,OW,19.1,25.2 3-M-3,eastern,OW,34.4,25.2 7-M-3,eastern,OW,31.7,24.2 7-S-1,eastern,OW,40.2,23 7-N-6,eastern,OW,45.5,25.2 7-N-7,eastern,OW,52.4,31.3 7-W-5,eastern,OW,54.3,28.3 8-M-2,eastern,OW,37.8,30.9 8-E-1,eastern,OW,65,36.4 8-M-4,eastern,OW,68.1,32.2 9-S-6,eastern,OW,59.8,46.9 11-M-2,eastern,OW,12.1,18.6 11-E-2,eastern,OW,17.7,12.4 11-M-6,eastern,OW,26.4,22.6 13-M-5,eastern,OW,98.9,36.4 14-N-5,eastern,OW,62.2,29.6 15-M-1,eastern,OW,26.4,26.8 15-M-6,eastern,OW,43.6,35.7 15-S-3,eastern,OW,48.2,28.9 15-M-3,eastern,OW,61,33.1 42-M-2,western,OW,41.3,21.1 45-W-5,western,OW,87.2,41.2 46-M-6,western,OW,33.1,21.9 47-M-9,western,OW,4.8,3.2 47-M-3,western,OW,2.5,2.9 48-W-5,western,OW,61.1,29.7 48-M-7,western,OW,62.5,27.6 49-M-8,western,OW,3.7,4.4 49-N-4,western,OW,47.8,19.5 49-M-6,western,OW,53.4,29.6 49-M-4,western,OW,56,25.3 49-M-3,western,OW,67.4,27.4 50-N-2,western,OW,45.4,20.8 50-M-7,western,OW,48.1,23.9 50-M-4,western,OW,45.4,23.4 50-M-2,western,OW,48.7,22.7 52-N-6,western,OW,5.2,7 53-E-2,western,OW,44.3,30.6 53-N-2,western,OW,45.3,23.7 53-M-5,western,OW,76.9,28.6 54-M-6,western,OW,32.7,23.3 54-M-2,western,OW,40.2,24.1 54-S-6,western,OW,47.8,26.1 55-M-1,western,OW,49,27 55-M-2,western,OW,66.3,26.7 56-M-3,western,OW,29.3,18.8 57-M-3,western,OW,37.9,37.4 58-M-6,western,OW,41.9,22.4 59-M-2,western,OW,24.7,15.1 61-M-6,western,OW,57.3,30.6 62-M-10,western,OW,4.1,8.3 62-M-2,western,OW,9.1,2.7 62-S-1,western,OW,16.2,8.9 63-M-6,western,OW,16.2,13.8 63-M-2,western,OW,49.6,24.8 64-W-3,western,OW,30.2,15.1 64-M-6,western,OW,54.5,22.7 64-M-2,western,OW,60.6,24.9 64-M-5,western,OW,63,27.9 64-S-2,western,OW,72.9,28.8
First the data is stored in excel and saved as a csv file.
Trees = read.csv("Trees.scv")
splitTrees = split(Trees, Trees$species)
> TreesOW= splitTrees$OW
> TreesMR= splitTrees$MR
#The data is split according to the species
boxplot(height~species, data = Trees)
Box plot of heights with respect to species:
Histogram of height of OW species: (This is approximately normally distributed)
histogram of height of the other MR species:
This histogram is slightly skewed
For finding the mean the code used is:
> mean(TreesMR$height)
[1] 26.42245
> mean(TreesOW$height)
[1] 23.40484
For calculating the standard deviations this code is used:
> sd(TreesOW$height)
[1] 9.557667
> sd(TreesMR$height)
[1] 10.275
Get Answers For Free
Most questions answered within 1 hours.