File: MMCPSRAuthorAnalysis.R

Comment: change data type of PHDYEAR to numeric
Category: Data Variable
Code:
author_phd_data$PHDYEAR <-as.numeric(author_phd_data$PHDYEAR)

Comment: calculate seniority of each author at the time of each article
Category: Data Variable
Code:
author_phd_data$status_article1 <- ifelse(author_phd_data$PHDYEAR == 0 |author_phd_data$PHDYEAR > author_phd_data$Article.1.Year.published, "Grad Student", ifelse(author_phd_data$yrs_to_article1 == 0|author_phd_data$yrs_to_article1 < 7, "Junior Scholar", ifelse(author_phd_data$yrs_to_article1 > 6, "Senior Scholar", "NA"))) author_phd_data$status_article2 <- ifelse(author_phd_data$PHDYEAR == 0 |author_phd_data$PHDYEAR > author_phd_data$Article.2.Year.Published, "Grad Student", ifelse(author_phd_data$yrs_to_article2 == 0|author_phd_data$yrs_to_article2 < 7, "Junior Scholar", ifelse(author_phd_data$yrs_to_article2 > 6, "Senior Scholar", "NA"))) author_phd_data$status_article3 <- ifelse(author_phd_data$PHDYEAR == 0 |author_phd_data$PHDYEAR > author_phd_data$Article.3.Year.Published, "Grad Student", ifelse(author_phd_data$yrs_to_article3 == 0|author_phd_data$yrs_to_article3 < 7, "Junior Scholar", ifelse(author_phd_data$yrs_to_article3 > 6, "Senior Scholar", "NA"))) author_phd_data$status_article4 <- ifelse(author_phd_data$PHDYEAR == 0 |author_phd_data$PHDYEAR > author_phd_data$Article.4.Year.Published, "Grad Student", ifelse(author_phd_data$yrs_to_article4 == 0|author_phd_data$yrs_to_article4 < 7, "Junior Scholar", ifelse(author_phd_data$yrs_to_article4 > 6, "Senior Scholar", "NA"))) author_phd_data$status_article5 <- ifelse(author_phd_data$PHDYEAR == 0 |author_phd_data$PHDYEAR > author_phd_data$Article.5.Year.Published, "Grad Student", ifelse(author_phd_data$yrs_to_article5 == 0|author_phd_data$yrs_to_article5 < 7, "Junior Scholar", ifelse(author_phd_data$yrs_to_article5 > 6, "Senior Scholar", "NA"))) author_phd_data$status_article6 <- ifelse(author_phd_data$PHDYEAR == 0 |author_phd_data$PHDYEAR > author_phd_data$Article.6.Year.Published, "Grad Student", ifelse(author_phd_data$yrs_to_article6 == 0|author_phd_data$yrs_to_article6 < 7, "Junior Scholar", ifelse(author_phd_data$yrs_to_article6 > 6, "Senior Scholar", "NA"))) author_phd_data$status_article7 <- ifelse(author_phd_data$PHDYEAR == 0 |author_phd_data$PHDYEAR > author_phd_data$Article.7.Year.Published, "Grad Student", ifelse(author_phd_data$yrs_to_article7 == 0|author_phd_data$yrs_to_article7 < 7, "Junior Scholar", ifelse(author_phd_data$yrs_to_article7 > 6, "Senior Scholar", "NA"))) author_phd_data$status_article8 <- ifelse(author_phd_data$PHDYEAR == 0 |author_phd_data$PHDYEAR > author_phd_data$Article.8.Year.Published, "Grad Student", ifelse(author_phd_data$yrs_to_article8 == 0|author_phd_data$yrs_to_article8 < 7, "Junior Scholar", ifelse(author_phd_data$yrs_to_article8 > 6, "Senior Scholar", "NA"))) author_phd_data$status_article9 <- ifelse(author_phd_data$PHDYEAR == 0 |author_phd_data$PHDYEAR > author_phd_data$Article.9.Year.Published, "Grad Student", ifelse(author_phd_data$yrs_to_article9 == 0|author_phd_data$yrs_to_article9 < 7, "Junior Scholar", ifelse(author_phd_data$yrs_to_article9 > 6, "Senior Scholar", "NA"))) author_phd_data$status_article10 <- ifelse(author_phd_data$PHDYEAR == 0 |author_phd_data$PHDYEAR > author_phd_data$Article.10.Year.Published, "Grad Student", ifelse(author_phd_data$yrs_to_article10 == 0|author_phd_data$yrs_to_article10 < 7, "Junior Scholar", ifelse(author_phd_data$yrs_to_article10 > 6, "Senior Scholar", "NA")))

Comment: run check to see if any authors have missing data
Category: Data Variable
Code:
check <- subset(mmcpsr_authors, is.na(mmcpsr_authors$Title))