Gravity experiment

A group of physics students at the University of Auckland conducted a projectile experiment using an electromagnetic catapult to eject a steel ball in to the air at a fixed speed. At a given time after ejection, a stereo camera would take a photo to measure the height of the ball. A total of 30 trials were conducted. Each row in GravityExpt.txt corresponds to a single trial. The variables are • Time: Seconds after ejection of the steel ball, between 0.2 and 2.

• Height: Response variable - the height of the ball in metres.

Question we want to explore

• What is the estimated value of 𝑔?

• Is our estimated value of 𝑔 consistent with the theoretical value of 9.80? [Hint - calculate the 95% confidence for 𝑔.]

• Theory also tells us that the true value of the coefficient of the intercept term is zero. Is this consistent with our analysis?

• [Optional] Refit the model without the intercept, and compare the CI for 𝑔 with the CI you calculated earlier.

Code and output

library(s20x)
## Warning: package 's20x' was built under R version 4.0.5
## Loading in the data.
Gravity.df = read.table("C:/Users/Tony/Desktop/experiment_1/GravityExpt.txt", header = TRUE)
## Plot the data.
plot(Height~Time, data = Gravity.df)

##In the plot figure we find a clear quadratic relationship between the independent and dependent variables, so we don’t need fit a standard linear model, we can fit a quadratic curve.

Gravity.fit = lm(Height~Time + I(Time^2), data = Gravity.df)
plot(Gravity.fit, which = 1)

##We find that the residuals are essentially the same through the residual analysis graph, satisfying the same distribution

normcheck(Gravity.fit)

##Quantile line is basically on a straight line and the residuals are normally distributed (even if they are not particularly good, we can optimize them later)

cooks20x(Gravity.fit)

Since the Cook’s Distance for each observation did not exceed 0.4. We have reasonS to believe that these data do not have strong influence points.

summary(Gravity.fit)
## 
## Call:
## lm(formula = Height ~ Time + I(Time^2), data = Gravity.df)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -0.21914 -0.09378  0.01751  0.08025  0.19217 
## 
## Coefficients:
##               Estimate Std. Error t value Pr(>|t|)    
## (Intercept)  0.0008333  0.0748403   0.011    0.991    
## Time        10.9786742  0.1562823  70.249   <2e-16 ***
## I(Time^2)   -4.8740530  0.0692301 -70.404   <2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.1102 on 27 degrees of freedom
## Multiple R-squared:  0.9946, Adjusted R-squared:  0.9942 
## F-statistic:  2505 on 2 and 27 DF,  p-value: < 2.2e-16

Since the p value of the constant term is much larger than 0.05, we have good reason to reject it and can set him to 0, but we are doing this later

-2*confint(Gravity.fit)
##                   2.5 %      97.5 %
## (Intercept)   0.3054525  -0.3087858
## Time        -21.3160189 -22.5986781
## I(Time^2)    10.0322030   9.4640091
-2 * coef(Gravity.fit)[3]
## I(Time^2) 
##  9.748106
## Answer research questions.
## INSERT CODE HERE.

Methods and Assumption Checks

The scatter plot of Height and Time suggested curvature in the relationship.

We began to see the Scatter Plot and a strong quadratic relationship is found between the two of them. Then we directly fit a quadratic model. The residual plot from the fit of a quadratic linear model showed fairly constant scatter.

All model assumptions look satisfied once we added the quadratic term to the linear model.

Our final model is: \[Height_i = \beta_0 + \beta_1 * Time_i + \beta_2 * Time_i^2 + \epsilon_i \] where \(\epsilon_i\)~\(N(0,\sigma^2)\)

Our model explained 99.46% of the vairability in the Gravity experiment.

Executive Summary

We are interested in building a model to estimate the relation between Height and Time.

The relationship between Height and Time was quadratic is quadratic.

Here, we want to estimate the coefficient before it. Thanks to the Physicist, we already know that it is 9.8 and By observing the confidence interval we know that it is reasonable for the value between [9.46,10.03], thankfully 9.8 is in it.

• What is the estimated value of 𝑔?
The estimate value of g is9.748106

• Is our estimated value of 𝑔 consistent with the theoretical value of 9.80? [Hint - calculate the 95% confidence for 𝑔.] We calculate the confidence interval of g is between [9.46,10.03], and the 9.80 is in this interval, so the estimated value of g consistent with the theoretical value of 9.80.

• Theory also tells us that the true value of the coefficient of the intercept term is zero. Is this consistent with our analysis? The estimate of Intercept is 0.0008333 and the p-value of it is 0.991, which is > 0.05, we have strong evidence to deny the null hypothesis, so we can see that the coefficient of the intercept term is zero.

• [Optional] Refit the model without the intercept, and compare the CI for 𝑔 with the CI you calculated earlier.

Gravity.fit2 = lm(Height~-1+Time + I(Time^2), data = Gravity.df)
summary(Gravity.fit2)
## 
## Call:
## lm(formula = Height ~ -1 + Time + I(Time^2), data = Gravity.df)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -0.21923 -0.09375  0.01783  0.08031  0.19202 
## 
## Coefficients:
##           Estimate Std. Error t value Pr(>|t|)    
## Time      10.98026    0.06406   171.4   <2e-16 ***
## I(Time^2) -4.87468    0.03949  -123.5   <2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.1082 on 28 degrees of freedom
## Multiple R-squared:  0.9995, Adjusted R-squared:  0.9995 
## F-statistic: 2.936e+04 on 2 and 28 DF,  p-value: < 2.2e-16
-2*confint(Gravity.fit)
##                   2.5 %      97.5 %
## (Intercept)   0.3054525  -0.3087858
## Time        -21.3160189 -22.5986781
## I(Time^2)    10.0322030   9.4640091
-2 * coef(Gravity.fit)[3]
## I(Time^2) 
##  9.748106

The estimate g and its CI has no change.