By: Maria Isabel Olivera
While policymakers around the country argue over the validity of climate change, municipalities of varying sizes and wealth are attempting to promote sustainable practices within their communities. Policies which emphasis sustainability, however, are often time expensive, which creates challenges for smaller and less affluent municipalities. This paper aims to see if municipalities can encourage individual residents to adopt sustainable practices through less expensive policies which promote education.
I created my dataset by compiling data from various datasets available on Open Data NY. The dependent variable I have selected is the number of electric car owners in a county (ElectC), which is a countinuous variable. Using the zelig count model I first looked at the effects of county per capita income (Income) and population density (Pop) on the number of electric car owners in a county. Income is also a countinous variable in which income is measured by the 1,000’s while Pop is an ordinal variable in which “1” represents counties with less than 250,000 residents and “5” represents counties with over a million residents. The results of the estimation will serve as my baseline. I expect to see that wealthier and larger counties will have a greater number of electric cars.
Once establishing my baseline values, I will then add my “education” variables and run simulations to see how these variables influence electric car ownership in smaller and less affluent counties.The two educational variables I have selected are:
Edu = The percentage of county residents who are college graduates
FMarket = Number of Farmers Market in a county
Edu is a categorical variable in which counties were determined to have either “Low”, “Med”, or “High” education level determined by what percentage of residents had a college degree. Less than 20 percent was considered “Low” and more than 35 percent was considered “High”. Since education and income go hand in hand I’ve paired this variable with population instead and analyzed the different in electric car ownership amongst different sized county at different educational levels. The number of farmers markets in a county was considered an “educational” variable since farmers markets serve as centers of sustainable education. They provide information on sustainable agricultural practices and offer services such as local composting and textile recycling which may not be readily available in many counties. Farmers markets also have the added benefit that they are extremely affordable for municipalities to adopt and I therefore decided to pair this variable with income and measured the first differences at varying quantiles of income and markets.
library(Zelig)
NY_Climate1$Pop <- as.factor(NY_Climate1$Pop)
NY_Climate1$Edu <- as.factor(NY_Climate1$Edu)
z.es <- zelig(ElecC ~ Income + Pop, model = "poisson", data = NY_Climate1, cite = F)
summary(z.es)
Model:
Call:
z5$zelig(formula = ElecC ~ Income + Pop, data = NY_Climate1)
Deviance Residuals:
Min 1Q Median 3Q Max
-12.918 -5.563 -2.563 1.530 16.273
Coefficients:
Estimate Std. Error z value Pr(>|z|)
(Intercept) 3.4636702 0.0245372 141.16 <2e-16
Income 0.0083260 0.0003124 26.65 <2e-16
Pop2 1.7130944 0.0357485 47.92 <2e-16
Pop4 2.8413714 0.0318472 89.22 <2e-16
Pop5 3.1178336 0.0279206 111.67 <2e-16
(Dispersion parameter for poisson family taken to be 1)
Null deviance: 26715.2 on 61 degrees of freedom
Residual deviance: 2844.9 on 57 degrees of freedom
AIC: 3211.6
Number of Fisher Scoring iterations: 5
Next step: Use 'setx' method
i.range = min(NY_Climate1$Income):max(NY_Climate1$Income)
z.es$setrange(Income = i.range)
z.es$sim()
z.es$graph()
library(Zelig)
NY_Climate1$Pop <- as.factor(NY_Climate1$Pop)
NY_Climate1$Edu <- as.factor(NY_Climate1$Edu)
z.ep <-zelig(ElecC ~ Pop + Edu, model = "poisson", data = NY_Climate,cite = F)
z.ep$setx(Pop = "1")
z.ep$setx1(Pop = "5")
z.ep$sim()
plot(z.ep)
fd <- z.ep$get_qi(xvalue="x1", qi="fd")
summary(fd)
V1
Min. :764.7
1st Qu.:805.2
Median :814.4
Mean :814.7
3rd Qu.:824.2
Max. :861.3
As expected wealthier and larger counties are more likely to have higher rates of electric car ownership. There is a very strong positive correlation between income and electric car ownership. As the graph indicates, as income doubles, electric car ownership also nearly doubles. Considering the price difference between conventional cars and electric cars, this does not come as a surprise. With regards to population, we once again see a storng positive correlation with the simulation revealing a mean difference of over 800 electric cars between the lowest population level and the highest population level.
library(Zelig)
NY_Climate1$Pop <- as.factor(NY_Climate1$Pop)
NY_Climate1$Edu <- as.factor(NY_Climate1$Edu)
z.epl <-zelig(ElecC ~ Pop + Edu, model = "poisson", data = NY_Climate1, cite = F)
z.epl$setx(Pop = "1", Edu = "Low")
z.epl$setx1(Pop = "1", Edu = "High")
z.epl$sim()
fd <- z.epl$get_qi(xvalue="x1", qi="fd")
z.epm <-zelig(ElecC ~ Pop + Edu, model = "poisson", data = NY_Climate1,
cite = F)
z.epm$setx(Pop = "2", Edu = "Low")
z.epm$setx1(Pop = "2", Edu = "High")
z.epm$sim()
fd <- z.epm$get_qi(xvalue="x1", qi="fd")
z.eph <-zelig(ElecC ~ Pop + Edu, model = "poisson", data = NY_Climate,
cite = F)
z.eph$setx(Pop = "5", Edu = "Low")
z.eph$setx1(Pop = "5", Edu = "High")
z.eph$sim()
fd <- z.eph$get_qi(xvalue="x1", qi="fd")
d1 <- z.epl$get_qi(xvalue="x1", qi="fd")
d2 <- z.epm$get_qi(xvalue="x1", qi="fd")
d3 <- z.eph$get_qi(xvalue="x1", qi="fd")
dfd <- as.data.frame(cbind(d1, d2, d3))
head(dfd)
library(tidyr)
z.epa<- dfd %>%
gather(Edu, simv, 1:3)
library(dplyr)
z.epa %>%
group_by(Edu) %>%
summarise(mean = mean(simv), sd = sd(simv))
library(ggplot2)
ggplot(z.epa, aes(simv)) + geom_histogram() + facet_grid(~Edu)
The following simulations indicates that education has a significant effect on electric car ownership at all population levels. In Smaller communities with more highly educated residents the mean difference in car ownership is around 40. While this may seem unimpressive considering that some of NY state’s smaller counties have as little as 5,000 residents, this is a considerable difference. The significance of this difference is more clearly evident in the 3 plot graphs.
library(Zelig)
z.efl <- zelig(ElecC ~ Income + FMarket, model = "poisson", data = NY_Climate1, cite = F)
z.efl$setx(Income = quantile(NY_Climate1$Income, .25),
FMarket = quantile(NY_Climate1$FMarket, .25))
z.efl$setx1(Income = quantile(NY_Climate1$Income, .25),
FMarket = quantile(NY_Climate1$FMarket, .75))
z.efl$sim()
fd <- z.efl$get_qi(xvalue="x1", qi="fd")
z.efm <- zelig(ElecC ~ Income + FMarket, model = "poisson", data = NY_Climate1, cite = F)
z.efm$setx(Income = quantile(NY_Climate1$Income, .50),
FMarket = quantile(NY_Climate1$FMarket, .25))
z.efm$setx1(Income = quantile(NY_Climate1$Income, .50),
FMarket = quantile(NY_Climate1$FMarket, .75))
z.efm$sim()
fd <- z.efm$get_qi(xvalue="x1", qi="fd")
z.efh <- zelig(ElecC ~ Income + FMarket, model = "poisson", data = NY_Climate1, cite = F)
z.efh$setx(Income = quantile(NY_Climate1$Income, .75),
FMarket = quantile(NY_Climate1$FMarket, .25))
z.efh$setx1(Income = quantile(NY_Climate1$Income, .75),
FMarket = quantile(NY_Climate1$FMarket, .75))
z.efh$sim()
fd <- z.efh$get_qi(xvalue="x1", qi="fd")
f1 <- z.efl$get_qi(xvalue="x1", qi="fd")
f2 <- z.efm$get_qi(xvalue="x1", qi="fd")
f3 <- z.efh$get_qi(xvalue="x1", qi="fd")
ffd <- as.data.frame(cbind(f1, f2, f3))
head(ffd)
These plot graph clearly show the effect that farmers market have on car ownership levels in counties of varying income levels. While factoring in differences in the number of farmer’s markets in a county, the mean difference in car ownership levels in those counties who make up the lowest income quantile is slightly over 25. This compared to a mean difference of slightly over 28 in the highest income quantile. Considering the results of the first simulation which looked at the relationship between income and electric car ownership, the presence of farmers markets appears to encourage higher levels of car ownership in less affluent counties.
Farmers market and higher education are essential and effective tools at encouraging sustainable practices and behaviors in all communities regardless of size or wealth. Promoting these policies are within the fiscal means of even the least affluent of communities. Small investments in education can have a large impact on the sustainability of communities throught that state and country.