Problem 4

#Problem 4a - population mean sales price_Gulf View condominiums
mean_sale_price_GV <- 454.24
sd_sale_price_GV <- 192.55
LLimit_sale_price_GV <- mean_sale_price_GV - 1.96*sd_sale_price_GV
HLimit_sale_price_GV <- mean_sale_price_GV + 1.96*sd_sale_price_GV
LLimit_sale_price_GV
## [1] 76.842
HLimit_sale_price_GV
## [1] 831.638
#Problem 4b - population mean the number of days to sell _Gulf View condominiums
library(readxl)
GulfPropData <- read_excel("/Users/fangyi/Desktop/GulfPropData.xlsx",range = "A2:F42")
GulfPropData
## # A tibble: 40 × 6
##    List_Price_GV Sale_Price_GV Days_to_Sell_GV List_Price_No_GV Sale_Price_No_GV
##            <dbl>         <dbl>           <dbl>            <dbl>            <dbl>
##  1          495           475              130             217              217 
##  2          379           350               71             148              136.
##  3          529           519               85             186.             179 
##  4          552.          534.              95             239              230 
##  5          335.          335.             119             279              268.
##  6          550           505               92             215              214 
##  7          170.          165              197             279              259 
##  8          210           210               56             180.             176.
##  9          975           945               73             150.             145.
## 10          314           314              126             235              230 
## # ℹ 30 more rows
## # ℹ 1 more variable: Days_to_Sell_No_GV <dbl>
t.test(GulfPropData$Days_to_Sell_GV)
## 
##  One Sample t-test
## 
## data:  GulfPropData$Days_to_Sell_GV
## t = 12.839, df = 39, p-value = 1.386e-15
## alternative hypothesis: true mean is not equal to 0
## 95 percent confidence interval:
##   89.30051 122.69949
## sample estimates:
## mean of x 
##       106

For the population mean sales price of condominiums with Gulf View: the lower bound of the confidence interval is $76.842, and the upper bound is $831.638.That is to say, we are 95% confident that the true population mean sales price these condominiums falls somewhere between $76.842 and $831.638.

For the population mean days to sell of condominiums with Gulf View: the lower bound of the confidence interval is 89.30 days, and the upper bound is 122.70 days. We are 95% confident that the true population mean days to sell of condominiums with Gulf View is between 89.30 and 122.70 days.

Problem 5

#Problem 5a - population mean sales price_ Without Gulf View
mean_sale_price_No_GV <- 203.19
sd_sale_price_No_GV <- 43.89
LLimit_sale_price_No_GV <- mean_sale_price_No_GV - 1.96*sd_sale_price_No_GV
HLimit_sale_price_No_GV <- mean_sale_price_No_GV + 1.96*sd_sale_price_No_GV
LLimit_sale_price_No_GV
## [1] 117.1656
HLimit_sale_price_No_GV
## [1] 289.2144
#Problem 5b - population mean the number of days to sell _ Without Gulf View condominiums
library(readxl)
GulfPropData <- read_excel("/Users/fangyi/Desktop/GulfPropData.xlsx",range = "A2:F42")
GulfPropData
## # A tibble: 40 × 6
##    List_Price_GV Sale_Price_GV Days_to_Sell_GV List_Price_No_GV Sale_Price_No_GV
##            <dbl>         <dbl>           <dbl>            <dbl>            <dbl>
##  1          495           475              130             217              217 
##  2          379           350               71             148              136.
##  3          529           519               85             186.             179 
##  4          552.          534.              95             239              230 
##  5          335.          335.             119             279              268.
##  6          550           505               92             215              214 
##  7          170.          165              197             279              259 
##  8          210           210               56             180.             176.
##  9          975           945               73             150.             145.
## 10          314           314              126             235              230 
## # ℹ 30 more rows
## # ℹ 1 more variable: Days_to_Sell_No_GV <dbl>
t.test(GulfPropData$Days_to_Sell_No_GV)
## 
##  One Sample t-test
## 
## data:  GulfPropData$Days_to_Sell_No_GV
## t = 7.5067, df = 17, p-value = 8.587e-07
## alternative hypothesis: true mean is not equal to 0
## 95 percent confidence interval:
##   97.05704 172.94296
## sample estimates:
## mean of x 
##       135

For the population mean sales price of condominiums without Gulf View: the lower bound of the confidence interval is $117.166, and the upper bound is $289.214.That is to say, we are 95% confident that the true population mean sales price these condominiums falls somewhere between $117.166 and $289.214.

For the population mean days to sell of condominiums without Gulf View: the lower bound of the confidence interval is 97.06 days, and the upper bound is 172.94 days. We are 95% confident that the true population mean days to sell of condominiums without Gulf View is between 97.06 and 172.94 days.