This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Define the helper functions --------------------------- | |
# https://stats.stackexchange.com/questions/83826/is-a-weighted-r2-in-robust-linear-model-meaningful-for-goodness-of-fit-analys/87085 | |
r2w <- function(model, observed){ | |
SSe <- sum(model$w * (model$resid) ^ 2) | |
observed <- model$resid+model$fitted | |
SSt <- sum((model$w * observed - mean(model$w * observed)) ^ 2) | |
value <- 1 - SSe / SSt; | |
return(value) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Define the helper functions --------------------------- | |
# https://stats.stackexchange.com/questions/83826/is-a-weighted-r2-in-robust-linear-model-meaningful-for-goodness-of-fit-analys/87085 | |
r2w <- function(model, observed){ | |
SSe <- sum(model$w * (model$resid) ^ 2) | |
observed <- model$resid+model$fitted | |
SSt <- sum((model$w * observed - mean(model$w * observed)) ^ 2) | |
value <- 1 - SSe / SSt; | |
return(value) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#' Function to calculate equivalent black carbon (EBC) components with the | |
#' aethalometer model. | |
#' | |
#' @param df Data frame/tibble containing aethalometer absorption observations. | |
#' See examples for details of format required. | |
#' | |
#' @param uv Name of variable/column in \code{df} to be used for the UV | |
#' absorption. | |
#' | |
#' @param ir Name of variable/column in \code{df} to be used for the IR |