data=cbind(data,class_s,fpc,weight) library(survey) G=svydesign(id=~1,strata=~class_s,weights=~weight,fpc=~fpc, data=data) G=as.svrepdesign(G) pop.types=xtabs(~class_s, data=data) G_design=postStratify(G, ~class_s, pop.types) #C1. Project financing, finance(Q43:yes/no) and f_index(Q44,count yes) n<-dim(data)[1] temp<-cbind(data$q_0043_1_1,data$q_0043_2_1,data$q_0043_3_1,data$q_0043_4_1,data$q_0043_5_1,data$q_0043_6_1,data$q_0043_7_1,data$q_0043_8_1,data$q_0043_9_1) temp0<-apply(is.na(temp),1,sum) finance<-rep(NA,n) for (i in 1:n) { if (temp0[i]<9) {if (sum(temp[i,],na.rm=TRUE)>0) finance[i]<-1 if (sum(temp[i,],na.rm=TRUE)==0) finance[i]<-0} } temp<-apply(is.na(data[,104:133]),1,sum) f_index<-rep(NA,n) for (i in 1:n) { if (temp[i]<30) f_index[i]<-sum(data[i,104:133],na.rm=TRUE) } # C2. Paid versus volunteer participants, paid_volunteer temp<-cbind(data$q_0043_1_1,data$q_0043_2_1,data$q_0043_3_1,data$q_0043_4_1) temp0<-apply(is.na(temp),1,sum) paid_volunteer<-rep(NA,n) for (i in 1:n) { if (temp0[i]<4) { if (sum(temp[i,],na.rm=TRUE)>0) paid_volunteer[i]<-1 if (sum(temp[i,],na.rm=TRUE)==0) paid_volunteer[i]<-0} } #C3. Developer motivations, need(Q45_7,45_9,50_7,50_9, leisure(45_4,40_4),fin_motive(45_6,40_6),motivation(sum40, 45) temp<-apply(is.na(cbind(data$q_0045_7_1,data$q_0045_9_1,data$q_0050_7_1,data$q_0050_9_1)),1,sum) need<-rep(NA,n) for (i in 1:n) { if (temp[i]<4) need[i]<-sum(cbind(data$q_0045_7_1,data$q_0045_9_1,data$q_0050_7_1,data$q_0050_9_1)[i,],na.rm=TRUE) } temp<-apply(is.na(cbind(data$q_0045_4_1,data$q_0050_4_1)),1,sum) leisure<-rep(NA,n) for (i in 1:n) { if (temp[i]<2) leisure[i]<-sum(cbind(data$q_0045_4_1,data$q_0050_4_1)[i,],na.rm=TRUE) } temp<-apply(is.na(cbind(data$q_0045_6_1,data$q_0050_6_1)),1,sum) fin_motive<-rep(NA,n) for (i in 1:n) { if (temp[i]<2) fin_motive[i]<-sum(cbind(data$q_0045_6_1,data$q_0050_6_1)[i,],na.rm=TRUE) } temp45<-cbind(data$q_0045_1_1,data$q_0045_2_1,data$q_0045_3_1,data$q_0045_4_1,data$q_0045_5_1,data$q_0045_6_1, data$q_0045_7_1,data$q_0045_8_1,data$q_0045_9_1,data$q_0045_10_1) temp50<-cbind(data$q_0050_1_1,data$q_0050_2_1,data$q_0050_3_1,data$q_0050_4_1,data$q_0050_5_1,data$q_0050_6_1, data$q_0050_7_1,data$q_0050_8_1,data$q_0050_9_1,data$q_0050_10_1) temp<-cbind(temp45,temp50) temp0<-apply(is.na(temp),1,sum) motivation<-rep(NA,n) for (i in 1:n) { if (temp0[i]<20) motivation[i]<-sum(temp[i,],na.rm=TRUE) } #C4. The homogeneity/heterogeneity of participants,home_geog(Q18),homo_motive(Q50), homo_edu(Q53) temp<-is.na(data$q_0018) homo_geog<-rep(NA,n) for (i in 1:n) { if (is.na(data$q_0028[i])) {if (data[i,6]>1) {if (temp[i]==0 & sum(data$q_0018[i]==c(1,2,3,4,10))==1) homo_geog[i]<-1 if (temp[i]==0 & sum(data$q_0018[i]==c(5,6,7,8,9,11))==1) homo_geog[i]<-0} } else {if (temp[i]==0 & data$q_0028[i]==1 & sum(data$q_0018[i]==c(1,2,3,4,10))==1) homo_geog[i]<-1 if (temp[i]==0 & data$q_0028[i]==1 & sum(data$q_0018[i]==c(5,6,7,8,9,11))==1) homo_geog[i]<-0 if (temp[i]==0 & data$q_0028[i]==2) homo_geog[i]<-1 } } temp50<-cbind(data$q_0050_1_1,data$q_0050_2_1,data$q_0050_3_1,data$q_0050_4_1,data$q_0050_5_1,data$q_0050_6_1, data$q_0050_7_1,data$q_0050_8_1,data$q_0050_9_1,data$q_0050_10_1) temp<-apply(is.na(temp50),1,sum) #num of NAs in each row of q50 1:10 temp1<-is.na(data$q_0028) homo_motive<-rep(NA,n) for (i in 1:n) { if (temp[i]<10) if(temp1[i]==1) homo_motive[i]<-sum(temp50[i,],na.rm=TRUE) if(temp1[i]==0&data$q_0028[i]==1) homo_motive[i]<-sum(temp50[i,],na.rm=TRUE) if (temp1[i]==0&data$q_0028[i]==2) homo_motive[i]<-0 #to avoid imputation 1 dev projects have 0 heterogeneity } temp<-is.na(data$q_0053) temp1<-is.na(data$q_0028) homo_edu<-rep(NA,n) for (i in 1:n) { if (temp[i]==0 & temp1[i]==0) {if (data$q_0028[i]==1 & sum(data$q_0053[i]==c(1,2,3))==1) homo_edu[i]<-1 if (data$q_0028[i]==1 & sum(data$q_0053[i]==c(4,5,6,7))==1) homo_edu[i]<-0 if (temp1[i]==0 & data$q_0028[i]==2) homo_edu[i]<-1} if (temp[i]==0 & temp1[i]==1) {if (data[i,6]>1 & sum(data$q_0053[i]==c(1,2,3))==1) homo_edu[i]<-1 if (data[i,6]>1 & sum(data$q_0053[i]==c(4,5,6,7))==1) homo_edu[i]<-0 if (data[i,6]==1) homo_edu[i]<-1} if (temp[i]==1 & temp1[i]==0) {if (data$q_0028[i]==2) homo_edu[i]<-1} } #C5. The skill/knowledge continuum of developers, os_experience(q,q2), continuity(q6), prof_skill(q46,47/q51,52) #education(q48,53),writing(q49,54) os_experience<-apply(cbind((2009-data$q_0001)/max(2009-data$q_0001,na.rm=TRUE),data$q_0002/max(data$q_0002,na.rm=TRUE)),1,sum,na.rm=TRUE) continuity<-2-data$q_0006 for ( i in 1:n) { if (is.na(continuity[i])) continuity[i]<-2-data$q_0006B[i] else {if (continuity[i]==0) {if(!is.na(data$q_0006B[i])) continuity[i]=2-data$q_0006B[i]}} } prof_skill<-rep(NA,n) for (i in 1:n) { if(is.na(data$q_0028[i])|data$q_0028[i]==1)#if Q28 == NA or 1 then Q51 and Q52 were asked {if(is.na(data$q_0051[i])&is.na(data$q_0052[i])) prof_skill[i]<-(2-data$q_0046[i])*(4-data$q_0047[i])#if not professional 0, if profess value 1-3 else if(is.na(data$q_0051[i])&!is.na(data$q_0052[i])) prof_skill[i]<-(2-data$q_0046[i])*(4-data$q_0047[i])#don't know if more than 1 professional else if(data$q_0051[i]==1&is.na(data$q_0052[i])) prof_skill[i]<-(2-data$q_0046[i])*(4-data$q_0047[i]) else if(data$q_0051[i]==1&!is.na(data$q_0052[i])) prof_skill[i]<-4-data$q_0052[i] else if (data$q_0051[i]==2) prof_skill[i]<-(2-data$q_0046[i])*(4-data$q_0047[i]) } else{if (data$q_0028[i]==2) prof_skill[i]<-(2-data$q_0046[i])*(4-data$q_0047[i]) } } education<-rep(NA,n) for (i in 1:n) #just take the answer they gave. { if(is.na(data$q_0053[i])) {if (is.na(data$q_0048[i])) education[i]<-NA else {if (data$q_0048[i]<4) education[i]<-4-data$q_0048[i] if (data$q_0048[i]==4) education[i]<-2 if (data$q_0048[i]==5) education[i]<-3 if (data$q_0048[i]==6) education[i]<-1 } } else {if (data$q_0053[i]<4) education[i]<-4-data$q_0053[i] if (data$q_0053[i]==4 || data$q_0053[i]==5 || data$q_0053[i]==7) education[i]<-3 if (data$q_0053[i]==6) education[i]<-2 if (data$q_0053[i]==8) education[i]<-1 } } writing<-rep(NA,n) for (i in 1:n) { if (is.na(data$q_0054[i])) writing[i]<-6-data$q_0049[i] else writing[i]<-6-data$q_0054[i] } #C6. Software modularity, granularity and complexity,Q11,Q10,Q12,Q23,24 proprietary<- 2-data$q_0011 modularity<- 3-data$q_0010 complexity<-5-data$q_0012 granularity<-apply(cbind((3-data$q_0023)/2,(3-data$q_0024)/2),1,sum,na.rm=TRUE) #C7. Approaches to requirements gathering,Q9A,Q12,Q11 temp<-apply(is.na(data[,30:36]),1,sum) plan_communicate<-rep(NA,n) for (i in 1:n) {if(temp[i]<7) plan_communicate[i]<- sum(2-data[i,30:36],na.rm=TRUE)/7 } plan_user_involve<-(3-data$q_0025)/2 plan_exist<-2-data$q_0009 z<-cbind(plan_communicate, plan_user_involve, plan_exist) temp<-apply(is.na(z),1,sum) require_index<-rep(NA,n) for (i in 1:n) if (temp[i]<3) require_index[i]<-sum(z[i,], na.rm=TRUE) #C8. Some elements of Leadership hrs<-rep(NA,n) for (i in 1:n) {if (!is.na(data$q_0014[i])) {if (data$q_0014[i]==1) hrs[i]<-.05 if (data$q_0014[i]==2) hrs[i]<-3 if (data$q_0014[i]==3) hrs[i]<-6 if (data$q_0014[i]==4) hrs[i]<-9 if (data$q_0014[i]==5) hrs[i]<-11} } temp<-cbind(data$q_0008,data$q_0009,data$q_0007,data$q_0013,hrs,data$q_0020,data$q_0039,data$q_0029) temp0<-apply(is.na(temp),1,sum) leadership<-rep(NA,n) for (i in 1:n) {if (temp0[i]<8) leadership[i]<-sum(sum(2-temp[i,1:3],na.rm=TRUE),(2-temp[i,4]),temp[i,5]/11,(6-temp[i,6])/5,(7-temp[i,7])/6,(3-temp[i,8])/2,na.rm=TRUE) } #leadership with hours temp<-cbind(data$q_0008,data$q_0009,data$q_0007,data$q_0013,hours,data$q_0020,data$q_0039,data$q_0029) temp0<-apply(is.na(temp),1,sum) leadership_hours<-rep(NA,n) for (i in 1:n) {if (temp0[i]<8) leadership_hours[i]<-sum(sum(2-temp[i,1:3],na.rm=TRUE),(2-temp[i,4]),temp[i,5]/46,(6-temp[i,6])/5,(7-temp[i,7])/6,(3-temp[i,8])/2,na.rm=TRUE) } #leadership without hours temp<-cbind(data$q_0008,data$q_0009,data$q_0007,data$q_0013,data$q_0020,data$q_0039,data$q_0029) temp0<-apply(is.na(temp),1,sum) leadership_nohrs<-rep(NA,n) for (i in 1:n) {if (temp0[i]<7) leadership_nohrs[i]<-sum(sum(2-temp[i,1:3],na.rm=TRUE),(2-temp[i,4]),(6-temp[i,5])/5,(7-temp[i,6])/6,(3-temp[i,7])/2,na.rm=TRUE) } #C9. Social capital and reciprocity,soc_capital(Q30,55,56),recip_specific(Q26),recip_general(A27) temp<-apply(is.na(cbind(data$q_0030,data$q_0055,data$q_0056)),1,sum) temp1<-is.na(data$q_0028) soci_capital<-rep(NA,n) for (i in 1:n) {if(temp[i]<3) soci_capital[i]<-sum((3-data$q_0030[i])/2,sum(data$q_0055[i]-1,data$q_0056[i]-1,na.rm=TRUE)/5,na.rm=TRUE) else if (temp1[i]==0&data$q_0028[i]==2) soci_capital[i]<-0 #set social capital=0 if the project has only 1 member } recip_specific<-5-data$q_0032 recip_general<-5-data$q_0033 ##C10. Marketing,Q21,35,11A temp<-apply(is.na(cbind(data$q_0021,data$q_0039,plan_communicate)),1,sum) marketing<-rep(NA,n) for(i in 1:n) {if (temp[i]<3) marketing[i]<-sum(2-data$q_0021[i],(6-data$q_0039[i])/5,plan_communicate[i],na.rm=TRUE) } ###C11. Institutional structure and design,Q34,Q35,Q36,Q37,Q38,Q38A temp0<-cbind(2-data$q_0034_1,2-data$q_0034_2,2-data$q_0034_3) temp<-apply(is.na(temp0),1,sum) rule_ops<-rep(NA,n) for (i in 1:n) { if( temp[i]<3) { for (j in 1:3) if (is.na(temp0[i,j]) )temp0[i,j]=4 if (sum(temp0[i,1:3])==0) rule_ops[i]=0 if (sum(temp0[i,1:3])==3) rule_ops[i]=5 if (sum(temp0[i,1:3])==1 & temp0[i,1]==1) rule_ops[i]=1 if (sum(temp0[i,1:3])==1 & temp0[i,2]==1) rule_ops[i]=3 if (sum(temp0[i,1:3])==1 & temp0[i,3]==1) rule_ops[i]=6 if (sum(temp0[i,1:3])==2 & temp0[i,3]==0) rule_ops[i]=2 if (sum(temp0[i,1:3])==2 & temp0[i,2]==0) rule_ops[i]=4 } } rule_decision<-data$q_0035 temp<-data$q_0036 for (i in 1:n) {if (!is.na(temp[i]) &temp[i]=="-oth-") temp[i]=NA } rule_leader<- as.integer(temp)-2 govern<-data$q_0037-1 gov_evolution<-rep(NA,n) temp<-data$q_0038A for (i in 1:n) {if (!is.na(temp[i]) &temp[i]=="-oth-") temp[i]=NA } temp<-as.integer(temp)-2 temp<-cbind(2-data$q_0038, temp) temp0<-apply(is.na(temp),1,sum) for(i in 1:n) if(temp0[i]<2) {if(!is.na(temp[i,1])|temp[i,1]==1) gov_evolution[i]<-temp[i,2] if(temp[i,1]==0) gov_evolution[i]<-0 } ###C12 Other temp<-apply(is.na(cbind(data$q_0040,data$q_0041)),1,sum) utility<-rep(NA,n) for (i in 1:n) {if (temp[i]<2) utility[i]<- sum(4-data$q_0040[i],4-data$q_0041[i],na.rm=TRUE) } #complexity<- 5-data$q_0012 competition<- 3-data$q_0022 temp0<-cbind(data$q_0026_1,data$q_0026_2,data$q_0026_3,data$q_0026_4,data$q_0026_5,data$q_0016, data$q_0017, data$q_0027) temp<-apply(is.na(temp0),1,sum) community<-rep(NA,n) for (i in 1:n) {if (temp[i]<8) community[i]<-sum(sum(2-temp0[i,1:5],na.rm=TRUE)/5,sum(temp0[i,6],temp0[i,7],na.rm=TRUE)/99,temp0[i,8]/max(data$q_0027,na.rm=TRUE),na.rm=TRUE) } memb_inet<-rep(NA,n) for(i in 1:n) {if(!is.na(data$q_0028[i])&data$q_0028[i]==2) memb_inet[i]<-0 else memb_inet[i]<-2-data$q_0019[i] } hrs14<-rep(NA,n) for(i in 1:n) {if (!is.na(data$q_0014[i])) {if (data$q_0014[i]==1) hrs14[i]<-.05 if (data$q_0014[i]==2) hrs14[i]<-3 if (data$q_0014[i]==3) hrs14[i]<-6 if (data$q_0014[i]==4) hrs14[i]<-9 if (data$q_0014[i]==5) hrs14[i]<-11} } hrs15<-rep(NA,n) for (i in 1:n) {if (!is.na(data$q_0015[i])) {if (data$q_0015[i]==1) hrs15[i]<-.05 if (data$q_0015[i]==2) hrs15[i]<-35 if (data$q_0015[i]==3) hrs15[i]<-8 if (data$q_0015[i]==4) hrs15[i]<-13 if (data$q_0015[i]==5) hrs15[i]<-18 if (data$q_0015[i]==6) hrs15[i]<- 21} } hours<-apply(cbind(hrs14,hrs15),1,sum,na.rm=TRUE) conflict<- rep(NA,n) for(i in 1:n) { if(!is.na(data$q_0028[i])&data$q_0028[i]==2) conflict[i]<-0 else conflict[i]<-5-data$q_0031[i] } class_s<-as.factor(class_s) data_index<-cbind(class_s,finance,f_index,paid_volunteer,need,leisure,fin_motive,motivation, homo_geog,homo_motive,homo_edu,os_experience,continuity,prof_skill,education,writing, proprietary,modularity,complexity,require_index,leadership, soci_capital,recip_specific,recip_general,marketing,rule_ops,rule_decision,govern,gov_evolution,rule_leader,utility, competition,community,memb_inet,hours,conflict) data_index<-data.frame(data_index) # BE add pairwise x<-cor(data_index,use="pairwise.complete.obs") w<-x[1,order(abs(x[1,]),decreasing=TRUE)] #print highly correlated variables for(i in 1:dim(x)[1]) for (j in 1:dim(x)[2]) if ((!is.na(x[i,j])) & (abs(x[i,j]) >.5) & (x[i,j]<'1')) {print(c(rownames(x)[i], colnames(x)[j], x[i,j])) } x<-cor(data_index,use="complete.obs")#correction matrix of the index variables w<-x[1,order(abs(x[1,]),decreasing=TRUE)] # correction with class_s, order them from largest to smallest (in absolute value) for(i in 1:dim(x)[1]) for (j in 1:dim(x)[2]) if ((!is.na(x[i,j])) & (abs(x[i,j]) >.5) & (x[i,j]<'1')) {print(c(rownames(x)[i], colnames(x)[j], x[i,j])) } write.csv(x,'ind_cor_comp.csv') write.csv(w,'ind_cor_comp_maj.csv') data_nd<-read.table("ga_allqs_nd_data.txt",header=TRUE) data_index_nd<-cbind(data_index,data_nd[,-1]) # BE add pairwise x<-cor(data_index_nd,use="pairwise.complete.obs") w<-x[1,order(abs(x[1,]),decreasing=TRUE)] #print highly correlated variables for(i in 1:dim(x)[1]) for (j in 1:dim(x)[2]) if ((!is.na(x[i,j])) & (abs(x[i,j]) >.5) & (x[i,j]<'1')) {print(c(rownames(x)[i], colnames(x)[j], x[i,j])) } x<-cor(data_index_nd,use="complete.obs")#correction matrix of the index variables w<-x[1,order(abs(x[1,]),decreasing=TRUE)] # correction with class_s, order them from largest to smallest (in absolute value) for(i in 1:dim(x)[1]) for (j in 1:dim(x)[2]) if ((!is.na(x[i,j])) & (abs(x[i,j]) >.5) & (x[i,j]<'1')) {print(c(rownames(x)[i], colnames(x)[j], x[i,j])) } #BE set survey to indexes data<-data_index_s G=svydesign(id=~1,strata=~class_s,weights=~weight,fpc=~fpc, data=data) G=as.svrepdesign(G) pop.types=xtabs(~class_s, data=data) G_design=postStratify(G, ~class_s, pop.types) svychisq(~finance+class_s, G_design)ummary(svyglm(f_index~class_s, G_design)) summary(svyglm(need~class_s, G_design)) summary(svyglm(leisure~class_s, G_design)) summary(svyglm(fin_motive~class_s, G_design)) summary(svyglm(motivation~class_s, G_design)) svychisq(~paid_volunteer+class_s, G_design) svychisq(~homo_geog+class_s, G_design) summary(svyglm(homo_motive~class_s, G_design)) svychisq(~homo_edu+class_s, G_design) summary(svyglm(os_experience~class_s, G_design)) svychisq(~continuity+class_s, G_design) summary(svyglm(prof_skill~class_s, G_design)) svychisq(~prof_skill+class_s, G_design) summary(svyglm(education~class_s, G_design)) svychisq(~education+class_s, G_design) summary(svyglm(writing~class_s, G_design)) svychisq(~writing+class_s, G_design) svychisq(~proprietary+class_s, G_design) svychisq(~modularity+class_s, G_design) summary(svyglm(complexity~class_s, G_design)) summary(svyglm(require_index~class_s, G_design)) summary(svyglm(leadership~class_s, G_design)) summary(svyglm(soci_capital~class_s, G_design)) svychisq(~recip_specific+class_s, G_design) svychisq(~recip_general+class_s, G_design) summary(svyglm(marketing~class_s, G_design)) summary(svyglm(rule_ops~class_s, G_design)) summary(svyglm(rule_decesion~class_s, G_design)) summary(svyglm(rule_leader~class_s, G_design)) svychisq(~govern+class_s, G_design) svychisq(~gov_evolution+class_s, G_design) summary(svyglm(utility~class_s, G_design)) summary(svyglm(competition~class_s, G_design)) summary(svyglm(community~class_s, G_design)) summary(svyglm(memb_inet~class_s, G_design)) summary(svyglm(hours~class_s, G_design)) svychisq(~conflict+class_s, G_design) ######classification analysis library(rpart) library(randomForest) library(adabag) source('cartware.R') data_index<-data.frame(data_index) data_nd<-read.table("ga_allqs_nd_data.txt",header=TRUE) data_index_nd<-cbind(data_index,data_nd[,-1]) class_s<-as.factor(class_s) y<-data_index_nd y0<- y #y0 is another copy of the index data with NA y<-na.roughfix(data_index_nd) #y is the copy of data without NA rf_G_index_nd=randomForest(class_s~.,data=y,ntree=500,importance=TRUE,proximity=TRUE,nodesize=6) round(importance(rf_G_index_nd), 2) varImpPlot(rf_G_index_nd) x11() rf_G_index_nd_na=randomForest(class_s~.,data=y0,ntree=500,importance=TRUE,proximity=TRUE,na.action=na.omit,nodesize=6) x<-round(importance(rf_G_index_nd_na), 2) varImpPlot(rf_G_index_nd_na) cart_G_index<- cart(class_s~.,data=y0,method="class",control=rpart.control(xval = 80, minbucket = 1, minsplit = 6, cp = 0)) cartg<-cart(class_s~leadership,method="class",control=rpart.control(xval = 80, minbucket = 1, minsplit = 6, cp = 0)) summary(cartg) var.importance(cartg) ##################logistic regression###################### attach(data_index_nd) v=2-as.numeric(class_s) summary(glm(v~leadership+community+leadership+require_index+memb_inet+marketing+utility,family=binomial(link = "logit"))) #bob's glm taken from the VIP summary(glm(v~tracker_reports+community+downloads+marketing+utility+f_index+leadership, family=binomial(link = "logit"))) m=dim(data_index_nd)[2] p<-rep(NA,m) for (i in 1:m) {p[i]<-summary(glm(v~data_index_nd[,i],family=binomial(link = "logit")))$coefficients[2,4] } p<-rep(NA,m) q<-c(1:m) for (i in q[-32]) {p[i]<-summary(glm(v~data_index_nd[,32]+data_index_nd[,i],family=binomial(link = "logit")))$coefficients[3,4] } p<-rep(NA,m) for (i in q[-c(33,32)]) {p[i]<-summary(glm(v~data_index_nd[,32]+data_index_nd[,33]+data_index_nd[,i], family=binomial(link = "logit")))$coefficients[4,4] } p<-rep(NA,m) for (i in q[-c(20,32,33)]) {p[i]<-summary(glm(v~data_index_nd[,32]+data_index_nd[,33]+data_index_nd[,20]+data_index_nd[,i], family=binomial(link = "logit")))$coefficients[5,4] } p<-rep(NA,m) for (i in q[-c(20,32,33,30)]) {p[i]<-summary(glm(v~data_index_nd[,32]+data_index_nd[,33]+data_index_nd[,20]+data_index_nd[,30]+data_index_nd[,i], family=binomial(link = "logit")))$coefficients[6,4] } p<-rep(NA,m) for (i in q[-c(20,32,33,30,29)]) {p[i]<-summary(glm(v~data_index_nd[,32]+data_index_nd[,33]+data_index_nd[,20]+data_index_nd[,30]+data_index_nd[,29]+data_index_nd[,i], family=binomial(link = "logit")))$coefficients[7,4] } #BE add names summary(glm(v~leadership+community+memb_inet+utility+rule_leader, family=binomial(link = "logit")))