Question

In: Statistics and Probability

D. The data le TreeAgeDiamSugarMaple.txt is available at the same site as the other data sets...

D. The data le TreeAgeDiamSugarMaple.txt is available at the same site as the other data sets you have used in the homework assignments. The data are from 27 maple trees. The rst column of the le is x=tree diameter and the second column is y=tree age (in years). Do the following for these data:

(i) Determine a good polynomial regression model for this data using the AIC and/or BIC criteria. (Fit all polynomial regression models upto a maximum degree of 8 and then choose the best one.)

(ii) For the second degree polynomial model, test the null hypothesis that the coecient of x 2 is 0. Use a level of signicance: α = 0.05. Report the p-value as well (note that this doesn't involve α).

(iii) Produce a plot of the residuals versus the predicted values for the model chosen in part (i) above. Is there anything remarkable about the plot?

(iv) Using the model in part (i), predict the age of a tree with a diameter of 110 by using an interval in which you have 95% condence (i.e. obtain a 95% prediction interval for Y at x = 110.)

TreeAgeDiamSugarMaple Data is:

Diamet Age
2.86 1.61
4.29 3.23
8.57 6.45
14.29 8.06
15.71 14.52
17.14 22.58
20.00 24.19
54.29 37.10
60.00 40.32
88.57 32.26
100.00 46.77
102.86 51.61
105.71 58.07
108.57 37.10
114.29 37.90
177.14 78.23
178.57 100.81
252.86 76.61
254.29 90.32
311.43 134.68
397.14 96.77
491.43 151.61
560.00 163.71
531.43 140.32
532.86 112.10
545.71 109.68
541.43 123.39

please provide the R code used

Solutions

Expert Solution

R code

xy=read.table("clipboard",sep="\t",header=T)#data entry
xy

##Answer(i)
xy.lm=lm(Diamet~Age,data=xy)
xy.lm
AIC(xy.lm)

xy.lm.2=lm(Diamet~poly(Age,2,raw=T),data=xy)
xy.lm.2
AIC(xy.lm.2)

xy.lm.3=lm(Diamet~poly(Age,3,raw=T),data=xy)
xy.lm.3
AIC(xy.lm.3)

xy.lm.4=lm(Diamet~poly(Age,4,raw=T),data=xy)
xy.lm.4
AIC(xy.lm.4)

xy.lm.5=lm(Diamet~poly(Age,5,raw=T),data=xy)
xy.lm.5
AIC(xy.lm.5)

xy.lm.6=lm(Diamet~poly(Age,6,raw=T),data=xy)
xy.lm.6
AIC(xy.lm.6)

xy.lm.7=lm(Diamet~poly(Age,7,raw=T),data=xy)
xy.lm.7
AIC(xy.lm.7)

xy.lm.8=lm(Diamet~poly(Age,8,raw=T),data=xy)
xy.lm.8
AIC(xy.lm.8)

##Answer(ii)
summary(xy.lm.2)

##Answer(iii)
plot(xy.lm.3$fitted,xy.lm.3$res,main="",xlab="fitted",ylab="residuals",pch=19)
abline(h=mean(xy.lm.3$res),col="red")

##Answer(iv)
new=data.frame(Age=110)
predict(xy.lm.3,newdata=new,interval="prediction")


Related Solutions

QUESTION 8 Two data sets that have the same range must also have the same standard...
QUESTION 8 Two data sets that have the same range must also have the same standard deviation. True False QUESTION 9 It is possible to have a negative sample standard deviation (Hint: think about step 3 in the 6-step process.) True False QUESTION 10 When calculating for the following values, which calculation will use every value in the data set? (choose all that apply) A. Standard Deviation B. Mean C. Range D. Median QUESTION 11 Complete this definition: the standard...
1.) What other D aldohexose gives the same alditol as D-talose? 2.) A. The aldaric acid...
1.) What other D aldohexose gives the same alditol as D-talose? 2.) A. The aldaric acid of D-talose is the same as the aldaric acid of which sugar? (Choices: L-allose, D-altrose, L-galactose, L-glucose, L-gulose, D-idose, D-mannose, D-talose.) B. The aldaric acid of L-altrose is the same as the aldaric acid of which sugar? 3.) A. Which aldopentose gives the same aldaric acid as D-ribose? (Choices: D-ribose, D-arabinose, D-xylose, D-lyxose, L-ribose, L-arabinose, L-xylose, L-lyxose) B. Which aldopentose gives the same aldaric...
T/F/U. Some individuals earn le ss money than other individuals doing the same job because of...
T/F/U. Some individuals earn le ss money than other individuals doing the same job because of discrimination. In your answer, e xplain why free market theoretically would/would not allow dis crimination. Additionally, if wage gaps aren ’ t attributable to discrimination, explain what alternative variables describe this discrepancy. If wage gaps are attributable to discrimination explain the variables that could be biased
No other data provided 3. The cations on an exchangeable site of a 40 g soil...
No other data provided 3. The cations on an exchangeable site of a 40 g soil were displaced by repeatedly washing by a salt and found to be 40 mg Ca+2, 11.5 mg Na+1, 39 mg K+1, 12 mg Mg+2, and 9 mg Al+3. The pH of the soil was 5.0. Calculate the CEC (cmolc/kg), percentage base saturation (PBS) and percent acidic saturation (PAC) per kg of the soil. 4. A give soil has a CEC of 12.50 cmol of...
Define 2 different measures of correlation of 2 data sets to each other.
Define 2 different measures of correlation of 2 data sets to each other.
What healthcare data sets available from the US Government? What data do they contain? How could...
What healthcare data sets available from the US Government? What data do they contain? How could these data sets be useful during a hospital system? Pls, mention  details accordingly and include the reference page.
Statistics Question Data provided below (To be done with EVIEWS or any other data processor) d)...
Statistics Question Data provided below (To be done with EVIEWS or any other data processor) d) e) In general, we can conduct hypothesis tests on a population central location with EViews by performing the (one sample) t-test, the sign test or the Wilcoxon signed ranks test.2 Suppose we would like to know whether there is evidence at the 5% level of significance that the population central location of NAR is larger than 5%. which test(s) offered by EViews would be...
Create 2 data sets. One with 5 observations and the other with 15 observations. Illustrate how...
Create 2 data sets. One with 5 observations and the other with 15 observations. Illustrate how variance is sensitive to an extreme score. Also show how sample size mediates the effect of an extreme score.
Healthcare data sets is an interesting topic. What are data sets? Why would a data set...
Healthcare data sets is an interesting topic. What are data sets? Why would a data set be developed? Provide one to two examples only not a list.
Construct a 95% confidence interval for data sets A and B. Data sets A and B...
Construct a 95% confidence interval for data sets A and B. Data sets A and B are dependent. Assume that the paired data came from a population that is normally distributed, and round your final answer to three decimal places. setA: 30 28 47 43 31 setB: 28 24 35 35 22 A) What is the mean of the differences( )? B) What is the standard deviation of the differences( )? C) What is the critical t-value( )? D) What...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT