compute_matrix_product: Take a matrix product of data matrix (X_df) and coefficient...

Description Usage Arguments Value Examples

View source: R/helpers.R

Description

Given a data matrix (X_df) and a coefficient matrix (beta_df), compute the matrix product. You can specify the set of variables (variables) to focus if you don't want to use all the data in the beta_df.

Usage

1
2
3
4
5
6
7
compute_matrix_product(
  X_df,
  beta_df,
  variables = NULL,
  beta_estimate_cols = c("estimate"),
  beta_variable_col = "variable"
)

Arguments

X_df

A data frame containing the dataset (X)

beta_df

A string representing a regression formula

variables

A subset of variables you'd like to take the product on

beta_estimate_cols

The set of column names of the beta_df that contains the values of the coefficients.

beta_variable_col

The column name of the beta_df that contains the variable name.

Value

a data frame containing the results of XB

Examples

1
2
3
4
## Not run: 
compute_matrix_product(data_df, glm_fit_df, c('age', 'sex'), c('estimate'), 'variable')

## End(Not run)

rivas-lab/snpnet documentation built on Dec. 14, 2021, 3:22 a.m.