R/visualisations.R
plot_estimates_vs_true.Rd
Creates a scatterplot of true effect sizes against estimated effect sizes.
plot_estimates_vs_true( dataset, BETA, P, bonferroni, true_effect, save_plot_path = FALSE, plot_filename = "beta_comparison.png" )
dataset | data imported to R by |
---|---|
BETA | column containing the estimated effect sizes from the analysis. State in the format dataset$BETA. |
P | column containing the p-values from the analysis. State in the format dataset$P. |
bonferroni | the column containing significance at bonferroni correction. State in the format dataset$bonferroni. |
true_effect | the column containing the true effect sizes.
State in the format dataset$true_effect. Note: standard called 'beta' if
loaded by |
save_plot_path | if |
plot_filename | name of the file to be saved, including file extension. Must be either .pdf, .png or .jpeg |
Either returns a ggplot
object or saves the plot to
save_plot_path
and returns NULL.
In the plot an identity line is included, which helps visualise how well
the estimations compare to the true effect sizes.
Only SNPs with a p-value smaller than 0.05 are included in the plot.
The plot requires the user to run an analysis with
analysis_association()
, load the results and merge with
beta.txt
using load_results()
and augment results with
augment_results()
.