A demonstration of a Stereographic Cylindrical projection of Braun (x=cosφ0×λ; y=(1+cosφ0)×tan(φ/2), where λ is the longitude, φ is the latitude, φ0 is standard parallel) under various φ0.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
*************************************************************************************************** | |
/* Do file to check consistency of figures/statistics presented in Dupas & Robinson (2013) against | |
what appears in the data */ | |
*************************************************************************************************** | |
clear | |
set mem 500m | |
* set directory | |
gl DRIVE "/Users/katiacovarrubias/Documents/Academic/IHEID/Courses/Advanced Econometrics/Exam/Dupas_data/" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Layers used to create the basemap: | |
// vector: http://mapbox-geodata.s3.amazonaws.com/natural-earth-1.4.0/physical/10m-bathymetry.zip // #bathymetry layer | |
// http://mapbox-geodata.s3.amazonaws.com/natural-earth-1.4.0/physical/10m-ocean.zip // #ocean layer | |
// http://mapbox-geodata.s3.amazonaws.com/natural-earth-1.4.0/cultural/10m-admin-0-countries.zip // #countries layer | |
// http://mapbox-geodata.s3.amazonaws.com/natural-earth-1.4.0/cultural/10m-admin-0-countries.zip // #countries layer | |
// http://mapbox-geodata.s3.amazonaws.com/natural-earth-1.4.0/cultural/10m-urban-areas.zip // #urban areas layer | |
// raster: OB_LR/OB_LR.tif // #oceanshade (downloaded from http://www.naturalearthdata.com/downloads/10m-raster-data/10m-ocean-bottom/) | |
Map { | |
background-color: #b8dee6; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* Stata .do file to replicate the analysis in http://kashin.guru/2014/07/01/pride/ based on WVS question on national pride | |
* ssc inst coefplot | |
* Data is available at http://www.worldvaluessurvey.org/WVSDocumentationWVL.jsp (file WVS_Longitudinal_1981-2014_stata_dta_v_2014_06_17_Beta) | |
cd "~/Downloads/" | |
use WVS_Longitudinal_1981-2014_stata_dta_v_2014_06_17_Beta.dta, clear | |
* Generate regressors | |
gen male =. | |
replace male = 0 if X001 > 0 | |
replace male = 1 if X001 == 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
setwd("~/Downloads/") | |
library("foreign") | |
library("lme4") | |
library("lattice") | |
library("sandwich") | |
library("arm") | |
library("car") | |
library("lmtest") | |
# Load data |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<meta charset="utf-8"> | |
<style> | |
.tract { | |
fill: #ccc; | |
} | |
.tract:hover { | |
fill: orange; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Install dependencies | |
packages <- c("data.table", "tm", "SnowballC", "Matrix", "textir") | |
if (length(setdiff(packages, rownames(installed.packages()))) > 0) { | |
install.packages(setdiff(packages, rownames(installed.packages()))) | |
} | |
# Load dependencies | |
lapply(packages, library, character.only = TRUE) | |
# Path to data |
SRTM 1 second arc elevation data and optimal cycling path from the Cathedral of Christ the Saviour to the Pushkin Square in Moscow
# A proof-of-concept code to calculate
# cycling distance between two points in
# central Moscow that incorporates elevation profiles
#
# By Dmitriy Skougarevskiy, 2016-10-30
This is a tilegram of Russian regions with area being distorted according to 2015 population. I relied on Gastner and Newman, 2004 distortion algorithm. Each hexagon is approximately equal to 25,000 people. Hover over the regions to see their names and population counts (in Russian).
# (c) Dmitriy Skougarevskiy, November 2016
#
# Use of this source code is governed by the MIT license
# located at https://opensource.org/licenses/MIT
# Load dependencies
packages <- c("maptools", "raster", "sp", "rgeos", "devtools")
OlderNewer