Task C • Relationship between mean age of children in a family and height of Christmas tree was studied. The resulting data were following: • Does the age of children in family affect the height of the Christmas tree bought by the parents? Null hypothesis • There is no correlation between the height of Christmas tree and the age of the children. R script • tree<-read.delim2("clipboard") • cor.test(tree$tree.height, tree$age) • lm.c<-lm(tree$tree.height~tree$age) • summary(lm.c) • ggplot(data=tree, aes(x=age, y=tree.height))+geom_point()+ • geom_smooth(method="lm", color=1)+ • labs(x="Age", y="Tree height")+theme_classic() Results • Pearson's product-moment correlation • data: tree$tree.height and tree$age • t = -3.8541, df = 8, p-value = 0.004849 • alternative hypothesis: true correlation is not equal to 0 • 95 percent confidence interval: • -0.9523889 -0.3585995 • sample estimates: • cor • -0.8061992 Results • Call: • lm(formula = tree$tree.height ~ tree$age) • Residuals: • Min 1Q Median 3Q Max • -0.78154 -0.35686 -0.03737 0.46167 0.56491 • Coefficients: • Estimate Std. Error t value Pr(>|t|) • (Intercept) 2.99572 0.34361 8.718 2.34e-05 *** • tree$age -0.10968 0.02846 -3.854 0.00485 ** • --- • Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 • Residual standard error: 0.5001 on 8 degrees of freedom • Multiple R-squared: 0.65, Adjusted R-squared: 0.6062 • F-statistic: 14.85 on 1 and 8 DF, p-value: 0.004849 Conclusion • There is a negative linear regression between the age of children and the tree height.