phd=read.table("phd_data.csv",sep=",",header=T) phd$global_clustering_no_ego_2=phd$`global clustering without ego_2` phd$constraint_2=phd$`constraint of ego_2` phd$constraint_4=phd$`constraint of ego_4` phd$constraint_6=phd$`constraint of ego_6` hist(log(phd$degree_0)) nrow(phd[]) hist(log(phd$betweenness_0)) m1=lm(log(citations_cum_8+1) ~ log(citations_cum_2+1) + log(papers_cum_2+1) + log(papers_cum_8-papers_cum_2+1) + #log(degree_2+1) + #log(global_clustering_no_ego_2+1) + discipline + as.factor(def_year) , data=phd[which(phd$def_year<2011),]) #summary(m1) m2=lm(log(citations_cum_8+1) ~ log(citations_cum_2+1) + log(papers_cum_2+1) + log(papers_cum_8-papers_cum_2+1) + log(degree_2+1) + #log(global_clustering_no_ego_2+1) + discipline + as.factor(def_year) , data=phd[which(phd$def_year<2011),]) #summary(m2) m3=lm(log(citations_cum_8+1) ~ log(citations_cum_2+1) + log(papers_cum_2+1) + log(papers_cum_8-papers_cum_2+1) + log(degree_2+1) + log(constraint_2+1) + discipline + as.factor(def_year) , data=phd[which(phd$def_year<2011),]) #summary(m3) cor_d=phd[which(phd$def_year<2011),c("citations_cum_8", "citations_cum_2", "papers_cum_2", "degree_2", "constraint_2")] cor(cor_d, use="pairwise.complete.obs", method="pearson") length(unique(phd$discipline)) #library(stargazer) capture.output(stargazer(m1, m2, m3, type="text", dep.var.labels="Citations 8 years post-defence", column.labels = c("M1","M2", "M3"), # covariate.labels=c("CIT_2","PAPERS_2", "PAPERS_8_2"), # "DEG_0 ? CON_0", # "PAPERS_0", "PAPERS_8", # "DEG_0_2", "DEG_2_4", "DEG_4_6", # "CON_0_2", "CON_2_4", "CON_4_6"), omit.stat=c("LL","ser","f"), ci=F, single.row=F, out="dec14_1.txt")) ###############################################xx # non-live science m4=lm(log(citations_cum_8+1) ~ log(citations_cum_2+1) + log(papers_cum_2+1) + log(papers_cum_8-papers_cum_2+1) + log(degree_2+1) + log(constraint_2+1) + discipline + as.factor(def_year) , data=phd[which(phd$def_year<2011 & phd$Research_Area=="non-live science"),]) # live science m5=lm(log(citations_cum_8+1) ~ log(citations_cum_2+1) + log(papers_cum_2+1) + log(papers_cum_8-papers_cum_2+1) + log(degree_2+1) + log(constraint_2+1) + discipline + as.factor(def_year) , data=phd[which(phd$def_year<2011 & phd$Research_Area=="live science"),]) # engineering m6=lm(log(citations_cum_8+1) ~ log(citations_cum_2+1) + log(papers_cum_2+1) + log(papers_cum_8-papers_cum_2+1) + log(degree_2+1) + log(constraint_2+1) + discipline + as.factor(def_year) , data=phd[which(phd$def_year<2011 & phd$Research_Area=="engineering"),]) # social science m7=lm(log(citations_cum_8+1) ~ log(citations_cum_2+1) + log(papers_cum_2+1) + log(papers_cum_8-papers_cum_2+1) + log(degree_2+1) + log(constraint_2+1) + discipline + as.factor(def_year) , data=phd[which(phd$def_year<2011 & phd$Research_Area=="social science"),]) capture.output(stargazer(m4, m5, m6, m7, type="text", dep.var.labels="Citations 8 years post-defence", column.labels = c("Sciences","Life Sci", "Engineer", "Social Sci"), # covariate.labels=c("HIV_0","DEG_0", "CON_0", # "DEG_0 ? CON_0", # "PAPERS_0", "PAPERS_8", # "DEG_0_2", "DEG_2_4", "DEG_4_6", # "CON_0_2", "CON_2_4", "CON_4_6"), omit.stat=c("LL","ser","f"), ci=F, single.row=F, out="dec14_2.txt"))