Date: November 23, 2014
[1] "kWh.HH.mo"
Min. 1st Qu. Median Mean 3rd Qu. Max.
253 281 310 341 386 461
[1] "L.LPG.HH.mo"
Min. 1st Qu. Median Mean 3rd Qu. Max.
18.8 30.7 42.5 47.0 61.2 79.8
data <- read.csv(file = "tbif.csv", header=TRUE);
library(datasets); require(stats); require(graphics);
data <-data[1:3,2:18];
pairs(data,panel = panel.smooth, main = "TBIF",pch=21,bg = c("red", "green", "blue"));
y<-data$Total.Commercial.industrial.intensity.MJ.
GDP.yr..end.use.;
plot(data$Electricity.EF..kg.CO2.eq.kWh.,
data$Total.Commercial.industrial.intensity.MJ
.GDP.yr..end.use.,bg = c("red", "green", "blue"),type="p",
col = "black", cex = 1.1, pch = 21,frame = FALSE, xlab="Electricity", ylab = "Total.Commercial.industrial.intensity")
abline(lm(Total.Commercia.industrial.intensity.MJ
.GDP.yr..end.use.~ Electricity.EF..kg.CO2.eq.kWh., data = data), col="red")
legend("right", c("Delhi","Mumbai","Chandigarh"), pch = 21,pt.bg=c("red","green","blue"),bg="white")
cor(data$Water..treated.water.WW..1000.liters.capita.yr.
, data$L.LPG.HH.mo)
[1] 0.9556
fit <- lm(Surface.travel.intensity..VKT.capita.day. ~ L.kerosene.HH.mo, data = data)
summary(fit)
Call:
lm(formula = Surface.travel.intensity..VKT.capita.day. ~ L.kerosene.HH.mo,
data = data)
Residuals:
1 2 3
0.0221 -0.0426 0.0205
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 28.0333 0.3402 82.4 0.0077 **
L.kerosene.HH.mo -2.0975 0.0329 -63.7 0.0100 **
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 0.0522 on 1 degrees of freedom
Multiple R-squared: 1, Adjusted R-squared: 1
F-statistic: 4.05e+03 on 1 and 1 DF, p-value: 0.01
coef(fit)
(Intercept) L.kerosene.HH.mo
28.033 -2.098
e <- resid(fit)
yhat <- predict(fit)
max(abs(e - (y - yhat)))
[1] 7.93
data<-read.csv(file = "multiplied_by_ef.csv", header=TRUE);
data <- data[1:3,2:8];
fit <- lm(Total.GHGs ~ . , data = data)
fit1 <- aov(Total.GHGs~kWh.HH.mo,data=data)
fit1
Call:
aov(formula = Total.GHGs ~ kWh.HH.mo, data = data)
Terms:
kWh.HH.mo Residuals
Sum of Squares 61422 736
Deg. of Freedom 1 1
Residual standard error: 27.12
Estimated effects may be unbalanced
fit1 <- lm(Total.GHGs~kWh.HH.mo,data=data)
fit1
Call:
lm(formula = Total.GHGs ~ kWh.HH.mo, data = data)
Coefficients:
(Intercept) kWh.HH.mo
-62.25 1.63
fit2 <- aov(Total.GHGs~kWh.HH.mo+L.LPG.HH.mo
,data=data)
fit2
Call:
aov(formula = Total.GHGs ~ kWh.HH.mo + L.LPG.HH.mo, data = data)
Terms:
kWh.HH.mo L.LPG.HH.mo
Sum of Squares 61422 736
Deg. of Freedom 1 1
Estimated effects may be unbalanced
fit2 <- update(fit, Total.GHGs~kWh.HH.mo+L.LPG.HH.mo)
fit3 <- update(fit, Total.GHGs~kWh.HH.mo+L.LPG.HH.mo
+L.kerosene.HH.mo)
fit4 <- update(fit, Total.GHGs~kWh.HH.mo+L.LPG.HH.mo
+L.kerosene.HH.mo+Industrial.process..t.waste.capita.yr.)
fit5 <- update(fit, Total.GHGs~kWh.HH.mo+L.LPG.HH.mo+
L.kerosene.HH.mo+Industrial.process..t.waste.capita.yr.+Air.Travel..L.jet.fuel.enplaned.passenger)
fit6 <- update(fit, Total.GHGs~kWh.HH.mo+L.LPG.HH.mo+
L.kerosene.HH.mo+Industrial.process..t.waste.capita.yr.+Air.Travel..L.jet.fuel.enplaned.passenger+Water..treated.water.WW..1000.liters.capita.yr.)
anova(fit,fit1,fit2,fit3,fit4,fit5,fit6)
Analysis of Variance Table
Model 1: Total.GHGs ~ kWh.HH.mo + L.LPG.HH.mo + L.kerosene.HH.mo + Industrial.process..t.waste.capita.yr. +
Air.Travel..L.jet.fuel.enplaned.passenger + Water..treated.water.WW..1000.liters.capita.yr.
Model 2: Total.GHGs ~ kWh.HH.mo
Model 3: Total.GHGs ~ kWh.HH.mo + L.LPG.HH.mo
Model 4: Total.GHGs ~ kWh.HH.mo + L.LPG.HH.mo + L.kerosene.HH.mo
Model 5: Total.GHGs ~ kWh.HH.mo + L.LPG.HH.mo + L.kerosene.HH.mo + Industrial.process..t.waste.capita.yr.
Model 6: Total.GHGs ~ kWh.HH.mo + L.LPG.HH.mo + L.kerosene.HH.mo + Industrial.process..t.waste.capita.yr. +
Air.Travel..L.jet.fuel.enplaned.passenger
Model 7: Total.GHGs ~ kWh.HH.mo + L.LPG.HH.mo + L.kerosene.HH.mo + Industrial.process..t.waste.capita.yr. +
Air.Travel..L.jet.fuel.enplaned.passenger + Water..treated.water.WW..1000.liters.capita.yr.
Res.Df RSS Df Sum of Sq F Pr(>F)
1 0 0
2 1 736 -1 -736
3 0 0 1 736
4 0 0 0 0
5 0 0 0 0
6 0 0 0 0
7 0 0 0 0
summary(fit2)
Call:
lm(formula = Total.GHGs ~ kWh.HH.mo + L.LPG.HH.mo, data = data)
Residuals:
ALL 3 residuals are 0: no residual degrees of freedom!
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) -83.49 NA NA NA
kWh.HH.mo 1.60 NA NA NA
L.LPG.HH.mo 0.63 NA NA NA
Residual standard error: NaN on 0 degrees of freedom
Multiple R-squared: 1, Adjusted R-squared: NaN
F-statistic: NaN on 2 and 0 DF, p-value: NA
Two-variable Regression - To find the amount of GHGs contribution of an unknown variable when its relationship with another parameter is known
Multi-Variate Regression - To find the overall GHG production of a city or state when various contributors to GHGs are known
We would like to thank Dr. B.R. Gurjar to give us and guide us in this project.
Thanks to Ajay Nagapure sir for his constatnt guidance by quick email replies
Working on this project to make a better and much more reliable model. Also, publishing research papers along the way.