2738 search results for "gis"

Simple marimekko/mosaic plots

October 10, 2012
By
Simple marimekko/mosaic plots

I don’t really care for the name “marimekko” or “mosaic,” but I do like this type of plot as a means of illustrating proportions in nested categorical data, or as an alternative to the parallel time series plots discussed...

Read more »

Making Color Ramps in Matlab

October 9, 2012
By

When visualizing an array of data in a heatmap, a good color map makes a world of difference.Thanks to my work in 'omics (i.e. transcriptomics - microarrays and RNASeq) I've looked at a lot of heatmaps over the past couple of years, and generated quite...

Read more »

Age-Period-Cohort models and the decline of violence

October 9, 2012
By
Age-Period-Cohort models and the decline of violence

Ever since the end of the Mexican Revolution and the Cristero War violence in Mexico inched down in fits and starts from a high of about 60 homicides per 100,000 people to its lowest level sometime during the middle of the last decade (there's some uncertainty about the number of homicides in...

Read more »

Conditional Colors and Shapes in plot() with ifelse()

October 9, 2012
By
Conditional Colors and Shapes in plot() with ifelse()

Here’s an example of how to color your plot shapes and pch using an ifelse() statement. Ifelse() is handy as it creates an easy way to branch a function. The syntax is: ifelse(logical.condition, option1, option2). Meaning, if the logical condi...

Read more »

Upcoming events

October 9, 2012
By
Upcoming events

Featured I’ll be leading two courses in the near future: Value-at-Risk versus Expected Shortfall 2012 October 30-31, London. 30th: “Addressing the critical challenges and issues raised by the Basel proposal to replace VaR with Expected Shortfall” 31st: “Variability in Value-at-Risk and Expected Shortfall” led by Patrick Burns Details at CFP Events. Finance with R Workshop … Continue reading...

Read more »

Two ways that correlation and stepwise regression can give different results

October 8, 2012
By

In general, a correlation test is used to test the association between two variables (y and z). However, if there is a third variable (x) that might be related to z or y, it makes...

Read more »

Functions for plotting and getting Greek in labels

October 8, 2012
By
Functions for plotting and getting Greek in labels

The problem: We often want to plot data and assign plot attributes based on characteristics of the data. For example, if we have a group of students with the following IQs, we might want to indicate who is an outlier in the statistical sense. I like...

Read more »

How to read BSMAP methylation ratio files into R via methylKit

October 5, 2012
By

BSMAP is an aligner for bisulfite sequencing reads. It outputs aligned reads as well as methylation ratios per base (via methratio.py script). The methylation ratios can be read into R via methylKit package and regular methylKit analysis can ...

Read more »

Calculating distances (across matrices)

October 5, 2012
By
Calculating distances (across matrices)

This Gist is mostly for my future self, as a reminder of how to find distances between each row in two different matrices. To create a distance matrix from a single matrix, the function dist(), from the stats package is sufficient. There are times, ho...

Read more »

Adding Measures of Central Tendency to Histograms in R

October 4, 2012
By
Adding Measures of Central Tendency to Histograms in R

Building on the basic histogram with a density plot, we can add measures of central tendency (in this case, mean and median) and a legend.Like last time, we'll use the beaver data from the datasets package.hist(beaver1$temp, # histogram col =...

Read more »