Question

Question 5. In R there is a dataset called BOD. For more information type help(BOD) in...

Question 5. In R there is a dataset called BOD. For more information type help(BOD) in R. We wish to build a regression line between Time (as the explanatory variate) and demand (as the response). Part A. Formally test whether the slope differs from zero. Use the 4 steps of an hypothesis test.
Part B. Build a 95% confidence interval for the slope parameter.

Part C. What can be said about the correlation between Time and demand?

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Solution:

Rcode:


attach(BOD)
colnames(BOD)
regmod <- lm(demand~Time,data=BOD)
summary(regmod)
coefficients(regmod)
confint(regmod)
cor.test(demand,Time,data=BOD)

Output:


Call:
lm(formula = demand ~ Time, data = BOD)

Residuals:
1 2 3 4 5 6
-1.9429 -1.6643 5.3143 0.5929 -1.5286 -0.7714

Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 8.5214 2.6589 3.205 0.0328 *
Time 1.7214 0.6387 2.695 0.0544 .
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Residual standard error: 3.085 on 4 degrees of freedom
Multiple R-squared: 0.6449,   Adjusted R-squared: 0.5562
F-statistic: 7.265 on 1 and 4 DF, p-value: 0.05435

> coefficients(regmod)
(Intercept) Time
8.521429 1.721429
> confint(regmod)
2.5 % 97.5 %
(Intercept) 1.13900242 15.90385
Time -0.05177283 3.49463
> cor.test(demand,Time,data=BOD)

   Pearson's product-moment correlation

data: x and y
t = 2.6954, df = 4, p-value = 0.05435
alternative hypothesis: true correlation is not equal to 0
95 percent confidence interval:
-0.02438414 0.97753316
sample estimates:
cor
0.8030693


Part A. Formally test whether the slope differs from zero. Use the 4 steps of an hypothesis test.

Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 8.5214 2.6589 3.205 0.0328 *
Time 1.7214 0.6387 2.695 0.0544

Ho:

Ha:

alpha=0.05

test statistic from above output:

t= 2.695

p= 0.0544

p>0.05

Fail to reject null hypothesis.

Accept null hypothesis.

There is no statistical evidence at 5% level of significance to conclude that the slope differs from zero.

Part B. Build a 95% confidence interval for the slope parameter.

95 % confidence interval for slope is

Rcodde;

regmod <- lm(demand~Time,data=BOD)
confint(regmod)

Output:

> confint(regmod)
2.5 % 97.5 %
(Intercept) 1.13900242 15.90385
Time -0.05177283 3.49463

95% confidence interval for slope is

-0.05177283 and 3.49463

Part C. What can be said about the correlation between Time and demand?

cor.test(demand,Time,data=BOD)

Output:

Pearson's product-moment correlation

data: x and y
t = 2.6954, df = 4, p-value = 0.05435
alternative hypothesis: true correlation is not equal to 0
95 percent confidence interval:
-0.02438414 0.97753316
sample estimates:
cor
0.8030693

correlation coefficient,r=0.8030693

There exists a strong positive relationship between time and demand.

as time increases ,demand increases and vice versa.

Regression line is

Demand =8.521 + 1.721 *Time

slope=1.721

y intercept=8.521

Add a comment
Know the answer?
Add Answer to:
Question 5. In R there is a dataset called BOD. For more information type help(BOD) in...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Q. 34 Part A. Using the dataset below, calculate the covariance and correlation coefficient between X...

    Q. 34 Part A. Using the dataset below, calculate the covariance and correlation coefficient between X and Y. For ease, copy and paste the dataset onto your spreadsheet. X Y 21 35 24 27 23 31 30 38 22 36 18 40 20 37 26 28 a.) Covariance = 5.71. Correlation coefficient = -0.32 b.) Covariance = -5. Correlation coefficient = -0.32 c.) Covariance = -5.71. Correlation coefficient = -0.32 d.) None of the above Part B. Refer to the...

  • 2. A study of the relationship between age and blood pressure yielded the following data Blood Pressure (Y 126 131 161 128 1489 140 148 Test using a significance level of 5% whether there is an...

    2. A study of the relationship between age and blood pressure yielded the following data Blood Pressure (Y 126 131 161 128 1489 140 148 Test using a significance level of 5% whether there is an increasing linear relationship Age(X) 23 27 45 3 536 37 37 a. between age and blood pressure. Parameter: A- slope of regression line for blood pressure vs.age. Hypotheses: Test Statistic: t.A-A d.f- with the same variance. Rejection Region: Calculated Test: Conclusion P-value. b. Find...

  • please help! Following is a simple linear regression model: y = a + A + &...

    please help! Following is a simple linear regression model: y = a + A + & The following results were obtained from some statistical software. R2 = 0.523 Syx (regression standard error) = 3.028 n (total observations) = 41 Significance level = 0.05 = 5% Variable Interecpt Slope of X Parameter Estimate 0.519 -0.707 Std. Err. of Parameter Est 0.132 0.239 Note: For all the calculated numbers, keep three decimals. Write the fitted model (5 points) 2. Make a prediction...

  • Use the following linear regression equation to answer the questions. x1 = 1.7 + 3.9x2 -...

    Use the following linear regression equation to answer the questions. x1 = 1.7 + 3.9x2 - 8.1X3 + 1.9x4 (a) Which variable is the response variable? O O O O Which variables are the explanatory variables? (Select all that apply.) o X3 O X4 Сх, (b) Which number is the constant term? List the coefficients with their corresponding explanatory variables. constant X2 coefficient Xz coefficient x4 coefficient (C) If x2 = 8, X3 = 3, and X4 = 1, what...

  • Please use program "R" to answer these questions. Conduct an unpaired t-test (yes! again) with the...

    Please use program "R" to answer these questions. Conduct an unpaired t-test (yes! again) with the same dataset assuming two independent samples with equal variance. Report the P value and the confidence interval for the difference between means. Conduct a linear regression analysis equivalent to the unpaired t-test (see page 361 in the book). Report the slope with its confidence interval, and the P value based on the F ratio test. Explain the results. NOTE: the p-value should be identical...

  • Use the following linear regression equation to answer the questions. X1 = 1.7 + 3.6x2 -...

    Use the following linear regression equation to answer the questions. X1 = 1.7 + 3.6x2 - 8.4x3 + 1.5x4 (a) Which variable is the response variable? O X1 O X2 O X4 O X3 Which variables are the explanatory variables? (Select all that apply.) X3 X1 U X2 (b) Which number is the constant term? List the coefficients with their corresponding explanatory variables. constant X2 coefficient X3 coefficient X4 coefficient (c) If x2 = 8, X3 = 5, and x4...

  • 4. Linear Regression [TOTAL 5 MARKS] McDonald (1989) collected the amphipod crustacean Platorchestia platensis on a...

    4. Linear Regression [TOTAL 5 MARKS] McDonald (1989) collected the amphipod crustacean Platorchestia platensis on a beach near Stony Brook, Long Island. He removed and counted the number of eggs for 28 females, and then freeze-dried and weighed the mothers (in mg) summary (1m (eggs~mass, eggdata) ) Call 1m (formula data eggdata) eggs mass, Coefficients: Estimate Std. Error t value Pr (>I t|) 12.6890 4.2009 3.021 0.0056 (Intercept) 1.6017 0.6176 2.593 0.0154 mass Signif. codes: 0* 0.001 0.01 0.05 .0.1...

  • 1 point) College Graduation Rates. Data from the College Results Online website compared the 2011...

    Hi! Can someone help me to calculate the last question, the CI? Thanks! 1 point) College Graduation Rates. Data from the College Results Online website compared the 2011 graduation rate and school sze for 92 similar-sized public universities and colleges in the United States. Statistical sottware was used to places. create the linear regression model using size as the explanatory variable and graduation rate as the response variable. Summary output from the software and the scatter plot are shown below....

  • (1 point) College Graduation Rates. Data from the College Results Online website compared the 2011 graduation...

    (1 point) College Graduation Rates. Data from the College Results Online website compared the 2011 graduation rate and school size for 92 similar sized public universities and colleges in the United States. Statistical software was used to create the linear regression model using size as the explanatory variable and graduation rate as the response variable. Summary output from the software and the scatter plot are shown below. Round all calculated results to four decimal places Coefficients Estimate Std. Errort value...

  • Yes, as it is in the mint abs. NO: 24,46 so 50 is an outlier (g)...

    Yes, as it is in the mint abs. NO: 24,46 so 50 is an outlier (g) Find a 95% confidence interval for the slope. Interpret your confidence interval. (h) Test the null hypothesis that the slope is zero and describe your conclusion. (i) Suppose we wish to predict the mean per capita retail sale for the years with per capita personal income 16000. What is the 95% confidence interval for this prediction? 6) If the per capita personal income in...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT