I found a little game to test your skills about R programming. There are questions and time to answer. You can get some time when you get right to a question and lose (a lot of) time when you get false. Have a nice game!

## Regression: Formulas for coefficients

**Issue**

Understand how the formula for the coefficients in the simple linear regression.

**Model and Ordinary Least Square:**

The formula of the model describing the relationship between Population (explained variable) and the Size (explaining variable) of the kingdoms in Game of Thrones.

Sum of Squared Error (SSE):

Ordinary Least Square (OLS):

Ordinary Least Square (OLS):

Ordinary Least Square (OLS):

## Creation of the favicon

##### Favicon

I created a favicon for this website. It represents the star of the seven. It is the main religion the Westeros. Each branchs represent a god. We often see this symbol in the serie. Especially in the temple used for the religion: the sept (meaning seven in french strangely). The importance of the religion in the story get grower with the seasons… The free software Inskape was used to do it.

##### References

http://awoiaf.westeros.org/index.php/Great_Sept_of_Baelor

http://gameofthrones.wikia.com/wiki/Sept

## Assumptions for linear regression

This post is a reminder of the assumptions for the simple and multiple linear regression. I will use this post as a reference when i will work later on linear regression.

## Regression : region’s size and population in Game of Thrones (coefficients)

##### Issue

We want to understand the relationship between the population and the size of the kingdoms in Westeros. Indeed, the population size plays a role in the the size of each army.

Our model is: . In this post, we will detail the construction of the coefficients.

##### 1) Get the data

We do not know any references or “official” census (from GRRM) for the population of Game of Thrones. Consequently, we will go on several forum and watch what people say about the question of population. Finally, we chose data from the website Reddit, with the post from scolbert08 published in 2014. I got the data the size of the kingdoms too. I entered the data into an Excel spreadsheet manually, and then import it into R (the read.csv2 function is for the french format csv document, for english format, use the read.csv function). The document contains more data from other website, we just want to select the variables “Climate”, “Size2” and “Population7”.Only the nine first rows are selected because we do not have data for other regions. That’s why we do not have data for Essos region, the Wall and beyond the Wall. The row names are set with name of the kingdoms. We also rename the column names to drop the 7 and 2 from the names.

```
df<-read.csv2("H:/Travail/GoT/regression2.csv")
df2<-na.omit(df[,c(9,13,14)])
rownames(df2)<-df[1:9,1]
colnames(df2)<-c("Climate","Population","Size")
```

Continue reading “Regression : region’s size and population in Game of Thrones (coefficients)”

## Westeros / Essos map with R

**Issue**

Produce a map of the world of Game of thrones.

**1) Get the data**

Our matter was to get some data allowing us to draw a map. Finally, I found it with the format shp (meaning shapefile).