diff --git a/R/helper_output_print.R b/R/helper_output_print.R index f578770..ea5c98c 100644 --- a/R/helper_output_print.R +++ b/R/helper_output_print.R @@ -32,6 +32,8 @@ #' @param R2 the unadjusted, original R2 in the observed function. #' @param rxcv the correlation between x and CV. #' @param rycv the correlation between y and CV. +#' @param rxcvGz the correlation between predictor of interest and CV necessary to nullify the inference for smallest impact, conditioning on all observed covariates. +#' @param rycvGz the correlation between outcome and CV necessary to nullify the inference for smallest impact, conditioning on all observed covariates. #' @importFrom crayon bold underline italic output_print <- function(n_covariates, @@ -175,9 +177,9 @@ output_print <- function(n_covariates, cat("\n") cat(paste0("with the outcome and ", round(rxcv, 3), " with the predictor of interest (BEFORE conditioning")) cat("\n") - cat(paste0("on observed covariates; signs are ", sign_interchangeable, "). This is based on a threshold")) + cat("on observed covariates; signs are interchangeable if they are different).") cat("\n") - cat(paste0("effect of ", round(critical_r, 3), " for statistical significance (alpha = ", alpha, ").\n")) + cat(paste0("This is based on a threshold effect of ", round(critical_r, 3), " for statistical significance (alpha = ", alpha, ").\n")) cat("\n") cat("Correspondingly the UNCONDITIONAL impact of an omitted variable (as defined in Frank 2000) must be") cat("\n") @@ -192,11 +194,11 @@ output_print <- function(n_covariates, cat("\n") cat(paste0("a null hypothesis of an effect of nu (", nu, ") is based on a correlation of ", round(rycvGz, 3))) cat("\n") - cat(paste0("with the outcome and ", round(rxcvGz, 3), " with the predictor of interest (conditioning")) + cat(paste0("with the outcome and ", round(rxcvGz, 3), " with the predictor of interest (conditioning on all")) cat("\n") - cat(paste0("on all observed covariates in the model; signs are ", sign_cond_interchangeable, "). This is")) + cat("observed covariates in the model; signs are interchangeable if they are different).") cat("\n") - cat(paste0("based on a threshold effect of ", round(critical_r, 3), " for statistical significance (alpha = ", alpha, ").\n")) + cat(paste0("This is based on a threshold effect of ", round(critical_r, 3), " for statistical significance (alpha = ", alpha, ").\n")) cat("\n") cat("Correspondingly the impact of an omitted variable (as defined in Frank 2000) must be ") cat("\n") @@ -208,15 +210,15 @@ output_print <- function(n_covariates, cat("Unconditional ITCV:") cat("\n") - cat("The minimum (in absolute value) impact of an omitted variable to invalidate") + cat("The minimum (in absolute value) impact of an omitted variable to invalidate an inference") cat("\n") - cat(paste0("an inference for a null hypothesis of an effect of nu (", nu, ") is based on")) + cat(paste0("for a null hypothesis of an effect of nu (", nu, ") is based on a correlation of ", round(rycv, 3), " with the")) cat("\n") - cat(paste0("a correlation of ", round(rycv, 3), " with the outcome and ", round(rxcv, 3), " with the predictor of")) + cat(paste0("outcome and ", round(rxcv, 3), " with the predictor of interest (BEFORE conditioning on observed covariates;")) cat("\n") - cat(paste0("interest (BEFORE conditioning on observed covariates; signs are ", sign_interchangeable, ").")) + cat(paste0("signs are interchangeable if they are different). This is based on a threshold effect of ", round(critical_r, 3))) cat("\n") - cat(paste0("This is based on a threshold effect of ", round(critical_r, 3), " for statistical significance (alpha = ", alpha, ").\n")) + cat(paste0("for statistical significance (alpha = ", alpha, ").\n")) cat("\n") cat("Correspondingly the UNCONDITIONAL impact of an omitted variable (as defined in Frank 2000) must be") cat("\n") @@ -228,17 +230,15 @@ output_print <- function(n_covariates, } - cat("The minimum (in absolute value) impact of an omitted variable to invalidate") + cat("The minimum (in absolute value) impact of an omitted variable to invalidate an inference") cat("\n") - cat(paste0("an inference for a null hypothesis of an effect of nu (", nu, ") is based on")) + cat(paste0("for a null hypothesis of an effect of nu (", nu, ") is based on a correlation of ", round(rycvGz, 3), " with the")) cat("\n") - cat(paste0("a correlation of ", round(rycvGz, 3), " with the outcome and ", round(rxcvGz, 3), " with the predictor of")) + cat(paste0("outcome and ", round(rxcvGz, 3), " with the predictor of interest (conditioning on all observed covariates")) cat("\n") - cat("interest (conditioning on all observed covariates in the model; signs are") + cat("in the model; signs are interchangeable if they are different). This is based on a threshold") cat("\n") - cat(paste0(sign_cond_interchangeable, "). This is based on a threshold effect of ", round(critical_r, 3), " for statistical")) - cat("\n") - cat("significance (alpha = ", alpha, ").\n", sep = "") + cat(paste0("effect of ", round(critical_r, 3), " for statistical significance (alpha = ", alpha, ").\n", sep = "")) cat("\n") cat("Correspondingly the impact of an omitted variable (as defined in Frank 2000) must be") cat("\n") @@ -250,17 +250,15 @@ output_print <- function(n_covariates, cat("Unconditional ITCV:") cat("\n") - cat("The maximum impact (in absolute value) of an omitted variable to sustain") - cat("\n") - cat(paste0("an inference for a null hypothesis of an effect of nu (", nu, ") is based on")) + cat("The maximum impact (in absolute value) of an omitted variable to sustain an inference") cat("\n") - cat(paste0("a correlation of ", round(rycv, 3), " with the outcome and ", round(rxcv, 3), " with the predictor")) + cat(paste0("for a null hypothesis of an effect of nu (", nu, ") is based on a correlation of ", round(rycv, 3), " with")) cat("\n") - cat("of interest (BEFORE conditioning on observed covariates; signs are") + cat(paste0("the outcome and ", round(rxcv, 3), " with the predictor of interest (BEFORE conditioning on observed")) cat("\n") - cat(paste0(sign_interchangeable, "). This is based on a threshold effect of ", round(beta_threshhold, 3), " for")) + cat("covariates; signs are interchangeable if they are different). This is based on a threshold") cat("\n") - cat("statistical significance (alpha = ", alpha, ").\n", sep = "") + cat(paste0("effect of ", round(beta_threshhold, 3), " for statistical significance (alpha = ", alpha, ").\n", sep = "")) cat("\n") cat("Correspondingly the UNCONDITIONAL impact of an omitted variable (as defined in Frank 2000) must be ") cat("\n") @@ -271,17 +269,15 @@ output_print <- function(n_covariates, cat("\n") } - cat("The maximum impact (in absolute value) of an omitted variable to sustain") + cat("The maximum impact (in absolute value) of an omitted variable to sustain an inference") cat("\n") - cat(paste0("an inference for a null hypothesis of an effect of nu (", nu, ") is based on")) + cat(paste0("for a null hypothesis of an effect of nu (", nu, ") is based on a correlation of ", round(rycvGz, 3), " with")) cat("\n") - cat(paste0("a correlation of ", round(rycvGz, 3), " with the outcome and ", round(rxcvGz, 3), " with the predictor")) + cat(paste0("the outcome and ", round(rxcvGz, 3), " with the predictor of interest (conditioning on all observed")) cat("\n") - cat("of interest (conditioning on all observed covariates in the model;") + cat("covariates in the model; signs are interchangeable if they are different). This is") cat("\n") - cat(paste0("signs are ", sign_cond_interchangeable, "). This is based on a threshold effect of ", round(beta_threshhold, 3))) - cat("\n") - cat("for statistical significance (alpha = ", alpha, ").\n", sep = "") + cat(paste0("based on a threshold effect of ", round(beta_threshhold, 3), " for statistical significance (alpha = ", alpha, ").\n", sep = "")) cat("\n") cat("Correspondingly the impact of an omitted variable (as defined in Frank 2000) must be ") cat("\n") @@ -293,15 +289,15 @@ output_print <- function(n_covariates, cat("Unconditional ITCV:") cat("\n") - cat("The maximum impact of an omitted variable to sustain an inference for") + cat("The maximum impact of an omitted variable to sustain an inference for a null hypothesis") cat("\n") - cat(paste0("a null hypothesis of an effect of nu (", nu, ") is based on a correlation of ", round(rycv, 3))) + cat(paste0("of an effect of nu (", nu, ") is based on a correlation of ", round(rycv, 3), " with the outcome and ", round(rxcv, 3))) cat("\n") - cat(paste0("with the outcome and ", round(rxcv, 3), " with the predictor of interest (BEFORE conditioning")) + cat(paste0("with the predictor of interest (BEFORE conditioning on observed covariates; signs are")) cat("\n") - cat(paste0("on observed covariates; signs are ", sign_interchangeable, "). This is based on a threshold")) + cat(paste0("interchangeable if they are different). This is based on a threshold effect of ", round(beta_threshhold, 3))) cat("\n") - cat(paste0("effect of ", round(beta_threshhold, 3), " for statistical significance (alpha = ", alpha, ").\n")) + cat(paste0("for statistical significance (alpha = ", alpha, ").\n")) cat("\n") cat("Correspondingly the UNCONDITIONAL impact of an omitted variable (as defined in Frank 2000) must be ") cat("\n") @@ -312,15 +308,15 @@ output_print <- function(n_covariates, cat("\n") } - cat("The maximum impact of an omitted variable to sustain an inference for") + cat("The maximum impact of an omitted variable to sustain an inference for a null hypothesis") cat("\n") - cat(paste0("a null hypothesis of an effect of nu (", nu, ") is based on a correlation of ", round(rycvGz, 3))) + cat(paste0("of an effect of nu (", nu, ") is based on a correlation of ", round(rycvGz, 3), " with the outcome and ", round(rxcvGz, 3))) cat("\n") - cat(paste0("with the outcome and ", round(rxcvGz, 3), " with the predictor of interest (conditioning")) + cat(paste0("with the predictor of interest (conditioning on all observed covariates in the model;")) cat("\n") - cat(paste0("on all observed covariates in the model; signs are ", sign_cond_interchangeable, "). This is")) + cat("signs are interchangeable if they are different). This is based on a threshold effect of") cat("\n") - cat(paste0("based on a threshold effect of ", round(beta_threshhold, 3), " for statistical significance (alpha = ", alpha, ").\n")) + cat(paste0(round(beta_threshhold, 3), " for statistical significance (alpha = ", alpha, ").\n")) cat("\n") cat("Correspondingly the impact of an omitted variable (as defined in Frank 2000) must be ") cat("\n") diff --git a/man/output_print.Rd b/man/output_print.Rd index 1131662..e6cb9ea 100644 --- a/man/output_print.Rd +++ b/man/output_print.Rd @@ -70,6 +70,10 @@ statistical significance determination.} \item{rxcv}{the correlation between x and CV.} \item{rycv}{the correlation between y and CV.} + +\item{rxcvGz}{the correlation between predictor of interest and CV necessary to nullify the inference for smallest impact, conditioning on all observed covariates.} + +\item{rycvGz}{the correlation between outcome and CV necessary to nullify the inference for smallest impact, conditioning on all observed covariates.} } \description{ This function outputs printed text for various indices such as RIR