Chapter 9 Regression
9.1 Seminar
In this section, we will cover regression models. We will first introduce the bivariate linear regression model. We will then move to linear models with multiple independent variables. Next, we discuss counfounders as threats to our inference. Finally, we will introduce the logistic regression model.
First, however, we install a new pacakge called texreg
which makes it easy to produce publication quality output from our regression models. We’ll discuss this package in more detail as we go along. For now let’s install the package with the install.packages("texreg")
function and then load it using library(texreg)
.
We will use a dataset collected by the US census bureau that contains several socioeconomic indicators.
The dataset includes 38 variables but we’re only interested in a handful at the moment.
| Variable | Description |
|---|---|
| PctUnemployed | proportion of citizens in each community who are unemployed |
| PctNotHSGrad | proportion of citizens in each community who failed to finish high-school |
| population | proportion of adult population living in cities |
PctUnemployed PctNotHSGrad population
1 0.27 0.18 0.19
2 0.27 0.24 0.00
3 0.36 0.43 0.00
4 0.33 0.25 0.04
5 0.12 0.30 0.01
6 0.10 0.12 0.02
If we summarize these variables with the summary()
function, we will see that they are both measured as proportions (they vary between 0 and 1):
Min. 1st Qu. Median Mean 3rd Qu. Max.
0.0000 0.2200 0.3200 0.3635 0.4800 1.0000
Min. 1st Qu. Median Mean 3rd Qu. Max.
0.0000 0.2300 0.3600 0.3833 0.5100 1.0000
It will be a little easier to interpret the regression output if we convert these to percentages rather than proportions. We can do this with the following lines of code:
communities$PctUnemployed <- communities$PctUnemployed * 100
communities$PctNotHSGrad <- communities$PctNotHSGrad * 100
We can begin by drawing a scatterplot with the percentage of unemployed people on the y-axis and the percentage of adults without high-school education on the x-axis.
plot(
x = communities$PctNotHSGrad,
y = communities$PctUnemployed,
xlab = "Adults without high school education (%)",
ylab = "Unemployment (%)",
frame.plot = FALSE,
pch = 20,
col = "LightSkyBlue"
)
From looking at the plot, what is the association between the unemployment rate and lack of high-school level education?
In order to answer that question empirically, we will run a linear regression using the lm()
function in R. The lm()
function needs to know a) the relationship we’re trying to model and b) the dataset for our observations. The two arguments we need to provide to the lm()
function are described below.
| Argument | Description |
|---|---|
formula |
The formula describes the relationship between the dependent and independent variables, for example dependent.variable ~ independent.variable In our case, we’d like to model the relationship using the formula: PctUnemployed ~ PctNotHSGrad |
data |
This is simply the name of the dataset that contains the variable of interest. In our case, this is the merged dataset called communities . |
For more information on how the lm()
function works, type help(lm) in R.
9.1.1 Interpreting Regression Output
The lm()
function has modeled the relationship between PctUnemployed
and PctNotHSGrad
and we’ve saved it in an object called model1
. Let’s use the summary()
function to see what this linear model looks like.
The output from summary()
might seem overwhelming at first so let’s break it down one item at a time.
| # | Item | Description |
|---|---|---|
| 1 | formula | The formula describes the relationship between the dependent and independent variables |
| 2 | residuals | The differences between the observed values and the predicted values are called residuals. |
| 3 | coefficients | The coefficients for all the independent variables and the intercept. Using the coefficients we can write down the relationship between the dependent and the independent variables as: PctUnemployed = 7.8952023 + ( 0.7423853 * PctNotHSGrad ) This tells us that for each unit increase in the variable PctNotHSGrad , the PctUnemployed increases by 0.7423853. |
| 4 | standard error | The standard error estimates the standard deviation of the sampling distribution of the coefficients in our model. We can think of the standard error as the measure of precision for the estimated coefficients. |
| 5 | t-statistic | The t-statistic is obtained by dividing the coefficients by the standard error. |
| 6 | p-value | The p-value for each of the coefficients in the model. Recall that according to the null hypotheses, the value of the coefficient of interest is zero. The p-value tells us whether can can reject the null hypotheses or not. |
| 7 | \(R^2\) and adj-\(R^2\) | tell us how much of the variance in our model is accounted for by the independent variable. The adjusted \(R^2\) is always smaller than \(R^2\) as it takes into account the number of independent variables and degrees of freedom. |
Now let’s add a regression line to the scatter plot using the abline()
function.
First we run the same plot()
function as before, then we overlay a line with abline()
:
plot(
x = communities$PctNotHSGrad,
y = communities$PctUnemployed,
xlab = "Adults without high school education (%)",
ylab = "Unemployment (%)",
frame.plot = FALSE,
pch = 20,
col = "LightSkyBlue"
)
abline(model1, lwd = 3, col = "red")
We can see by looking at the regression line that it matches the coefficients we estimated above. For example, when PctNotHSGrad
is equal to zero (i.e. where the line intersects the Y-axis), the predicted value for PctUnemployed
seems to be above 0 but below 10. This is good, as the intercept coefficient we estimated in the regression was 7.8952023.
Similarly, the coefficient for the variable PctNotHSGrad
was estimated to be 0.7423853, which implies that a one point increase in the percentage of citizens with no high-school education is associated with about 0.7423853 of a point increase in the percentage of citizens who are unemployed. The line in the plot seems to reflect this: it is upward sloping, so that higher levels of the no high-school variable are associated with higher levels of unemployment, but the relationship is not quite 1-to-1. That is, for each additional percentage point of citzens without high school education, the percentage of citizens who are unemployed increases by a little less than one point.
While the summary()
function provides a slew of information about a fitted regression model, we often need to present our findings in easy to read tables similar to what you see in journal publications. The texreg
package we loaded earlier allows us to do just that.
Let’s take a look at how to display the output of a regression model on the screen using the screenreg()
function from texreg
.
=========================
Model 1
-------------------------
(Intercept) 7.90 ***
(0.65)
PctNotHSGrad 0.74 ***
(0.01)
-------------------------
R^2 0.55
Adj. R^2 0.55
Num. obs. 1994
RMSE 13.52
=========================
*** p < 0.001, ** p < 0.01, * p < 0.05
Here, the output includes some of the most salient details we need for interpretation. We can see the coefficient for the PctNotHSGrad
variable, and the estimated coefficient for the intercept. Below these numbers, in brackets, we can see the standard errors. The table also reports the \(R^2\), the adjusted \(R^2\), the number of observations (\(n\)) and the root-mean-squared-error (\(RMSE\)).
One thing to note is that the table does not include either t-statistics or p-values for the estimated coefficents. Instead, the table employs a common device of using stars to denote whether a variable is statistically significant at a given alpha level.
***
indicates that the coefficient is significant at the 99.9% confidence level (alpha = 0.001)**
indicates that the coefficient is significant at the 99% confidence level (alpha = 0.01)*
indicates that the coefficient is significant at the 95% confidence level (alpha = 0.05)
Returning to our example, are there other variables that might affect the unemployment rate in our dataset? For example, is the unemployment rate higher in rural areas? To answer this question, we can swap PctNotHSGrad
for a different independent variable. Let’s use the variable population
, which measures the proportion of adults who live in cities (rather than rural areas). Again, we can transform this proportion to a percentage with the following code:
Let’s fit a linear model using population
as the independent variable:
Call:
lm(formula = PctUnemployed ~ population, data = communities)
Residuals:
Min 1Q Median 3Q Max
-35.252 -14.715 -3.946 11.054 64.980
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 35.02042 0.49206 71.171 < 2e-16 ***
population 0.23139 0.03532 6.552 7.2e-11 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 20.01 on 1992 degrees of freedom
Multiple R-squared: 0.0211, Adjusted R-squared: 0.02061
F-statistic: 42.93 on 1 and 1992 DF, p-value: 7.201e-11
We can show regression line from the model2
just like we did with our first model.
plot(
x = communities$population,
y = communities$PctUnemployed,
xlab = "Adults living in cities (%)",
ylab = "Unemployment (%)",
frame.plot = FALSE,
pch = 20,
col = "LightSkyBlue"
)
abline(model2, lwd = 2, col = "red")
So we now have two models! Often, we will want to compare two estimated models side-by-side. We might want to say how the coefficients for the independent variables we included differ in model1
and model2
, for example. Or we may want to ask: Does model2
offer a better fit than model1
?
It is often useful to print the salient details from the estimated models side-by-side. We can do this by using the screenreg()
function.
======================================
Model 1 Model 2
--------------------------------------
(Intercept) 7.90 *** 35.02 ***
(0.65) (0.49)
PctNotHSGrad 0.74 ***
(0.01)
population 0.23 ***
(0.04)
--------------------------------------
R^2 0.55 0.02
Adj. R^2 0.55 0.02
Num. obs. 1994 1994
RMSE 13.52 20.01
======================================
*** p < 0.001, ** p < 0.01, * p < 0.05
What does this table tell us?
- The first column replicates the results from our first model. We can see that a one point increase in the percentage of citizens without high-school education is associated with an increase of 0.7423853 percentage points of unemployment, on average.
- The second column gives us the results from the second model. Here, a one point increase in the percentage of citizens who live in cities is associated with an increase of 0.2313906 percentage points of unemployment, on average
- We can also compare the \(R^2\) values from the two models. The \(R^2\) for
model1
is 0.5529732 and formodel2
is 0.0210968. This suggests that the model withPctNotHSGrad
as the explanatory variable explains about 55.2973193% of the variation in unemployment. The model withpopulation
as the explanatory variable, on the other hand, explains just 2.1096753% of the variation in unemployment.
Finally, and this is something that might help with your coursework, let’s save the same output as a Microsoft Word document using htmlreg()
.
If you’re using a Mac, you might want to save the file as .html
if the Word document isn’t formatted correctly.
9.1.2 Fitted values
Once we have estimated a regression model, we can use that model to produce fitted values. Fitted values represent our “best guess” for the value of our dependent variable for a specific value of our independent variable.
Let’s calculate the fitted values manually and then we’ll show you how to do it in R. The fitted value formula is:
\[\hat{Y}_{i} = \hat{\beta}_0 + \hat{\beta}_1 * X_i\]
Let’s say that, on the basis of model1
we would like to know what the unemployment rate is likely to be for a community where the percentage of adults without a high-school education is equal to 10%. We can substitute in the relevant coefficients from model1
and the value for our X variable (10
in this case), and we get:
\[\hat{Y}_{i} = 7.9 + 0.74 * 10 = 15.3\]
To calculate fitted values in R, we use the predict()
function.
The predict function takes two main arguments.
| Argument | Description |
|---|---|
object |
The object is the model object that we would like to use to produce fitted values. Here, we would like to base the analysis on model1 and so specify object = model1 here. |
newdata |
This is an optional argument which we use to specify the values of our independent variable(s) that we would like fitted values for. If we leave this argument empty, R will automatically calculate fitted values for all of the observations in the data that we used to estimate the original model. If we include this argument, we need to provide a data.frame which has a variable with the same name as the independent variable in our model. Here, we specify newdata = data.frame(PctNotHSGrad = 10) , as we would like the fitted value for a community where 10% of adults did not complete high-school. |
1
15.31906
This is the same as the result we obtained when we calculated the fitted value manually. The good thing about the predict()
function, however, is that we will be able to use it for all the models we study on this course, and it can be useful for calculating many different fitted values.
9.1.3 Additional Resources
9.1.4 Multiple linear regression models
we load the full standard (cross-sectional) dataset from the Quality of Government Institute (this is a newer version that the one we used earlier). This is a great data source for comparativist research. The codebook is available from their main website. You can also find time-series and cross-section data sets on this page.
The dataset is in csv format (.csv
). Loading it requires the read.csv()
function. Let’s load the data set.
Check the dimensions of the dataset
[1] 193 2037
The dataset contains 2037 variables but we’re only interested in the following:
| Variable | Description |
|---|---|
| wbgi_pse | A measure of political stability (larger values mean more stability) |
| lp_lat_abst | Distance to the equator or latitude |
| dr_ing | Index for the level of globalization |
| ti_cpi | Transparency International’s Corruptions Perceptions Index (larger values mean better quality institutions, i.e. less corruption) |
| br_dem | Factor variable stating whether the country is a democracy or not (with labels 1. Democracy and 0. Dictatorship ) |
Our dependent variable (also called response or outcome variable) is wbgi_pse
. We will rename the variables we care about to something meaningful.
CAUTION: When renaming variables, do not use spaces or special characters in the name. You can, however, use a period (.
) or underscore (_
) to make the names more readable.
names(world_data)[names(world_data) == "cname"] <- "country"
names(world_data)[names(world_data) == "wbgi_pse"] <- "pol_stability"
names(world_data)[names(world_data) == "lp_lat_abst"] <- "latitude"
names(world_data)[names(world_data) == "dr_ig"] <- "globalization"
names(world_data)[names(world_data) == "chga_demo"] <- "democracy"
names(world_data)[names(world_data) == "ti_cpi"] <- "inst_quality"
Now Let’s look at some of these variables using the summary()
function.
Min. 1st Qu. Median Mean 3rd Qu. Max.
-3.10637 -0.72686 -0.01900 -0.06079 0.78486 1.57240
If you think about political stability, and how one could measure it, you know there is an order implicit in the measurement – more or less stability. From there, what you need to know is whether the more or less is ordinal or interval scaled. Checking pol_stability
you see a range from roughly -3 to 1.6. The variable is numerical and has decimal places. This tells you that the variable is at least interval scaled. You will not see ordinally scaled variables with decimal places. Examine the summaries of the other variables and determine their level of measurement.
Now let’s look at the variables that we think can explain political stability. We can use the summary()
function on more than one variable by combining their names in a vector.
latitude globalization inst_quality democracy
Min. :0.0000 Min. :24.35 Min. :1.010 Length:193
1st Qu.:0.1444 1st Qu.:45.22 1st Qu.:2.400 Class :character
Median :0.2444 Median :54.99 Median :3.300 Mode :character
Mean :0.2865 Mean :57.15 Mean :3.988
3rd Qu.:0.4444 3rd Qu.:68.34 3rd Qu.:5.100
Max. :0.7222 Max. :92.30 Max. :9.300
NA's :12 NA's :12 NA's :12
The variables latitude
, globalization
and inst_quality
have 12 missing values each marked as NA
. democracy
has 1 missing value. Missing values could cause trouble because operations including an NA
will produce NA
as a result (e.g.: 1 + NA = NA
). We will drop these missing values from our data set using the is.na()
function and square brackets. The exlamation mark in front of is.na()
means “not”. So, we keep all rows that are not NA’s on the variable latitude
.
Generally, we want to make sure we drop missing values only from variables that we care about. Now that you have seen how to do this, drop missings from globalization
, inst_quality
, and democracy
yourself.
world_data <- world_data[ !is.na(world_data$globalization), ]
world_data <- world_data[ !is.na(world_data$inst_quality), ]
world_data <- world_data[ !is.na(world_data$democracy), ]
Let’s check the range of the variable latitude
from our summary above. It is between 0
and 1
. The codebook clarifies that the latitude of a country’s capital has been divided by 90
to get a variable that ranges from 0
to 1
. This would make interpretation difficult. When interpreting the effect of such a variable a unit change (a change of 1
) covers the entire range or put differently, it is a change from a country at the equator to a country at one of the poles.
We therefore multiply by 90
again. This will turn the units of the latitude
variable into degrees again which makes interpretation easier.
9.1.5 Estimating a Bivariate Regression
Is there a correlation between the distance of a country to the equator and the level of political stability? Both political stability (dependent variable) and distance to the equator (independent variable) are continuous. Therefore, we will get an idea about the relationship using a scatter plot.
plot(x = world_data$latitude,
y = world_data$pol_stability,
frame.plot = FALSE,
pch = 20,
xlab = "Latitude",
ylab = "Political Stability")
Looking at the cloud of points suggests that there might be a positive relationship: increases in our independent variable latitude
appear to be associated with increases in the dependent variable pol_stability
(the further from the equator, the more stable).
We can fit a line of best fit through the points. To do this we must estimate the bivariate regression model with the lm()
function.
Now we can create a scatterplot with a regression line using the abline()
function.
plot(x = world_data$latitude,
y = world_data$pol_stability,
frame.plot = FALSE,
pch = 20,
xlab = "Latitude",
ylab = "Political Stability")
abline(latitude_model, col = "red")
We can also view a simple summary of the regression by using the screenreg
function:
=======================
Model 1
-----------------------
(Intercept) -0.58 ***
(0.12)
latitude 0.02 ***
(0.00)
-----------------------
R^2 0.11
Adj. R^2 0.10
Num. obs. 170
RMSE 0.89
=======================
*** p < 0.001, ** p < 0.01, * p < 0.05
Thinking back to earlier today, how do we interpret this regression?
- The coefficient for the variable
latitude
(\(\beta_1\)) indicates that a one-unit increase in a country’s latitude is associated with a 0.0178378 increase in the measure of political stability, on average. Question: Is this association statistically significant at the 95% confidence level? - The coefficient for the
(intercept)
term (\(\beta_0\)) indicates that the average level of political stability for a country with a latitude of 0 is -0.580075 (wherelatitude = 0
is a country positioned at the equator) - The \(R^2\) of the model is 0.1065267. This implies that 11% of the variation in the dependent variable (political stability) is explained by the independent variable (latitude) in the model.
The regression above suggests that there is a significant association between these variables However, as good social scientistis, we probably do not think that the distance of a country from the equator is a theoretically relevant variable for explaining political stability. This is because there is no plausible causal link between the two. We should therefore consider other variables to include in our model.
We will include the index of globalization (higher values mean more integration with the rest of the world), the quality of institutions, and the indicator for whether the country is a democracy. For all of these variables we can come up with a theoretical story for their effect on political stability.
To specify a multiple linear regression model, the only thing we need to change is the formula
argument of the lm()
function. In particular, if we wish to add additional explanatory variables, the formula argument will take the following form:
In our example here, the model would therefore look like the following:
inst_model <- lm(
pol_stability ~ latitude + globalization + inst_quality + democracy,
data = world_data
)
Remember, pol_stability
is our dependent variable, as before, and now we have four independent variables: latitude
, globalization
, democracy
and inst_quality
. Again, just as with the bivariate model, we can view the summarised output of the regression by using screenreg()
. As we now have two models (a simple regression model, and a multiple regression model), we can join them together using the list()
function, and then put all of that inside screenreg()
.
=============================================
Model 1 Model 2
---------------------------------------------
(Intercept) -0.58 *** -1.25 ***
(0.12) (0.20)
latitude 0.02 *** 0.00
(0.00) (0.00)
globalization -0.00
(0.01)
inst_quality 0.34 ***
(0.04)
democracy1. Democracy 0.04
(0.11)
---------------------------------------------
R^2 0.11 0.50
Adj. R^2 0.10 0.49
Num. obs. 170 170
RMSE 0.89 0.67
=============================================
*** p < 0.001, ** p < 0.01, * p < 0.05
Including the two new predictors leads to substantial changes.
- First, we now explain 50% of the variance of our dependent variable instead of just 11%.
- Second, the effect of the distance to the equator is no longer significant.
- Third, better quality institutions are associated with more political stability. In particular, a one-unit increase in the measure of instituion quality (which ranges from 1 to 10) is associated with a 0.338882 increase in the measure for political stability.
- Fourth, there is no significant relationship between globalization and political stability in this data.
- Fifth, there is no significant relationship between democracy and political stability in this data.
### Predicting outcome conditional on institutional quality
Just as we did with the simple regression model last week, we can use the fitted model object to calculate the fitted values of our dependent variable for different values of our explanatory variables. To do so, we again use the predict()
function.
We proceed in three steps.
- We set the values of the covariates for which we would like to produce fitted values.
- You will need to set covariate values for every explanatory variable that you included in your model.
- As only one of our variables has a significant relationship with the outcome in the multiple regression model that we estimated above, we are really only interested in that variable (
inst_quality
). - Therefore, we will calculate fitted values over the range of
inst_quality
, while setting the values oflatitude
andglobalization
to their mean values. - As
democracy
is a factor variable, we cannot use the mean value. Instead, we will setdemocracy
to be equal to"1. Democracy"
which is the label for democratic countries
- We calculate the fitted values.
- We report the results (here we will produce a plot).
For step one, the following code produces a data.frame
of new covariate values for which we would like to calculate a fitted value from our model:
democracies <- data.frame(
inst_quality = seq(from = 1.4, to = 9.3, by = 1),
globalization = mean(world_data$globalization),
latitude = mean(world_data$latitude),
democracy = "1. Democracy"
)
We’ve just created a data.frame
of hypothetical democracies with varying level of institutional quality. Let’s see what this data.frame
looks like.
inst_quality globalization latitude democracy
1 1.4 57.93053 25.78218 1. Democracy
2 2.4 57.93053 25.78218 1. Democracy
3 3.4 57.93053 25.78218 1. Democracy
4 4.4 57.93053 25.78218 1. Democracy
5 5.4 57.93053 25.78218 1. Democracy
6 6.4 57.93053 25.78218 1. Democracy
7 7.4 57.93053 25.78218 1. Democracy
8 8.4 57.93053 25.78218 1. Democracy
In this data.frame
, we have set the inst_quality
variable to vary between 1.4 and 9.3000002, with increments of 1 unit which represents the range of inst_quality
in our dataset.
[1] 1.4
[1] 9.3
We have set globalization
to be equal to the mean value of globalization
in the world_data
object, and latitude
to be equal to the mean value of latitude
in the world_data
object. Finally, we have set democracy
to be equal to "1. Democracy"
(the value for democratic countries).
We can now calculate the fitted values for each of these combinations of our explanatory variables using the predict()
function.
We can now look again at the democracies
object:
inst_quality globalization latitude democracy predicted_pol_stability
1 1.4 57.93053 25.78218 1. Democracy -1.00319887
2 2.4 57.93053 25.78218 1. Democracy -0.66431685
3 3.4 57.93053 25.78218 1. Democracy -0.32543483
4 4.4 57.93053 25.78218 1. Democracy 0.01344719
5 5.4 57.93053 25.78218 1. Democracy 0.35232921
6 6.4 57.93053 25.78218 1. Democracy 0.69121123
7 7.4 57.93053 25.78218 1. Democracy 1.03009325
8 8.4 57.93053 25.78218 1. Democracy 1.36897527
Hey presto! Now, for each of our explanatory variable combinations, we have the corresponding fitted values as calculated from our estimated regression.
Finally, we can plot these values:
plot(
x = democracies$inst_quality,
y = democracies$predicted_pol_stability,
frame.plot = FALSE,
col = "blue",
type = "l",
xlab = "Institution Quality",
ylab = "Fitted value for political stability"
)
We could also use the output from our model to plot two separate lines of fitted values: one for democracies, and one for dictatorships. We have already done this for democracies, so the following code constructs a data.frame
of fitted values for dictatorships:
dictatorships <- data.frame(
inst_quality = seq(from = 1.4, to = 9.3, by = 1),
globalization = mean(world_data$globalization),
latitude = mean(world_data$latitude),
democracy = "0. Dictatorship"
)
dictatorships$predicted_pol_stability <- predict(inst_model, newdata = dictatorships)
Now that we have calculated these fitted values, we can add the line for dictatorships to the plot we created above using the lines()
function:
plot(
x = democracies$inst_quality,
y = democracies$predicted_pol_stability,
frame.plot = FALSE,
col = "blue",
type = "l",
xlab = "Institution Quality",
ylab = "Fitted value for political stability"
)
lines(x = dictatorships$inst_quality,
y = dictatorships$predicted_pol_stability,
data = dictatorships,
col = "red")
Warning in plot.xy(xy.coords(x, y), type = type, ...): "data" is not a
graphical parameter
We can see from the plot that the fitted values for democracies (blue line) are almost exactly the same as those for dictatorships (red line). This is reassuring, as the estimated coefficient on the democracy variable was very small (0.04) and was not statistically significantly different from 0. Often, however, it can be very illuminating to construct plots like this where we construct a line to indicate how our predicted values for Y vary across one of our explanatory variables (here, institution quality), and we create different lines for different values of another explanatory variable (here, democracy/dictatorship).
9.1.6 Non-Linearities
Let’s clear our workspace for now to keep the workspace tidy and to prevent our computer from slowing down.
We will use the small version of the Quality of Government data from 2012 again (QoG2012.csv
) with four variables:
| Variable | Description |
|---|---|
former_col |
0 = not a former colony 1 = former colony |
undp_hdi |
UNDP Human Development Index. Higher values mean better quality of life |
wbgi_cce |
Control of corruption. Higher values mean better control of corruption |
wdi_gdpc |
GDP per capita in US dollars |
[1] "h_j" "wdi_gdpc" "undp_hdi" "wbgi_cce" "wbgi_pse"
[6] "former_col" "lp_lat_abst"
Rename the variables by yourself to:
| New Name | Old Name |
|---|---|
human_development |
undp_hdi |
institutions_quality |
wbgi_cce |
gdp_capita |
wdi_gdpc |
[1] "h_j" "wdi_gdpc" "undp_hdi" "wbgi_cce" "wbgi_pse"
[6] "former_col" "lp_lat_abst"
names(world_data)[names(world_data)=="undp_hdi"] <- "human_development"
names(world_data)[names(world_data)=="wbgi_cce"] <- "institutions_quality"
names(world_data)[names(world_data)=="wdi_gdpc"] <- "gdp_capita"
names(world_data)
[1] "h_j" "gdp_capita" "human_development"
[4] "institutions_quality" "wbgi_pse" "former_col"
[7] "lp_lat_abst"
Now let’s look at the summary statistics for the entire data set.
h_j gdp_capita human_development institutions_quality
Min. :0.0000 Min. : 226.2 Min. :0.2730 Min. :-1.69953
1st Qu.:0.0000 1st Qu.: 1768.0 1st Qu.:0.5390 1st Qu.:-0.81965
Median :0.0000 Median : 5326.1 Median :0.7510 Median :-0.30476
Mean :0.3787 Mean :10184.1 Mean :0.6982 Mean :-0.05072
3rd Qu.:1.0000 3rd Qu.:12976.5 3rd Qu.:0.8335 3rd Qu.: 0.50649
Max. :1.0000 Max. :63686.7 Max. :0.9560 Max. : 2.44565
NA's :25 NA's :16 NA's :19 NA's :2
wbgi_pse former_col lp_lat_abst
Min. :-2.46746 Min. :0.0000 Min. :0.0000
1st Qu.:-0.72900 1st Qu.:0.0000 1st Qu.:0.1343
Median : 0.02772 Median :1.0000 Median :0.2444
Mean :-0.03957 Mean :0.6289 Mean :0.2829
3rd Qu.: 0.79847 3rd Qu.:1.0000 3rd Qu.:0.4444
Max. : 1.67561 Max. :1.0000 Max. :0.7222
NA's :7
We need to remove missing values from gdp_capita
, human_development
, and institutions_quality
. Do so yourself. Do not drop observations that missing values on other observations such as lp_lat_abst
. We might throw away useful information when doing so.
world_data <- world_data[ !is.na(world_data$gdp_capita), ]
world_data <- world_data[ !is.na(world_data$human_development), ]
world_data <- world_data[ !is.na(world_data$institutions_quality), ]
Let’s suppose we want to illustrate the relationship between GDP per capita and the human development index. We draw a scatter plot to investigate the relationship between the quality of life (hdi) and wealth (gdp/captia).
plot(
x = world_data$gdp_capita,
y = world_data$human_development,
data = world_data,
pch = 20,
frame.plot = FALSE,
col = "grey",
main = "Relationship between the quality of life and wealth",
ylab = "Human development index",
xlab = "GDP per capita"
)
Warning in plot.window(...): "data" is not a graphical parameter
Warning in plot.xy(xy, type, ...): "data" is not a graphical parameter
Warning in axis(side = side, at = at, labels = labels, ...): "data" is not
a graphical parameter
Warning in axis(side = side, at = at, labels = labels, ...): "data" is not
a graphical parameter
Warning in title(...): "data" is not a graphical parameter
It’s easy to see, that the relationship between GDP per captia and the Human Development Index is not linear. Increases in wealth rapidly increase the quality of life in poor societies. The richer the country, the less pronounced the effect of additional wealth. We would mis-specify our model if we do not take the non-linear relationship into account.
 The effect may look small because the coefficient rounded to two digits is zero. But remember, this is the effect of increasing GDP/capita by \(1\) US dollar on the quality of life. That effect is naturally small but it is probably not small when we increase wealth by \(1000\) US dollars.
However, our model would also entail that for every increase in GDP/capita, the quality of life increases on average by the same amount. We saw from our plot that this is not the case. The effect of GDP/capita on the quality of life is conditional on the level of GDP/capita. If that sounds like an interaction to you, then that is great because, we will model the non-linearity by raising the GDP/capita to a higher power. That is in effect an interaction of the variable with itself. GDP/capita raised to the second power, e.g. is GDP/capita * GDP/capita.
<IP_ADDRESS> Polynomials
We know from school that polynomials like \(X^2\), \(X^3\) and so on are not linear. The relationship depicted in our plot above suggests a quadratic relationship between GDP per capita and the human development index might be appropriate (there is only one obvious “bend” in the data). To incorporate this intuition into our model, we will use the poly()
function in our linear model to raise GDP/capita to the second power like so: poly(gdp_capita, degree = 2).
quadratic.model <- lm(
human_development ~ poly(gdp_capita, degree = 2),
data = world_data
)
screenreg(
list(linear.model, quadratic.model),
custom.model.names = c("Linear model", "Quadratic model")
)
============================================================
Linear model Quadratic model
------------------------------------------------------------
(Intercept) 0.59 *** 0.70 ***
(0.01) (0.01)
gdp_capita 0.00 ***
(0.00)
poly(gdp_capita, degree = 2)1 1.66 ***
(0.10)
poly(gdp_capita, degree = 2)2 -1.00 ***
(0.10)
------------------------------------------------------------
R^2 0.49 0.67
Adj. R^2 0.49 0.66
Num. obs. 172 172
RMSE 0.13 0.10
============================================================
*** p < 0.001, ** p < 0.01, * p < 0.05
It is important to note, that in the quadratic model the effect of GDP/capita is no longer easy to interpret. We cannot say for every increase in GDP/capita by one dollar, the quality of life increases on average by some fixed amount. This is because the effect of GDP/capita depends on how rich a country was to begin with. We can, however, interpret the statitical significance of the quadratic term: the coefficient is about 10 times as large in absolute terms as the standard error, meaning we can easily reject the null hypothesis that the relationship between GDP and the HDI is linear. Furthermore, it looks like our model that includes the quadratic term has a much better fit, as the adjusted \(R^2\) has increased by a lot.
We can interpret the effect of wealth (GDP/capita) on the quality of life (human development index) by predicting the fitted values of the human development index given a certain level of GDP/capita. We will vary GDP/captia from its minimum in the data to its maximum and the plot the results which is a good way to illustrate a non-linear relationship.
Step 1: We find the minimum and maximum values of GDP/capita.
[1]<PHONE_NUMBER>6.676
Step 2: We predict fitted values for varying levels of GDP/captia (let’s create 100 predictions).
We create our sequence of 100 GDP/capita values
We set our covariate values (here we only have one covariate: GDP/captia)
We predict the outcome (human development index) for each of the 100 GDP levels
Step 3: Now that we have created our predictions. We plot again and then we add the linear.model
using abline
and we add our non-linear version quadratic.model
using the lines()
function.
plot(
x = world_data$gdp_capita,
y = world_data$human_development,
data = world_data,
pch = 20,
frame.plot = FALSE,
col = "grey",
main = "Relationship between the quality of life and wealth",
ylab = "Human development index",
xlab = "GDP per capita"
)
Warning in plot.window(...): "data" is not a graphical parameter
Warning in plot.xy(xy, type, ...): "data" is not a graphical parameter
Warning in axis(side = side, at = at, labels = labels, ...): "data" is not
a graphical parameter
Warning in axis(side = side, at = at, labels = labels, ...): "data" is not
a graphical parameter
Warning in title(...): "data" is not a graphical parameter
# the linear model
abline(linear.model, col = "black")
# better model
lines(x = gdp_seq, y = y_hat, col = "red")
We could go further than this quadratic specification, and instead estimate a cubic.model
with GDP/capita raised to the power of three. Do this now and present your results visually.
Estimate cubic model
We predict the outcome (human development index) for each of the 100 GDP levels
Next, we plot the linear and quadratic models
plot(
x = world_data$gdp_capita,
y = world_data$human_development,
data = world_data,
pch = 20,
frame.plot = FALSE,
col = "grey",
main = "Relationship between the quality of life and wealth",
ylab = "Human development index",
xlab = "GDP per capita"
)
Warning in plot.window(...): "data" is not a graphical parameter
Warning in plot.xy(xy, type, ...): "data" is not a graphical parameter
Warning in axis(side = side, at = at, labels = labels, ...): "data" is not
a graphical parameter
Warning in axis(side = side, at = at, labels = labels, ...): "data" is not
a graphical parameter
Warning in title(...): "data" is not a graphical parameter
# the linear model
abline(linear.model, col = "black")
# quadratic model
lines(x = gdp_seq, y = y_hat, col = "red")
# cubic model
lines(x = gdp_seq, y = y_hat2, col = "green")
The cubic model provides a similar story to the quadratic model (the relationship between GDP/capita and HDI is steep at first, and then flatter at the higher levels of GDP/captia), but it looks somewhat strange, particularly at the higher levels of GDP/capita. In particular, it seems that the few extreme X values are causing a strange shape: the cubic is being wagged around by its tail. This is a common problem with polynomial regression models, and so we will now consider an alternative.
<IP_ADDRESS> Log-transformations
Many non-linear relationships actually do look linear on the log scale. We can illustrate this by taking the natural logarithm of GDP/captia and plot the relationship between quality of life and our transformed GDP variable.
Note: Some of you will remember from your school calculators that you have an ln button and a log button where ln takes the natural logarithm and log takes the logarithm with base 10. The natural logarithm represents relations that occur frequently in the world and R takes the natural logarithm with the log()
function by default.
Below, we plot the same plot from before but we wrap gdp_capita
in the log()
function which log-transforms the variable.
plot(
x = log(world_data$gdp_capita),
y = world_data$human_development,
data = world_data,
pch = 20,
frame.plot = FALSE,
col = "grey",
main = "Relationship between the quality of life and wealth on the log scale",
ylab = "Human development index",
xlab = "Logged gdp/capita"
)
Warning in plot.window(...): "data" is not a graphical parameter
Warning in plot.xy(xy, type, ...): "data" is not a graphical parameter
Warning in axis(side = side, at = at, labels = labels, ...): "data" is not
a graphical parameter
Warning in axis(side = side, at = at, labels = labels, ...): "data" is not
a graphical parameter
Warning in title(...): "data" is not a graphical parameter
As you can see, the relationship now looks much closer to linear and we get the best fit to the data (as measured by adjusted \(R^2\)) if we run our model with log-transformed gdp.
Let’s check our model
screenreg(
list(linear.model, quadratic.model, cubic.model, log.model),
custom.model.names = c("Linear Model", "Quadratic Model", "Cubic Model", "Log Model")
)
=====================================================================================
Linear Model Quadratic Model Cubic Model Log Model
-------------------------------------------------------------------------------------
(Intercept) 0.59 *** 0.70 *** 0.70 *** -0.36 ***
(0.01) (0.01) (0.01) (0.04)
gdp_capita 0.00 ***
(0.00)
poly(gdp_capita, degree = 2)1 1.66 ***
(0.10)
poly(gdp_capita, degree = 2)2 -1.00 ***
(0.10)
poly(gdp_capita, 3)1 1.66 ***
(0.09)
poly(gdp_capita, 3)2 -1.00 ***
(0.09)
poly(gdp_capita, 3)3 0.65 ***
(0.09)
log(gdp_capita) 0.12 ***
(0.00)
-------------------------------------------------------------------------------------
R^2 0.49 0.67 0.74 0.81
Adj. R^2 0.49 0.66 0.74 0.81
Num. obs. 172 172 172 172
RMSE 0.13 0.10 0.09 0.08
=====================================================================================
*** p < 0.001, ** p < 0.01, * p < 0.05
Polynomials can be useful for modelling non-linearities. However, for each additional polynomial term we add, we also add an additional parameter that needs to be estimated. This reduces the degrees of freedom of the model. If we can get a linear relationship on the log scale, one advantage is that we use the same number of parameters as in the original linear model.
Furthermore, we gain interpretability. The relationship is linear on the log scale of gdp/capita. This means we can interpret the effect of gdp/captia as: For an increase of gdp/captia by one percent, the quality of life increases by \(\frac{\hat{\beta}}{100} = \frac{0.12}{100}\) points on average. The effect is very large because human_development
only varies from \(0\) to \(1\).
The adjusted \(R^2\) also suggests that the log model provides the best fit to the data. To illustrate that this is the case, we return to our plot and show the model fit graphically.
Get the fitted values for the log model.
Create a plot showing the fitted values
plot(
x = world_data$gdp_capita,
y = world_data$human_development,
data = world_data,
pch = 20,
frame.plot = FALSE,
col = "grey",
main = "Relationship between the quality of life and wealth",
ylab = "Human development index",
xlab = "GDP per capita"
)
Warning in plot.window(...): "data" is not a graphical parameter
Warning in plot.xy(xy, type, ...): "data" is not a graphical parameter
Warning in axis(side = side, at = at, labels = labels, ...): "data" is not
a graphical parameter
Warning in axis(side = side, at = at, labels = labels, ...): "data" is not
a graphical parameter
Warning in title(...): "data" is not a graphical parameter
# Linear model
abline(linear.model, col = "black")
# Quadratic model
lines(x = gdp_seq, y = y_hat, col = "red")
# Cubic model
lines(x = gdp_seq, y = y_hat2, col = "green")
# Log model
lines(x = gdp_seq, y = y_hat3, col = "blue")
# Add a legend
legend("bottomright",
legend = c("Linear", "Quadratic", "Cubic", "Log"),
lty = 1,
col = c("black", "red", "green", "blue")
)
The blue line shows the log-transformed model. It clearly fits the data best.


Steem Developer Portal
Estimate the value of an upvote
Calculate the approximate value of an upvote on Steem
By the end of this recipe you should know how to estimate value of each vote on Steem.
This recipe will take you through the process of fetching necessary data and formulating estimation.
Intro
Calculating value of each vote depends on multiple factors. Reward fund, recent claims, account’s total vests, rate of the sbd, voting power and weight of the vote. It is quite useful information for users to see and estimate. All of the data is possible to get via available APIs.
Steps
- Get Reward Fund Current reward fund information is crucial part of estimation
- Get Account Steem power and voting power is another important info
- Feed history To get price rate reported by witnesses
- Final calculation Formulate all information we have
1. Get Reward Fund
Getting Reward Fund information is simply calling get_reward_fund('post')
api call, it will give us reward_balance
and recent_claims
.
The response we’re working with will look like:
{
"id":0,
"name":"post",
"reward_balance":"741222.051 STEEM",
"recent_claims":"457419472820935017",
"last_update":"2018-05-23T12:08:36",
"content_constant":"2000000000000",
"percent_curation_rewards":2500,
"percent_content_rewards":10000,
"author_reward_curve":"linear",
"curation_reward_curve":"square_root"
}
2. Get Account
Next we will need total vests held by account, get_accounts
api call returns account data, which will hold vesting_shares
, received_vesting_shares
, delegated_vesting_shares
. It also returns current voting_power
information.
The response example will look like:
[
{
"id": 9660,
"name": "steemitblog",
"owner": {
"weight_threshold": 1,
"account_auths": [
[
"ned",
1
]
],
"key_auths": [
[
"STM65wH1LZ7BfSHcK69SShnqCAH5xdoSZpGkUjmzHJ5GCuxEK9V5G",
1
]
]
},
"active": {
"weight_threshold": 1,
"account_auths": [],
"key_auths": [
[
"STM65wH1LZ7BfSHcK69SShnqCAH5xdoSZpGkUjmzHJ5GCuxEK9V5G",
1
]
]
},
"posting": {
"weight_threshold": 1,
"account_auths": [
[
"ned",
1
]
],
"key_auths": [
[
"STM4yfYEjUoey4PLrKhnKFo1XKQZtZ77fWLnbGTr2mAUaSt2Sx9W4",
1
],
[
"STM5FeHFtL8J453DUi98LKwkqXBH5iwxf9xCqYs6QwPibPru3RNq3",
1
],
[
"STM5VwLXkNQf17sQ2XuxScdxruwBy1jak2mDxCjmyfYMNhm1WzPzN",
1
],
[
"STM5ke2kzgwBmysSqCNM6zRABi8SNpaJEtnFXuTtRcU3Uvf47481z",
1
]
]
},
"memo_key": "STM5FeHFtL8J453DUi98LKwkqXBH5iwxf9xCqYs6QwPibPru3RNq3",
"json_metadata": "",
"proxy": "",
"last_owner_update": "2017-03-17T18:19:18",
"last_account_update": "2017-03-17T18:19:18",
"created": "2016-05-24T18:54:24",
"mined": false,
"recovery_account": "steem",
"last_account_recovery": "2016-07-19T19:48:54",
"reset_account": "null",
"comment_count": 0,
"lifetime_vote_count": 0,
"post_count": 154,
"can_vote": true,
"voting_power": 9800,
"last_vote_time": "2018-05-22T20:10:45",
"balance": "810.371 STEEM",
"savings_balance": "0.000 STEEM",
"sbd_balance": "4613.426 SBD",
"sbd_seconds": "10828300402329",
"sbd_seconds_last_update": "2018-05-22T22:34:24",
"sbd_last_interest_payment": "2018-04-25T18:26:15",
"savings_sbd_balance": "0.000 SBD",
"savings_sbd_seconds": "0",
"savings_sbd_seconds_last_update": "1970-01-01T00:00:00",
"savings_sbd_last_interest_payment": "1970-01-01T00:00:00",
"savings_withdraw_requests": 0,
"reward_sbd_balance": "79.490 SBD",
"reward_steem_balance": "0.000 STEEM",
"reward_vesting_balance": "608341.169185 VESTS",
"reward_vesting_steem": "293.101 STEEM",
"vesting_shares": "93540695.469156 VESTS",
"delegated_vesting_shares": "0.000000 VESTS",
"received_vesting_shares": "0.000000 VESTS",
"vesting_withdraw_rate": "0.000000 VESTS",
"next_vesting_withdrawal": "1969-12-31T23:59:59",
"withdrawn": 0,
"to_withdraw": 0,
"withdraw_routes": 0,
"curation_rewards": 10288,
"posting_rewards": 38917298,
"proxied_vsf_votes": [
0,
0,
0,
0
],
"witnesses_voted_for": 0,
"last_post": "2018-05-22T18:59:33",
"last_root_post": "2018-05-22T18:59:33",
"average_bandwidth": "34722906781",
"lifetime_bandwidth": "656153000000",
"last_bandwidth_update": "2018-05-22T20:10:45",
"average_market_bandwidth":<PHONE_NUMBER>,
"lifetime_market_bandwidth":<PHONE_NUMBER>,
"last_market_bandwidth_update": "2016-07-27T15:10:09",
"vesting_balance": "0.000 STEEM",
"reputation": "146151592482665",
"transfer_history": [],
"market_history": [],
"post_history": [],
"vote_history": [],
"other_history": [],
"witness_votes": [],
"tags_usage": [],
"guest_bloggers": []
}
]
3. Feed history
Last thing we will need is rate of the get_current_median_history_price
, returns median price rate bucket with base
element.
The response example will look like:
{
"base": "3.029 SBD",
"quote": "1.000 STEEM"
}
4. Final calculation
After getting all these variables, all we have to do is to calculate estimation
total_vests = vesting_shares + received_vesting_shares - delegated_vesting_shares
final_vest = total_vests * 1e6
power = (voting_power * weight / 10000) / 50
rshares = power * final_vest / 10000
estimate = rshares / recent_claims * reward_balance * sbd_median_price
That’s all there is to it.


--- layout: page title: Master Thesis subtitle: Geometric Deep Learning for Computational Fluid Dynamics use-site-title: true --- This master thesis explores ways to apply geometric deep learning to the field of numerical simulations with an emphasis on the Navier-Stokes equations. With the recent success of Deep Learning, there should be room for experimentation also in the field of fluid simulations. Here we lead such an experiment. We propose an end-to-end differentiable architecture that allow object-to-mesh predictions of fluid simulations. We provide a comparison with a baseline and visual results on three different datasets: airfoils, backward-facing steps and winged-drones.
We desire to predict the fields around an object such as velocity and pressure given its mesh, and thus getting a direct relation between the mesh and the predicted fields.
Here such a model has been built, leveraging geometric deep learning, i.e. deep learning on irregular domains, on which standard convolutions would fail. As a proof-of-concept we will present here only the results around the backward-facing-step. The interested reader is invited to visit the thesis itself for more details and different setups.
The backward facing step is an important milestone in showing result in computational fluid dynamics as it has a simple geometry that hides a complex phenomena: the recirculation zone [see next paragraph]. Our model is able to predict the internal flow around the backward-facing-step as visually shown here below, with first prediction, the groundtruth and finally the absolute point-wise error. We emphatise that the prediction was made mesh-to-mesh, with as additional information the boundary conditions and properties of the flow (e.g. viscosity).
x-Velocity:
y-Velocity:
Pressure:
Once we got all x-velocity and y-velocity we wan also predict the recirculation zone behind the step, as we illustrate below. In the figure we show the simulation [left], and prediction [right].
As we see, the predicted solution (right) seems unfeasible with some streamlines seemingly exiting the side of the step... And indeed it is infeasible! This is because the conservation of mass has not been enforced by the model. To correct this behaviour, we can add a penalisation term in the loss of the network or iterate one through the domain to correct the conservation.
Of course, the same process can be repeated to other other fields that can be and other problems. Here below, we can see the turbulent viscosity on the airfoil dataset:
Application of such an application can range computer graphics to the automatic design of engineering shapes. However, one application that we is dear to me would be to combine this prediction to the more accurate numerical simulation. An example is to initialize an iterative solver with a corrected prediction, hence (hopefully) drastically decreasing the number of iterations necessary to reach convergence.
I hope to have captivated your attention and convinced you that there is
something here that could be used in the future.
Thesis available at: infoscience


A.
People can catch COVID-19 from others who have the virus. The disease can spread from person to
person through small droplets from the nose or mouth which are spread when a person with
COVID-19 coughs or exhales. These droplets land on objects and surfaces around the person. Other
people then catch COVID-19 by touching these objects or surfaces, then touching their eyes, nose
or mouth. People can also catch COVID-19 if they breathe in droplets from a person with COVID-19
who coughs out or exhales droplets. This is why it is important to stay more than 1 meter (3
feet) away from a person who is sick.
Q.
How likely am I to catch COVID-19?
A.
The risk depends on where you are - and more specifically, whether there is a COVID-19 outbreak
unfolding there.
For most people in most locations the risk of catching COVID-19 is still low. However, there are
now places around the world (cities or areas) where the disease is spreading. For people living
in, or visiting, these areas the risk of catching COVID-19 is higher. Governments and health
authorities are taking vigorous action every time a new case of COVID-19 is identified. Be sure
to comply with any local restrictions on travel, movement or large gatherings. Cooperating with
disease control efforts will reduce your risk of catching or spreading COVID-19.
COVID-19 outbreaks can be contained and transmission stopped, as has been shown in China and
some other countries. Unfortunately, new outbreaks can emerge rapidly. It’s important to be
aware of the situation where you are or intend to go. WHO publishes daily updates on the
COVID-19 situation worldwide.
Q.
Can the coronavirus disease spread through air?
A.
Airborne spread has not been reported for COVID-19 and it is not believed to be a major driver
of transmission based on available evidence.
Q.
Can you contract the coronavirus disease by touching a surface?
A.
People could catch COVID-19 by touching contaminated surfaces or objects – and then touching
their eyes, nose or mouth.
Q.
What should you do if you think you have the coronavirus disease?
A.
If you have fever, cough and difficulty breathing, seek medical care early. Stay home if you
feel unwell. If you have a fever, cough and difficulty breathing, seek medical attention and
call in advance. Follow the directions of your local health authority.
Q.
Is the coronavirus disease more severe than the flu?
A.
COVID-19 causes more severe disease than seasonal influenza.
While many people globally have built up immunity to seasonal flu strains, COVID-19 is a new
virus to which no one has immunity. That means more people are susceptible to infection, and
some will suffer severe disease.
Globally, about 3.4% of reported COVID-19 cases have died. By comparison, seasonal flu generally
kills far fewer than 1% of those infected.


Before Change
// pandas dataframe
X_mutable = X.copy()
means = np.zeros([grid_resolution for i in range(n_features)])
sds = np.zeros([grid_resolution for i in range(n_features)])
for i in range(grid_expanded.shape[0]):
new_row = grid_expanded[i]
row_id = id_grid_expanded[i]
for feature_idx, feature_id in enumerate(feature_ids):
X_mutable[feature_id] = new_row[feature_idx]
predictions = predict_fn(X_mutable.values)
mean_prediction = np.mean(predictions)
std_prediction = np.std(predictions)
means[row_id] = mean_prediction
sds[row_id] = std_prediction
pdp = {
"features": feature_ids,
"means": means,
"sds": sds,
"vals": grid_expanded
}
return pdp
def partial_dependency_sklearn(self):
pass
After Change
pdp = {}
new_row = grid_expanded[i]
row_id = id_grid_expanded[i]
row_id = tuple(row_id.tolist())
for feature_idx, feature_id in enumerate(feature_ids):
X_mutable[feature_id] = new_row[feature_idx]
predictions = predict_fn(X_mutable.values)


Draw on the map or use the filters below.
© LISC Chicago and DataMade
Hosted by Smart Chicago Collaborative
You need to give me something to work with
Before I can generate a report, I need you to specify what you want me to report on by drawing a shape on the map.
×At least one of your dates isn’t formatted correctly. The date fields down at the bottom of the map expect dates formatted like this: YYYY-MM-DD
×It looks like the time of day range that you specified has a start time that occurs after the end time. Please correct this and try again.
×Before we can run your query, you’ll need to make sure to draw a shape on the map using the tools on the left-hand side.
×


Welcome To Poppie's Ronnies Prizza
"Are you prepared for the best pie you've had in your life?""
Start Order
---please select a size for your pizza---
Large (16")
Extra Large (19")
Family Reunion (24")
Extra Cheese
Pepperoni
Sausage
Ham
Bellpeppers
Onions
Mushrooms
Checkout
Please review your order:


|
Task 3:
Add a floor plan for the new floor and add devices to the floor plan
a. Upload a floor plan image (name: "floor_plan_for_test.png")
b. Add a dishwasher and a coffee machine to the floor plan and drag them to the kitchen area in the floor plan
c. Add an air conditioner to the floor plan and drag it to the living room area in the floor plan
d. Drag the circles around the device images to adjust their size
P.S.: You have {{vm.timeLimit}} seconds for this task.
|
Time left for this task:
|
|
|
|
||
|
|


- Preface: About BioBike
- The BioBike Vision
- The BioLingua paper in Bioinformatics
- The concept of a Knowledge Operating System
- The KnowOS paper in ILC2005
- A brief history of BioBike
- Organization of the documentation
- Introductory Materials
- How to interact with the listener
- An example session
- BioLisp basics
- Why Lisp?
- BioLisp v. Common Lisp and how to learn Common Lisp
- Intro to BioLisp
- Introduction to frames
- How to get help
- Basic iteration using xloop
- Techniques for program development and debugging
- Manipulating tables and graphs and simple plotting
- Built-in genomes and knowledge bases
- Organisms and their frame networks
- The Gene Onology (GO)
- KEGG
- Interacting with external programs
- ClustalW: Seqeunce alignment
- Blast: Sequence comparison
- Phylip: Phylogenetic trees
- ...
- Interacting with external knowledge bases
- Google
- PubMed
- Advanced Techniques
- Collaboration and code-sharing techniques
- Defining your own Functions and Protocols
- Table Reading Tools
- Creating and Clustering by CrossMetrics
- BioBike Knowledge Bases: Procedures and Info
- Simple Microarray Data Clustering
- How to handle timeouts, batch and multiple-processes
- CL-PPCRE - portable Perl-compatible regular expressions for Common Lisp
- Using Web Widgets
- Generalized Arrays -- a tool to combine and extend Lisp arrays
and Lisp hash tables.
- Advanced Examples
- Simulation of a part of the regulatory network that generates the cell cycle, based upon a PNAS paper by Li et al. (live)
- Pathway logic I: Dynamic creation of metabolic pathways (live)
- Gene Ontology I: Simple GO tree walking.
- Gene Ontology II: Using the GO to guide data analysis.
- Gene Ontology III: Extracting and using process models from GO.
- Annotation I: Homology and Heuristics
- Pathway logic I: Dynamic creation of metabolic pathways
- Simple intelligent microarray interpretation
- AutoSynthesis: An Introduction to Model Discovery
- Model Discovery from Microarray Data
- Core documentation:
- BioBike Technical Overview
- How to...A basic manual/FAQ for system developers
- Startup and Initialization, File System Structure
- BioBike Knowledge Bases: Procedures and Info
- Organism Submission Format
- New Organism Submission Format
- How to Use the FASTA indexer
- How to create libraries
- Notes on being an organism curator
- Installation Procedures for BioBike
- Notes on process priority algorithm for weblistener threads
- Documentation on how to install, run, and
interface to programs like BLAST, MEME, etc.


WeeWikiPaint
WeeWikiPaint is the web's premier collaborative painting site. At least, it could be. Right now, it's just a neat little doodling tool. Try it below.
You can watch this site be developed! This project is part of James Shore's Let's Code: Test-Driven JavaScript screencast, a series focused on rigorous, professional JavaScript development. Join us!


--- title: One time at D&D camp… layout: post ---
Damn, this sounds awesome! Where was this when I was at Ship?


Welcome! It looks like you need to set things up for your new device.
First, let's set up a user account for you.
Already have an account? Sign in
First name is required.
Last name is required.
Email address is required.
Email address is invalid.
Username is required.
Password is required.
{{passwordError}}
Passwords must be at least 6 characters and include either a number or special character. Passwords are case sensitive.
Enter the password again to verify.
Passwords do not match.


| DOSE: |
14 mg |
smoked |
5-MeO-DMT |
(powder / crystals) |
Set and setting for this solo journey included a carefully prepared, quiet apartment, low light, half and hour of yoga prior to the experience. Several very positive experiences with mimo-huasca during the previous months.
In anticipation of this, my fourth experience with 5-MEO-DMT, I had headphones ready and the climax of Morning Dew cued up from Winterland '74. Though this seemed an amusingly juvenile stunt, or possibly as pointless as a candle in the sun, it turned out to be very interesting, though not quite in the way I anticipated.
One huge hit over oregano and ash. Onset in 5 seconds building to peak intensity in 20 seconds. Barely had time to get the headhones on and the pipe down. The music had hardly progressed half a bar when it started sounding so weird I swiped the headphones off and flopped backwards on the bed.  This turned out to be the perfect intensity level to color the experience.
I was blasted into an impersonal realm. No matter how many times you do this with DMT freebase nothing can prepare you for the speed of the change. No more self, no more time or space, all subsumed in raw energy transformations. Then at intervals, it felt as it a clay metal stick of molten musical wire were twisitng in the pineal region generating the most excruciating textures of 'consciousness' - not even 'consciousness' actually - simply energy - beyond pleasure or pain - pure Godstuff - the very nectar of nervous recomplication. As described by some one else aptly : reality became a universal puzzlebox; a rapidly stacking and folding of energetic textures.
At one point I became aware that the whispering crecendoes of Morning Dew were guiding the direction of the energetic stacking though I was not following the music in any sort of normal way. The guitar was the only really audible feature and it seemed to speed up and slow down, riding at the core of some sort of glandualr nectar crystal that felt like having a tooth pulled and a genital orgasm at the same time.
I could not see for probably two or three minutes, then when I could, chose to keep eyes closed as the entire visual field was turbulent as whitewater. Optic nerves stimulated to an overwhelming degree - far beyond pleasant eye-candy patterns.
I had an inkling of a thought at some point that there was no possible way I'd ever be my normal self again in my normal life - that I'd shattered the very fabric of time-space or gone insane at the very least. I've had this feeling on high-dose mushrooms and ayahuasca also, and it seems fairly common in MEO and N,N-DMT experiences. It is state-specific, and no amount of experience seems to keep it form of occuring for some people. The 'Oh no - I've really done it this time..' kind of thing.
I sit up at probably six minutes, and have a moment of panic. this is too much!  The subjective effect is still similar to the peak of an acid experience in 700+ mics range. I begin comming a bit unravelled as it seemed a really long time had passed. I focus on the breath - deep, full breaths. This helps alot (as always!)
At approx 7 miutes I'm guessing, the optic disturbances (eyes opened or closed) are still extreme. I sit up in the bed and then jelly to my feet, then realize I am already reintegrating. No longer so overwhelmed, but still churning through molten godspace. Fractal instances of every object and texture peeling into the air and flying chaotically every which way, I sit on the floor and grab my bare feet, eyes wide.
The visual disturbances rapidly subside as I stare at my hands and feet and breathe deeply. Then progresses ten minutes of total Self-Realization and explosion of ecstatic love and recognition as condensed and complete and cathartic as anything I have ever previously experineced with enthogens. It was a beautiful beautiful few minutes - a truly lucid psychedelic epiphany.
I recognized my feet in my hands anew as the hands and feet of Adam (so to speak) - the only Being there is, extant, eternal, uncreated, uncontrollable, all powerful, all terrible, all loving and incarnate, mysterious to its very self, and yete utterly familiar, and eternally tender though all experience that ever can be.
I recognized this body, this ego, as a texture of form and taken by God as grace, beyond intention, timeless, and ultimately mysterious, a ritual unfolding which gives meaning and structure to the excruciata of barely differentiated energy my humbled organism had been just a few minutes before.
In this joyous recognition, looking out of my eyes into the mirror of the world, I cried out finally in joy. Joy that the world exists in such a finely tuned and mysterious condition, filled with the primal inspiration of creation recognizing and being humbled in the face of itself. A new inspiration to live as an exquisite expression of the terrible wonderful reality of exitence.
Though this all sounds almost comically revelatory, it boils down to a spiritual rebirth- a reintegration with the unity of cosmic will.
As my human self reintegrated out of the undifferentiated excruciata of impersonal energy, I passed briefly though a period of what I can only refer to as 'optimal' nervous system activation - that is, a state not altered, but rather *utterly lucid in mind, relaxed in body, nourished in spirit* - a state that somehow feels the way humans should always feel. It was similar to a post-orgasmic state, but after a uh..much larger orgasm than I have found possible via sex. This was baseline from which I wished to decend no further, indeed from which it seemsed unnatural to decend.
This 'optimal state' *felt* intuively, the way the humnan organism is designed to operate. I felt this on mimosa-hoasca also for similarly short (5-10 min) periods of time. It is not a 'high-on-drugs' kind of state - certainly nothing as chemical as MDMA or methamphetamine, low dose acid or mushrooms. It felt like something glandular was turned on that was usually off - a natural part of the brain's functioning.
I feel even these rather violent entheogens have tremendous value (for some) as they turn on the nectar of consciousness like a switch. We can learn form it and steer by in other modalities of experience - yogas, mediations, dance, music, etc. But this is the theme of another story.
With 5-MeO-DMT, as with other high-dose entheogens, the sense that there is some omega event that all this psychedelic bending of space-time is leading up to was very strong and familiar - this experience has been recurrent for me. I've felt like I was getting a 'sneak peek' at something off in the possibly near future. For me, in the past, this feeling has been patently millenial. Patently McKennean.
Investing too much stock in the literality of this sort of intuition easily escalates into an unpleasant exercise in delusion and paranoia. It used to scare the hell out of me, but this MeO experience shed some new light. The event is I'm feeling in the future is a return to God, the at Atman, the Self, the whole Enchilada - I don't know how else to say it. To attempt verbal details would diminish what I mean. I have more peace around this feeling now, where before there was often anxiety.
Two days after the experience, I feel very little need to return to the MEO space, or any chemically-induced entheogenic space in the near future. There are no more direct routes to the kinds of spaces offered by this and similar sacrements, but there are FAR more gentle ways to nurture the spirit! This one is DEFINATELY NOT for everyone - it is NOT recreational, in my opinion. It can offer, like all entheogens, a terrifying look under the hood, so to speak. If you're not prepared, it could be WAY more than you bargained for.
A full dose of 5-MEO-DMT will be challenging for anyone to integrate. I've tripped hundreds of times over many years with many different materials, and this one had me really spun. Be careful, respect yourself and others.
If you do decide to try it - take care with your set and the setting and ESPECIALLLY the dosage. Most people don't have access to an analytical balance capable of measuring <10mg effectively. The difference between 5mg and 10mg can be EXTREME even though it only looks like a couple grains of salt.>
Wisdom and Respect!
Experience Reports are the writings and opinions of the individual authors who submit them.
Some of the activities described are dangerous and/or illegal and none are recommended by Erowid.


| DOSE: |
825 mg |
oral |
DXM |
(liquid) |
Late on a Sunday evening I drank one 12-oz bottle of generic Tussin DM -- about 700mg. After a couple of hours the effects weren't strong enough for my liking, so I took a couple of swigs from a bottle of Robo MS. I figure I took somewhere between 800 and 850mg in all. But this isn't about the trip -- it's about what happened afterwards.
 They were actually swollen half-shut. And when I woke up the next day, my eyelids were still very puffy. The swelling was especially bad near the inner corners, giving the curious illusion of an epicanthic fold. Cold compresses didn't help. My eyelids stayed swollen for three days. My family started remarking on it. My mother, in particular, was excessively worried, and wanted to take me to a doctor.
I also noticed that I had gained several pounds since Sunday, which makes me think I was retaining water throughout my whole body. I didn't look or feel bloated, though I did find myself urinating less often. On Wednesday morning my period started. So PMS was probably the main cause of the water retention. But I am quite certain that taking dex made it worse. Anyway, as Wednesday progressed the swelling slowly went down. I tried a cold compress again in the evening, and this time it returned my eyes almost to normal.
This wasn't a terribly serious problem and it won't dissuade me from continuing to do DXM, but it was disturbing and unattractive, and I want others to know that it is a potential after-effect of the drug.
Experience Reports are the writings and opinions of the individual authors who submit them.
Some of the activities described are dangerous and/or illegal and none are recommended by Erowid.


Full Stack Web Developer leveraging a background in leadership roles, customer service, and teaching. Recently received a Certificate in Web Development from University of Central Florida. Excellent interpersonal communication skills and collaborator who works well on team-based projects as well as independently. Recognized for proven complex problem-solving abilities to contribute effectively as a part of a fast-paced, quality-driven team.
I am proficient in HTML, CSS/Bootstrap, Node.js, and Web APIs. Currently trying to conquer React. I pride myself on digging deep to never give up on anything I start. I love being able to finish puzzles, and let's be honest this career is nothing but puzzles. I hope to one day create some amazing and helpful applications, as well as security programs. Being in this field not only keeps me on my toes, but I am able to fulfill the need to learn new things constantly.


--- layout: post title: Overwhelmed and Underperformance date: 2012-07-13 00:00:12.000000000 -07:00 type: post published: true status: publish categories: ---
I want to write, I want to work on a pet project or I want to read a book; but every night I struggle with having a lot to do and not knowing where to start.
I would like to share what I have stored:
Currently I have 10 drafts, dating back from January 16 of this year. My problem is that I get this output of thoughts on a certain subject and then from there I don't know how to polish it. Some of the topics I have drafted cover 3D Printing, rants, predictions and JavaScript. Hopefully every draft post will be finished and published soon.
A Cooking Book - I have some recipes that I have perfected with time that I would like pass on to my future children.
I'm working on an app for the Pebble Watch. I'm learning how to code C and Ruby On Rails, in case it needs a web companion for the data I plan to collect. I'm extremely excited to share this project once it's completed.
A new blog that me and Flavia are going to run. This one will be fun and helpful for a lot of people.
An iPhone app with Flavia. She has ideas for apps that target a niché market. I need to learn Objective C and iOS development.
In theory, I want to create a nightly calendar on what to do but I have unsuccessfully follow it, mostly by not having the drive to work on the scheduled task. To do it I have to force myself, possibly keep track of my completed tasks.


/**
* Copyright 2017 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
**/
const fse = require('fs-extra');
const ol = require('common-tags').oneLine;
const askQuestions = require('./questions/ask-questions');
const logger = require('./logger');
module.exports = async () => {
const {configLocation, config} = await askQuestions();
const contents = `module.exports = ${JSON.stringify(config, null, 2)};`;
await fse.writeFile(configLocation, contents);
logger.log(`To build your service worker, run
workbox generateSW ${configLocation}
as part of a build process. See https://goo.gl/8zZy1P for details.`);
logger.log(ol`You can further customize your service worker by making changes
to ${configLocation}. See https://goo.gl/YYPcyY for details.`);
};


| java.lang.Object | |
| ↳ | com.android.volley.toolbox.ImageLoader |
Helper that handles loading and caching images from remote URLs.
The simple way to use this class is to call get(String, ImageListener)
and to pass in the default image listener provided by
getImageListener(ImageView, int, int)
. Note that all function calls to
this class must be made from the main thead, and all responses will be delivered to the main
thread as well.
| Nested Classes | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| interface | ImageLoader.ImageCache | Simple cache adapter interface. | |||||||||
| class | ImageLoader.ImageContainer | Container object for all of the data surrounding an image request. | |||||||||
| interface | ImageLoader.ImageListener | Interface for the response handlers on image requests. |
| Public Constructors | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
|
ImageLoader(RequestQueue queue, ImageLoader.ImageCache imageCache)
Constructs a new ImageLoader.
|
| Public Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| ImageLoader.ImageContainer |
get(String requestUrl, ImageLoader.ImageListener imageListener, int maxWidth, int maxHeight, ImageView.ScaleType scaleType)
Issues a bitmap request with the given URL if that image is not available
in the cache, and returns a bitmap container that contains all of the data
relating to the request (as well as the default image if the requested
image is not available).
| ||||||||||
| ImageLoader.ImageContainer |
get(String requestUrl, ImageLoader.ImageListener imageListener, int maxWidth, int maxHeight)
Equivalent to calling
get(String, ImageListener, int, int, ScaleType) with
Scaletype == ScaleType.CENTER_INSIDE . | ||||||||||
| ImageLoader.ImageContainer |
get(String requestUrl, ImageLoader.ImageListener listener)
Returns an ImageContainer for the requested URL.
| ||||||||||
| static ImageLoader.ImageListener |
getImageListener(ImageView view, int defaultImageResId, int errorImageResId)
The default implementation of ImageListener which handles basic functionality
of showing a default image until the network response is received, at which point
it will switch to either the actual image or the error image.
| ||||||||||
| boolean |
isCached(String requestUrl, int maxWidth, int maxHeight)
Checks if the item is available in the cache.
| ||||||||||
| boolean |
isCached(String requestUrl, int maxWidth, int maxHeight, ImageView.ScaleType scaleType)
Checks if the item is available in the cache.
| ||||||||||
| void |
setBatchedResponseDelay(int newBatchedResponseDelayMs)
Sets the amount of time to wait after the first response arrives before delivering all
responses.
|
| Protected Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Request<Bitmap> | makeImageRequest(String requestUrl, int maxWidth, int maxHeight, ImageView.ScaleType scaleType, String cacheKey) | ||||||||||
| void |
onGetImageError(String cacheKey, VolleyError error)
Handler for when an image failed to load.
| ||||||||||
| void |
onGetImageSuccess(String cacheKey, Bitmap response)
Handler for when an image was successfully loaded.
|
|
[Expand]
Inherited Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
|
From class
java.lang.Object
|
Constructs a new ImageLoader.
| queue | The RequestQueue to use for making image requests. |
|---|---|
| imageCache | The cache to use as an L1 cache. |
Issues a bitmap request with the given URL if that image is not available in the cache, and returns a bitmap container that contains all of the data relating to the request (as well as the default image if the requested image is not available).
| requestUrl | The url of the remote image |
|---|---|
| imageListener | The listener to call when the remote image is loaded |
| maxWidth | The maximum width of the returned image. |
| maxHeight | The maximum height of the returned image. |
| scaleType | The ImageViews ScaleType used to calculate the needed image size. |
Equivalent to calling get(String, ImageListener, int, int, ScaleType)
with
Scaletype == ScaleType.CENTER_INSIDE
.
Returns an ImageContainer for the requested URL.
The ImageContainer will contain either the specified default bitmap or the loaded bitmap.
If the default was returned, the ImageLoader
will be invoked when the
request is fulfilled.
| requestUrl | The URL of the image to be loaded. |
|---|
The default implementation of ImageListener which handles basic functionality of showing a default image until the network response is received, at which point it will switch to either the actual image or the error image.
| view | The imageView that the listener is associated with. |
|---|---|
| defaultImageResId | Default image resource ID to use, or 0 if it doesn't exist. |
| errorImageResId | Error image resource ID to use, or 0 if it doesn't exist. |
Checks if the item is available in the cache.
| requestUrl | The url of the remote image |
|---|---|
| maxWidth | The maximum width of the returned image. |
| maxHeight | The maximum height of the returned image. |
Checks if the item is available in the cache.
| requestUrl | The url of the remote image |
|---|---|
| maxWidth | The maximum width of the returned image. |
| maxHeight | The maximum height of the returned image. |
| scaleType | The scaleType of the imageView. |
Sets the amount of time to wait after the first response arrives before delivering all responses. Batching can be disabled entirely by passing in 0.
| newBatchedResponseDelayMs | The time in milliseconds to wait. |
|---|
Handler for when an image failed to load.
| cacheKey | The cache key that is associated with the image request. |
|---|
Handler for when an image was successfully loaded.
| cacheKey | The cache key that is associated with the image request. |
|---|---|
| response | The bitmap that was returned from the network. |


2 references to AddToTypesXmlCache
System.Management.Automation (2)
engine\MshMemberInfo.cs (1)
4613
AddToTypesXmlCache
(member, preValidated);
engine\TypeTable.cs (1)
4080
.
AddToTypesXmlCache
(typeMemberAsMemberSetMember, false);


| ID | Formula | FW | DSSTox_CID | DSSTox_RID | DSSTox_GSID | DSSTox_FileID_Sort | TS_ChemName | TS_ChemName_Synonyms | TS_CASRN | CASRN_ChemName_Relationship | TS_Description | ChemNote | STRUCTURE_Shown | STRUCTURE_Formula | STRUCTURE_MW | STRUCTURE_ChemType | STRUCTURE_DefinedOrganicForm | STRUCTURE_IUPAC | STRUCTURE_SMILES | STRUCTURE_SMILES_Desalt | Substance_modify_yyyymmdd | |
| 223437-11-4 | 13041 | C11H20F6N2O4S2 | 422.4079 (142.2613+280.1467) | 27944 | 82696 | 47968 | 7373 | 1-Butyl-1-methylpyrrolidinium bis(trifluoromethanesulfonyl)imide | 223437-11-4 | primary | single chemical compound | ammonium; parent [223437-10-3] | tested chemical | C11H20F6N2O4S2 | 422.4079 | defined organic | salt | 1-butyl-1-methylpyrrolidinium bis[(trifluoromethyl)sulfonyl]azanide | CCCC[N+]1(C)CCCC1.FC(F)(F)S(=O)(=O)[N-]S(=O)(=O)C(F)(F)F | O=S(=O)(NS(=O)(=O)C(F)(F)F)C(F)(F)F | 20110418 |


The page cannot be found
The page you are looking for might have been removed, had its name changed, or is temporarily unavailable.
Return to home page


Testing jekyll
When you treat content as code, you get the opportunity to co-opt best-of-breed developer workflows, and continuous integration is no exception. We’ve all been there. You make a simple change and end up breaking two or three other things. Links get out of date. Images move. Imagine if every time you made a change, all those things that you consciously or subconsciously worry about were automatically checked. Are my links accurate? Did any of my images break? Does this darn thing actually render the way I want it to?
With CI services like Travis CI, whether public or private, adding continuous integration to a repository of prose content, whether an entire website or a collection of HTML or Markdown files becomes trivial, especially when you use open source tools like HTML Proofer.
Continuous integration (CI) is the idea that for every change, whether proposed or realized, a standard battery of tests run, to confirm the change does what you intend it to do. In most developer tools, like GitHub, you get instant feedback, in the form of a green light, to let you know that that is in fact the case, or a red light, in the event that something went awry, detailing exactly what doesn’t match you specified expectations.
With CI services like [Travis CI](https://travis-ci.org/), whether public or private, adding continuous integration to a repository of prose content, whether an entire website or a collection of HTML or Markdown files becomes trivial, especially when you use open source tools like [HTML Proofer](https://github.com/gjtorikian/html-proofer).
I really really love to hear from you
You want to say hello? Email me
If you enjoyed this post, please consider sharing it. comments powered by Disqus


Why I support Arsenal/Germany at international football
At work, we have been getting together to watch some of the Euro 2012 games. We have supporters for all countries (Dutch/England being the most popular). Surprisingly, I am the only Germany supporter and I was asked for reasons supporting Germany even though they are known to be pretty boring team (yes - the attacking and fluid game that we see started with WC 2006).
This started up a discussion among us that as a citizen of neutral country (or when football is not so developed), why we choose our club/country to support. Couple of reasons that stood out prominently:
The first major tournament that you watch - My first big tournament that I followed with understanding was World Cup 1990 and West Germany won the cup. Without satellite/cable TV, the only games I could watch was WC. 1994 came and Germany didn’t really do any good. But come 1996, it won the Euro Cup with a dramatic final where Bieroff scored two goals late. Starting then, I have always supported Germany - not because they played great football but because they won the tournaments when I started watching football.
In and around 2000, they started showing the big European league games and soon enough all games from EPL and Champions League. It just so happened that all the friends who would watch the games supported Man U and I was looking for a different team to bring in the spice. Not knowing anything or anybody, I randomly chose (or maybe not so random) Arsenal and have been Gunners fan ever since. With time, as I learnt more about the team and Arsene - the more I started liking them. It also helped that during those years, the team mesmerized the whole world with their invincible run of 49 games.
As an expat, you tend to have a soft spot for the first major country you live. E.g. one of my colleague spent some time in Spain and thus is die-hard Spain supporter.
 For me, English being almost first language, I tend to follow England league more then other. Thus I tend to support English clubs more often than not. A huge percentage of people I know in California support Barcelona/Real Madrid as Spanish being the most spoken language after English.
Last but not least, broadcasting rights of games that your national/satellite TV gets. I am pretty sure if they were Bundesliga instead of EPL in India, I would have probably picked up Stuttgart or Dortmund or Schalke as my favorite club.
What are your stories? Leave them in comments.
TL;DR: Your native language and first viewed big tournament shapes your supporting team/country.


Print canvass cards for your Wards
Hint: to print the map, select the maximise icon in the top right corner of the map. Move the map into a desirable position, then take a screenshot (press the "Print Screen" button on Windows or cmd shift 4 on Mac). Edit and print the resulting screenshot image with the software of your choice.
Print canvass cards for your Wards
You have selected the following constituency and ward.
| Street | Priority | Canvass Stats | Tools | |
|---|---|---|---|---|
|
|
{{street | streetSingleLineFilter}} | {{street.numCanvassed}} / {{street.numVoters}} ({{getRatioCanvassed(street.numCanvassed, street.numVoters)}}%) |


Home
|
About
|
Cakes
|
Contact
|
Cart
This is a birthday cake
Add to cart £14
This is a complex cake
Add to cart £24
This is a cupcake
Add to cart £34
This is a birthday cake
Add to cart £14
This is a complex cake
Add to cart £24
This is a cupcake
Add to cart £34
Image one
Image two
Image three
Previous
Next
Twitter
Facebook
Pinterest