plot_covariance: Plot Covariance between predictor (components) and response...

Description Usage Arguments Value Examples

View source: R/plotting-functions.R

Description

Plot Covariance between predictor (components) and response (components)

Usage

1
2
3
4
5
6
7
plot_covariance(
  sigma_df,
  lambda_df = NULL,
  base_theme = theme_grey,
  lab_list = NULL,
  theme_list = NULL
)

Arguments

sigma_df

A data.frame generated by tidy_sigma

lambda_df

A data.frame generated by tidy_lambda

base_theme

Base ggplot theme to apply

lab_list

List of labs arguments such as x, y, title, subtitle

theme_list

List of theme arguments to apply in the plot

Value

A plot of true regression coefficients for the simulated data

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
sobj <- bisimrel(p = 12)
sigma_df <- sobj %>%
    cov_mat(which = "zy") %>%
    tidy_sigma() %>%
    abs_sigma()
lambda_df <- sobj %>%
    tidy_lambda()
plot_covariance(
    sigma_df,
    lambda_df,
    base_theme = ggplot2::theme_bw,
    lab_list = list(
        title = "Covariance between Response and Predictor Components",
        subtitle = "The bar represents the eigenvalues predictor covariance",
        y = "Absolute covariance",
        x = "Predictor Component",
        color = "Response Component"
    ),
    theme_list = list(
        legend.position = "bottom"
    )
)

simulatr/simrel documentation built on Sept. 15, 2021, 12:44 a.m.