Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Question (2) [10 Marks] Use the 'trees' dataset available in R. This data set provides measurements of the girth, height and volume of timber
Question (2) [10 Marks] Use the 'trees' dataset available in R. This data set provides measurements of the girth, height and volume of timber in 31 felled black cherry trees. Note that girth is the diameter of the tree (in inches) measured at 4 ft 6 in above the ground. You can load the trees data set in R by issuing the following command at the console data("trees"). This will load the data into a variable called trees. If R says the trees data set is not found, you can try installing the package by issuing this command install.packages("datasets") and then attempt to reload the data. a) (1 mark) Show the top 6 rows (entries) of the data set using head() function in R. b) (1 mark) The dataset 'trees' includes measurements of the diameter, height and volume of 31 black cherry trees. Note that the 'Girth' is actually the diameter at breast height (DBH) in inches, 'Height' is height in feet, and 'Volume' is volume in cubic feet. Rename those variable names for clarity as "DBH_in","height_ft", and "volume_ft3. Show the top 6 rows (entries) of this new data set using head() function in R. c) (2 marks) Use the function plot ( ) in R to visualize the potential association of "DBH_in" and "height_ft" variables. Do not use open circle points, so add in the argument "pch = 16" to the plotting function to fill in the circles. Use color blue to these fills in circles. Add a suitable title to your graph. Describe the relationship between diameter and height of these trees (increasing, decreasing, no association). wwwww d) (1 mark) Perform a simple linear regression on the data in R using the function Im() and name it "mod". e) (2 marks) Run the 'summary' function with "mod". Is there a statistically significantly association between "DBH in "and "height_ft"? Explain clearly based on the p-value. f) (1 mark) Add a line to your plot in part (a) that shows the fitted line from this model. First run the plot function that you ran before, and then run the "abline" function with the "mod" as it's argument (i.e., abline(mod)). g) (1 mark) Write is the least square equation for this question? h) (1 mark) What is the predicted value of the diameter (in) when the height in feet of timber in felled black cherry trees is 61.3?
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