(bedrooms ~ waterfront, data = house_prices) ## ## Welch Two Sample t-test ## ## data: bedrooms by waterfront ## t = 0.83568, df = 163.83, p-value = 0.4046 ## alternative hypothesis: true difference in means is not equal to 0 ## 95 percent confidence interval: ## -0.09643533 0.23795892 ## sample estimates: ## mean in group FALSE mean in group TRUE ## 3.371375                                      3.300613

Glencoe Algebra 1, Student Edition, 9780079039897, 0079039898, 2018
18th Edition
ISBN:9780079039897
Author:Carter
Publisher:Carter
Chapter10: Statistics
Section10.4: Distributions Of Data
Problem 23PFA
icon
Related questions
Question

Interpret the 95% confidence interval given in the t.test() output from Lesson 10, in context. Does this interval agree with the conclusion you reached in the hypothesis test by using the p-value?

t.test(bedrooms ~ waterfront, data = house_prices) ## ##

Welch Two Sample t-test ## ## data: bedrooms by waterfront

## t = 0.83568, df = 163.83, p-value = 0.4046

## alternative hypothesis: true difference in means is not equal to 0

## 95 percent confidence interval: ## -0.09643533 0.23795892

## sample estimates:

## mean in group FALSE mean in group TRUE

## 3.371375                                      3.300613

ysis
Test Statistic
Let's revisit our sample statistics:
favstats (bedrooms waterfront,
## waterfront min Q1 median Q3 max
## 1
FALSE 0 3
## 2
TRUE 1 3
data
waterfront, data = house_prices)
Using R as a calculator:
We have the following:
• xf = 3.37, t = 3.30, soft = 0.07
• Sf = 0.93, st = 1.08
• nf = 21450, nt = 163
We'll use all these in calculating the test statistic:
## [1] 0.8251786
mean
34 33 3.371375 0.9288559 21450
3 4 6 3.300613 1.0780353 163
Therefore, the test statistic is T = 0.83.
T=
(3.37 3.30)/sqrt(0.93^2/21450 +1.08^2/163)
=
sd
(x-x) - 0
n missing
+
0
0
p-value
Because the alternative hypothesis, HA: Mf - Mt 0, does not specify a direction, the p-value must account for
statistically significant "evidence" being in either direction (in favor of waterfront homes or non-waterfront homes). Therefore,
we need to multiply the regular one-sided p-value by 2:
Transcribed Image Text:ysis Test Statistic Let's revisit our sample statistics: favstats (bedrooms waterfront, ## waterfront min Q1 median Q3 max ## 1 FALSE 0 3 ## 2 TRUE 1 3 data waterfront, data = house_prices) Using R as a calculator: We have the following: • xf = 3.37, t = 3.30, soft = 0.07 • Sf = 0.93, st = 1.08 • nf = 21450, nt = 163 We'll use all these in calculating the test statistic: ## [1] 0.8251786 mean 34 33 3.371375 0.9288559 21450 3 4 6 3.300613 1.0780353 163 Therefore, the test statistic is T = 0.83. T= (3.37 3.30)/sqrt(0.93^2/21450 +1.08^2/163) = sd (x-x) - 0 n missing + 0 0 p-value Because the alternative hypothesis, HA: Mf - Mt 0, does not specify a direction, the p-value must account for statistically significant "evidence" being in either direction (in favor of waterfront homes or non-waterfront homes). Therefore, we need to multiply the regular one-sided p-value by 2:
# Take 1 - pt() because T>0
2* (1 pt(0.83,
df = 162).)
-
## [1] 0.4077602
The p-value is 0.41. Because this is greater than 0.05, we fail to reject the null hypothesis.
Conclusion: We do not have enough evidence to conclude that the average number of bedrooms for waterfront homes is
different from the average number of bedrooms for non-waterfront homes.
t.test()
Because the two-sample t-test is such a frequently-used statistical procedure, R has a built-in function that does all of these
"by-hand" calculations for us! Though, it is still important to be able to read and interpret the output.
The t.test() syntax follows some of the usual mosaic syntax that we've seen throughout the course:
t.test(bedrooms ~ waterfront, data = house_prices)
##
## Welch Two Sample t-test
##
## data: bedrooms by waterfront
## t = 0.83568, df = 163.83, p-value = 0.4046
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
## -0.09643533 0.23795892
## sample estimates:
## mean in group FALSE mean in group TRUE
##
3.371375
3.300613
This gives the test statistic ( t ), the p-value, and a 95% confidence interval all in the same output! Note that the t and
p-value we found "by-hand" were slightly different due to round off error. We can use this output to reach the same
conclusion as above - not enough evidence to conclude there is a difference in mean bedrooms between waterfront and non-
waterfront homes.
Transcribed Image Text:# Take 1 - pt() because T>0 2* (1 pt(0.83, df = 162).) - ## [1] 0.4077602 The p-value is 0.41. Because this is greater than 0.05, we fail to reject the null hypothesis. Conclusion: We do not have enough evidence to conclude that the average number of bedrooms for waterfront homes is different from the average number of bedrooms for non-waterfront homes. t.test() Because the two-sample t-test is such a frequently-used statistical procedure, R has a built-in function that does all of these "by-hand" calculations for us! Though, it is still important to be able to read and interpret the output. The t.test() syntax follows some of the usual mosaic syntax that we've seen throughout the course: t.test(bedrooms ~ waterfront, data = house_prices) ## ## Welch Two Sample t-test ## ## data: bedrooms by waterfront ## t = 0.83568, df = 163.83, p-value = 0.4046 ## alternative hypothesis: true difference in means is not equal to 0 ## 95 percent confidence interval: ## -0.09643533 0.23795892 ## sample estimates: ## mean in group FALSE mean in group TRUE ## 3.371375 3.300613 This gives the test statistic ( t ), the p-value, and a 95% confidence interval all in the same output! Note that the t and p-value we found "by-hand" were slightly different due to round off error. We can use this output to reach the same conclusion as above - not enough evidence to conclude there is a difference in mean bedrooms between waterfront and non- waterfront homes.
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Recommended textbooks for you
Glencoe Algebra 1, Student Edition, 9780079039897…
Glencoe Algebra 1, Student Edition, 9780079039897…
Algebra
ISBN:
9780079039897
Author:
Carter
Publisher:
McGraw Hill
Holt Mcdougal Larson Pre-algebra: Student Edition…
Holt Mcdougal Larson Pre-algebra: Student Edition…
Algebra
ISBN:
9780547587776
Author:
HOLT MCDOUGAL
Publisher:
HOLT MCDOUGAL
Big Ideas Math A Bridge To Success Algebra 1: Stu…
Big Ideas Math A Bridge To Success Algebra 1: Stu…
Algebra
ISBN:
9781680331141
Author:
HOUGHTON MIFFLIN HARCOURT
Publisher:
Houghton Mifflin Harcourt