Skip to content

Instantly share code, notes, and snippets.

@jebyrnes
Last active December 21, 2015 21:09
Show Gist options
  • Save jebyrnes/6366701 to your computer and use it in GitHub Desktop.
Save jebyrnes/6366701 to your computer and use it in GitHub Desktop.
#SciFund Goal Analyses
source("./sciFundFunctions.r")
library(car)
projects$Round = "1"
projects2$Round = "2"
projects3$Round = "3"
commonCols <- intersect(names(projects2), names(projects3))
#merge just the columns we need for the analysis
cols <- qw(total, Contributors, meanDonation, medianDonation, Goal, Round, Fully.funded., Contributors, Pageviews)
projects23 <- rbind(projects[,which(names(projects) %in% cols)],
projects2[,which(names(projects2) %in% cols)],
projects3[,which(names(projects3) %in% cols)])
mean(projects23$Goal)
median(projects23$Goal)
qplot(Round, Goal, data=projects23, geom="boxplot", fill=Round) + theme_bw(base_size=22) +
xlab("\nRound") + ylab("Goal ($) \n") +
scale_fill_discrete(guide="none")
qplot(Goal, total, data=projects23)
qplot(Fully.funded., Goal, data=projects23, geom="boxplot", fill=Round)+ theme_bw(base_size=22) +
xlab("\nWas it Fully Funded?") + ylab("Goal ($) \n")
goalFund <- lm(log(Goal) ~ Fully.funded.*Round, data=projects23)
par(mfrow=c(2,2))
plot(goalFund)
par(mfrow=c(1,1))
library(xtable)
print(xtable(Anova(goalFund)), "html")
print(xtable(summary(goalFund)), "html")
#look at conversion rate of hits to contributors
projects23$conversion <- projects23$Contributors/projects23$Pageviews*100
qplot(Round, conversion, data=projects23, geom="boxplot", fill=Round)
summary(lm(conversion ~ Round + 0, data=projects23))
qplot(total, conversion, data=projects23, facets=~Round)
summary(lm(conversion ~ Round*total, data=projects23))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment