R/phase4_onet.R

Defines functions phase4_onet

Documented in phase4_onet

#' Rescale the re-weighted O-NET data
#'
#' This function takes the reweighted data and rescales the ratings provided by job incumbents to make them consistent with the ratings provided by
#' occupational experts and job analysts.
#'
#'  A list containing four data frames:
#' @param p3
#' - The object produced by `phase3_onet()`
#'
#' @return A list of dataframes of panels for each of the O-NET domains, now rescaled and includes both the rescaled and raw versions of the data
#' - `skills.raw``
#' - `skills.rescaled`
#' - `abilities.raw`
#' - `abilities.rescaled`
#' - `activities.raw`
#' - `activities.rescaled`
#'
#' @export
phase4_onet <- function(p3=NULL) {

print(paste0("Phase 4 of 6: Now Running Skill Regressions and Rescaling"))
  rescaled.skills     <- rescale_skills(p3)

print(paste0("Phase 4 of 6: Now Running Ability Regressions and Rescaling"))
  rescaled.abilities  <- rescale_abilities(p3)

print(paste0("Phase 4 of 6: Now Running Work Activity Regressions and Rescaling"))
  rescaled.activities <- rescale_activities(p3)

print(paste0("Phase 4 of 6: Now Running Work Context Regressions and Rescaling"))
  rescaled.contexts <- rescale_contexts(p3)


return(list(skills.raw          = as.data.frame(rescaled.skills[["skill.raw"]]),
            skills.rescaled     = as.data.frame(rescaled.skills[["skill"]]),
            abilities.raw       = as.data.frame(rescaled.abilities[["abilities.raw"]]),
            abilities.rescaled  = as.data.frame(rescaled.abilities[["abilities"]]),
            activities.raw      = as.data.frame(rescaled.activities[["activities.raw"]]),
            activities.rescaled = as.data.frame(rescaled.activities[["activities"]]),
            contexts.raw        = as.data.frame(rescaled.contexts[["context.raw"]]),
            contexts.rescaled   = as.data.frame(rescaled.contexts[["context"]])
            ))
}
djmorris1989/onetmappinguk documentation built on June 14, 2020, 10:04 a.m.