Sie sind auf Seite 1von 4

Final Project

Michael Bacon

December 6, 2015

Introduction
We are trying to find the effect of the parent's height on the child's height.
The confident intervals will explain to us whether or not the parent's height
will affect the child's height, as a good fit. And a graph will further explain
the regression.

Methods
Galton Is the data we are using in this and the data set is equal to the
variable called model1
We will be using a jitter plot, as well as, a line of best fit to determine
what
The idea is to plot the parent's height as an independent variable and
that makes the dependent height of children.
We need to determine the confident interval of the coefficients and
intercepts as well.
We have to create the Null and Alternative Hypothesis for the each
intercepts.
H0
: The intercept is equal to 0.
HA
: The intercept is not equal to 0.

There are also Null and Alternative Hypothesis for the coefficients.
H0
: The coefficient is equal to 0.
HA
: The coefficient is not equal to 0.

## Loading required package: MASS


## Loading required package: HistData
## Loading required package: Hmisc
## Loading required package: grid
## Loading required package: lattice
## Loading required package: survival
## Loading required package: Formula
## Loading required package: ggplot2
##
## Attaching package: 'Hmisc'
##
## The following objects are masked from 'package:base':
##
## format.pval, round.POSIXt, trunc.POSIXt, units
##
##
## Attaching package: 'UsingR'
##
## The following object is masked from 'package:ggplot2':
##
## movies
##
## The following object is masked from 'package:survival':
##
## cancer
##
## Call:
## lm(formula = child ~ parent)
##
## Residuals:
## Min 1Q Median 3Q Max
## -7.8050 -1.3661 0.0487 1.6339 5.9264
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 23.94153 2.81088 8.517 <2e-16 ***
## parent 0.64629 0.04114 15.711 <2e-16 ***
## ---
## code: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 2.239 on 926 degrees of freedom
## Multiple R-squared: 0.2105, Adjusted R-squared: 0.2096
## F-statistic: 246.8 on 1 and 926 DF, p-value: < 2.2e-16

Graphical Results
model1 = lm(child ~ parent)
plot(jitter(parent), jitter(child))
abline(model1, col='red')
This is the graph made for variable model1. The parent is the independent
variable and the child is the dependent variable. The abline is the straight
red-line on the plot fitting the one-dimensional regression of the Galton data
(line of best fit).

Numerical Results
#model1data
summary(model1)
qt(0.025, df= 926, lower.tail = F)
## [1] 1.962529
#CI
23.94 + (1.96)*(2.81)
## [1] 29.4476
23.94 - (1.96)*(2.81)
## [1] 18.4324
0.65 + (1.96)*(0.04)
## [1] 0.7284
0.65 - (1.96)*(0.04)
## [1] 0.5716

For the intercept confident interval is: (29.4476, 18.4324)


The confident interval is not equal to 0 we must reject the intercept.
The coefficient confident interval is: (0.7284, 0.5716) Again we reject
because confident interval is not equal to 0.
We know that the confidence interval is the estimate plus or minus the t-
value multiplied the standard error.

Discussion and Conclusion


The Regression equation for the child's height= 23.5 + 0.65(Parents height)
The regression equation explains the slope of the scatter plot.
The p-value is 2.2e-16. This shows that there is a relation but it is very
miniscule.
We rejected the null hypothesis it shows that childrens' height is affected by
the parents' height. The R^2 is 21% probability of the child's height being
affected by the parents height
To conclude, through all the test done we can see that the data presented is
not a good fit to predict the child's height from the parents height.

Das könnte Ihnen auch gefallen