Came across an interesting package in R that allows for a heat map that shows the correlation of variables. Pretty cool. I hope I can use this for one of my figures sometime in the future. Here's the code:
#Create Correlation Matrix
corr_matrix <- cor(mtcars)
#Creating Figure with Circles
#Creating Figure with Numbers
method = 'number',
type = "lower")
And here are the results. For the first corrplot with circles:
And the second corrplot with numbers:
For days now I've been racking my brains out for a way to create a radar plot with different axes values and with multiple items. Basically, I have three treatments and each treatment has a measure for production, welfare and equality. While I can easily have a radar plot per treatment, I want a more informative graph and have all treatments in one radar plot.
I finally found a way (after much Googling). Thank you, The R Graph Gallery for sharing the code below:
data=as.data.frame(matrix( sample( 0:20 , 15 , replace=F) , ncol=5))
colnames(data)=c("math" , "english" , "biology" , "music" , "R-coding" )
rownames(data)=paste("mister" , letters[1:3] , sep="-")
data=rbind(rep(20,5) , rep(0,5) , data)
#Plot -- this plot computes the maximum and minimum values from the data
colors_border=c( rgb(0.2,0.5,0.5,0.9), rgb(0.8,0.2,0.5,0.9) , rgb(0.7,0.5,0.1,0.9) )
colors_in=c( rgb(0.2,0.5,0.5,0.4), rgb(0.8,0.2,0.5,0.4) , rgb(0.7,0.5,0.1,0.4) )
radarchart( data[-c(1,2),] , axistype=0 , maxmin=F,
pcol=colors_border , pfcol=colors_in , plwd=4 , plty=1,
#custom the grid
cglcol="grey", cglty=1, axislabcol="black", cglwd=0.8,
legend(x=0.6, y=2.25, legend = rownames(data[-c(1,2),]), bty = "n", pch=20 , col=colors_in , text.col = "grey", cex=1.1, pt.cex=3)
And this is how it looks like:
Thought this summarizes pretty well how to visualize data. I found this pretty helpful. Putting this in here in the hopes that it helps others too. Thank you, Professor Andrew Abela. You can download a much clearer PDF version here.
A number of interesting links on climate change:
It's been a while since I last worked on common pool resource games (and by a while I mean a year and a few months). But recently, in my search for cooperative games under uncertainty, I came upon this interesting paper by Rapoport and Au (2001) at the journal of Organizational Behavior and Human Decision Process. The paper looks at how bonuses or penalties affect individual decision making under both strategic uncertainty (i.e., when harvesting behavior of other group members is uncertain) and environmental uncertainty (i.e, when the size of the CPR is uncertain). The reason I find the paper interesting is not so much that it tests the effects of bonuses and penalties on individual behavior (I think the literature has lots to say about that) but that its formulation of the CPR game is different from what I'm used to. Instead of profit being equal to the difference between private benefits and private and social costs from extraction, the profit function that the authors use is equal to the extraction if the sum of extractions across all members of the group is less than or equal to the total pool and 0 otherwise. Theoretically, they find that a bonus decreases group extraction while a penalty increases in. Experimentally, they find that both decreases group extraction, with penalties being more effective.
You can download the paper from www.sciencedirect.com/science/article/pii/S0749597800929352
Anna is an applied microeconomist interested in the relationship between human behavior and economic decision-making. She works primarily on environmental and natural resource topics using experimental, behavioral, survey and spatial datasets. This blog was created for the sole purpose of archiving and sharing interesting articles, data visualization techniques, and online classes/tutorials.