################################################################################### # Replication file for "Experimental evidence for a pure collaboration effect" # # Figure 4 # # author: Mary McGrath (mary.mcgrath@northwestern.edu) ORCID: 0000-0002-8437-4039 # # created: 10/25/2018 R version 3.3.2 # ################################################################################### library(foreign) setwd("[insert directory where you've saved the datasets]") ##In-Person## dat<-read.dta("Collab_Exp4.dta") pdf(file="Fig4.pdf", width=3.47, height=2, pointsize=7) par(mfrow=c(1,2), oma=c(0,0,1,0), mar=c(4,4,3,2)) sep<-hist(dat$given[dat$collab==0], breaks=20, plot=F) sep$counts sum(sep$counts) sep$density <- sep$counts/sum(sep$counts) plot(sep, freq=F, axes=F, ylim=c(0,1), col="black",xlab="Dollars given to partner", ylab="Proportion of respondents", main=NA) text(.13, 17/57, round(13/57,2), cex=.7) #text located +4 for spacing text(.9, (5+4)/57, round(5/57,2), cex=.7) text(1.9, (37+4)/57, round(37/57,2), cex=.7) text(3.9, (2+4)/57, round(2/57,2), cex=.7) axis(side=1) axis(side=2, at=c(0,.5,1)) mtext(side=3, "Separate", line=1) mtext(side=3, "N = 57", cex=.75) mtext(side=3, "Experiment 4", line=0, outer=T) collab<-hist(dat$given[dat$collab==1], breaks=20, plot=F) collab$counts sum(collab$counts) collab$density <- collab$counts/sum(collab$counts) plot(collab, freq=F, axes=F, ylim=c(0,1), col="black",xlab="Dollars given to partner", ylab=NA, main=NA) text(.13, (1+4)/65, round(1/65,2), cex=.7) text(.9, (5+4)/65, round(5/65,2), cex=.7) text(1.9, (56+4)/65, round(56/65,2), cex=.7) text(2.9, (2+4)/65, round(2/65,2), cex=.7) text(3.9, (1+4)/65, round(1/65,2), cex=.7) axis(side=1) axis(side=2, at=c(0,.5,1)) mtext(side=3, "Collaborative", line=1) mtext(side=3, "N = 65", cex=.75) dev.off()