Summary of Gas Price for January Observations
jan <- read.csv("January_Data.csv")
rid <- c(1,2,3)
jan <- jan[,-rid]
summary(jan$gasprice)
Min. 1st Qu. Median Mean 3rd Qu. Max.
0.018 65.000 92.000 121.009 128.000 4379.700
Simple linear Regresion on scaled gas price and past median
janscale <- scale(jan)
janscale <- as.data.frame(jan)
janmodel <- lm(jan$gasprice~jan$past_median)
summary(janmodel)
Call:
lm(formula = jan$gasprice ~ jan$past_median)
Residuals:
Min 1Q Median 3Q Max
-488.4 -25.5 -12.0 2.2 4220.9
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 19.66902 12.12200 1.623 0.105
jan$past_median 0.91288 0.09119 10.011 <2e-16 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 181 on 735 degrees of freedom
Multiple R-squared: 0.12, Adjusted R-squared: 0.1188
F-statistic: 100.2 on 1 and 735 DF, p-value: < 2.2e-16
Taking out all gas rice less than 1 gwei.
Assuming these low transactions are miner transactions
Percentage of data that was taken out.
jan2 <- which(jan$gasprice < 1)
jan2 <- jan[-jan2,]
jan2 <- scale(jan2)
jan2 <- as.data.frame(jan2)
sum(jan$gasprice < 1)/length(jan$gasprice) #percentage of data we took out
[1] 0.001356852
janmodel2 <- lm(jan2$gasprice~jan2$past_median)
Summary of Model with out bids less than one gwei
summary(janmodel2)
Call:
lm(formula = jan2$gasprice ~ jan2$past_median)
Residuals:
Min 1Q Median 3Q Max
-2.5320 -0.1330 -0.0630 0.0104 21.8758
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 6.203e-17 3.460e-02 0.00 1
jan2$past_median 3.465e-01 3.462e-02 10.01 <2e-16 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 0.9387 on 734 degrees of freedom
Multiple R-squared: 0.1201, Adjusted R-squared: 0.1189
F-statistic: 100.1 on 1 and 734 DF, p-value: < 2.2e-16
Taking out all bids over 700 Percentage of data taken out
jan3 <- which(jan$gasprice > 700)
jan3 <- jan[-jan3, ]
jan3 <- scale(jan3)
jan3 <- as.data.frame(jan3)
sum(jan$gasprice > 700)/length(jan$gasprice)
[1] 0.006784261
janmodel3 <- lm(jan3$gasprice~jan3$past_median)
Summary of model without bids less than one gwei and without bids over 700
summary(janmodel3)
Call:
lm(formula = jan3$gasprice ~ jan3$past_median)
Residuals:
Min 1Q Median 3Q Max
-5.8906 -0.2174 -0.0322 0.1633 5.3426
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) -1.987e-16 2.330e-02 0.00 1
jan3$past_median 7.767e-01 2.331e-02 33.31 <2e-16 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 0.6303 on 730 degrees of freedom
Multiple R-squared: 0.6032, Adjusted R-squared: 0.6027
F-statistic: 1110 on 1 and 730 DF, p-value: < 2.2e-16
Plot of the original data gas price vs. past median block
plot(janscale$gasprice, janscale$past_median)
Plot of gas price vs. past median block without fees under 1 and fees over 700
plot(jan3$gasprice, jan3$past_median)