Elina Azrilyan

November 6th, 2019

The data

Let’s load the dataset which includes some statistics about temperature and humidity on certain dates.

MyData <- read.csv(file="temperatures.csv", header=TRUE, sep=",")

Scatterplot can be used to display the relationship between these 2 variables.

plot(MyData$humid ~ MyData$temp, main = "Temp vs Humidity", xlab = "Temperature", ylab = "Humidity")

library(statsr)
## Loading required package: BayesFactor
## Loading required package: coda
## Warning: package 'coda' was built under R version 3.5.2
## Loading required package: Matrix
## ************
## Welcome to BayesFactor 0.9.12-4.2. If you have questions, please contact Richard Morey (richarddmorey@gmail.com).
## 
## Type BFManual() to open the manual.
## ************
plot_ss(x = humid, temp, MyData)

## Click two points to make a line.
                                
## Call:
## lm(formula = y ~ x, data = pts)
## 
## Coefficients:
## (Intercept)            x  
##    60.06111      0.04256  
## 
## Sum of Squares:  2532314

The linear model

m1 <- lm(humid ~ temp, data = MyData)
summary(m1)
## 
## Call:
## lm(formula = humid ~ temp, data = MyData)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -50.852 -15.201  -0.842  15.148  40.687 
## 
## Coefficients:
##             Estimate Std. Error t value Pr(>|t|)    
## (Intercept)  52.2463     0.7685   67.98   <2e-16 ***
## temp          0.1640     0.0121   13.55   <2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 19.33 on 26112 degrees of freedom
##   (1 observation deleted due to missingness)
## Multiple R-squared:  0.006978,   Adjusted R-squared:  0.00694 
## F-statistic: 183.5 on 1 and 26112 DF,  p-value: < 2.2e-16