File: SRMA2019_analyses.R

Comment: Data organization   Rename columns/variable names to make it simpler variable names
Category: Data Variable
Code:
colnames(srmadata) srmadata <- srmadata %>% rename(assessors = 2, journal = 3, pubyear = 4, pubmonth = 5, study.title = 6, pmid = 7, regist = 8, regist.num = 9, protocol = 10, title.ident = 11, ab.sources = 12, ab.eleg.crit = 13, ab.particip = 14, ab.interv = 15, ab.effect = 16, ab.included = 17, ab.outcome = 18, in.picos = 19, me.database = 20, me.search.avai = 21, me.grey.lit = 22, me.date.just = 23, me.lang.num = 24, me.picos.desc = 25, me.sele.dup = 26, me.extr.dup = 27, me.rob.desc = 28, me.rob.dup = 29, me.stat.desc = 30, me.heterog = 31, item.removed01 = 32, re.flowdia = 33, re.ssizes = 34, re.picos.desc = 35, re.lengths = 36, re.estim.desc = 37, re.meta.studies = 38, re.rob = 39, re.deviations = 40, di.spin = 41, di.rob.studies = 42, di.limitations = 43, data.statem = 44, fund.statem = 45, funders = 46, coi.statem = 47)

Comment: Redefine columns types to factor
Category: Data Variable
Code:
srmadata <- data.frame(srmadata) srmadata %>% mutate_if(is.character, as.factor) %>% str()

Comment:  Add labels to variables in participant dataframe;; then, generate table 
Category: Data Variable
Code:
table1::label(participant$ab.particip) <- "Description of participants (ab)" table1::label(participant$re.picos.desc) <- "Detailed studies' characteristics" table1::table1(~ab.particip + re.picos.desc, data = participant)

Comment:  HISTOGRAM   Generate a histogram of density of scores achieved by the 104 assessed studies  Create a 0 or 1 dataset, where No0 and Yes1, with respective study IDs (variable "id") 
Category: Visualization
Code:
id <- (1:104) allbinary <- data.frame(id, transparency, completenessbinary, participant, intervention, outcome, rigorbinary, appraisalbinary) allbinary[allbinary == "Yes"] <- "1" allbinary[allbinary == "No"] <- "0" lapply(allbinary,as.numeric)

Comment:  Set the dataframe as numeric so that we can sum up recommended practices for each study (variable "yes.score") 
Category: Data Variable
Code:
allbinary[] <- lapply(allbinary, function(x) as.numeric(as.character(x)))

Comment: Create a new dataframe (binarytotalsdf) with a new variable (yes.score) that reflects the number of recommended practices from each study
Category: Data Variable
Code:
binary-scoredf <- allbinary %>% mutate(yes.score = regist + protocol + me.search.avai + data.statem + + title.ident + + ab.sources + ab.eleg.crit + ab.included + in.picos + me.picos.desc + re.flowdia + + re.ssizes + re.lengths + fund.statem + coi.statem + ab.particip + re.picos.desc + + ab.interv + re.picos.desc + ab.outcome + me.stat.desc + me.heterog + re.estim.desc + + re.meta.studies + me.grey.lit + me.date.just + me.lang.num + me.sele.dup + me.extr.dup + + me.rob.desc + me.rob.dup +re.rob + re.deviations + di.spin + di.rob.studies + + di.limitations)

Comment: Create the histogram
Category: Visualization
Code:
histplot.score <- ggplot(binary-scoredf, aes(x=yes.score)) + geom_histogram(binwidth=1, color="black", fill="lightblue") histplot.score + scale_x_continuous(name="Number of recommended practices (max: 36 items)", breaks=seq(0,36,2)) + scale_y_continuous(name="Frequency of publications", limits=c(0, 20)) + theme(panel.grid.major = element_blank(), panel.grid.minor = element_blank(), panel.background = element_blank(), axis.line = element_line(colour = "black"))