Skip to content

Commit

Permalink
Printed Output Edit
Browse files Browse the repository at this point in the history
1. Changed to "interchangeable if they are different"
2. Add rxcvGz and rycvGz description in the read file
  • Loading branch information
JihoonChoi26 committed Nov 11, 2024
1 parent 8998b87 commit 017c8a2
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 41 deletions.
78 changes: 37 additions & 41 deletions R/helper_output_print.R
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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")
Expand All @@ -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")
Expand All @@ -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")
Expand All @@ -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")
Expand All @@ -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")
Expand All @@ -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")
Expand All @@ -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")
Expand All @@ -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")
Expand Down
4 changes: 4 additions & 0 deletions man/output_print.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 017c8a2

Please sign in to comment.