matrices_from_df: List of matrices for SEM model

View source: R/SEM_likelihood.R

matrices_from_dfR Documentation

List of matrices for SEM model

Description

List of matrices for SEM model

Usage

matrices_from_df(
  df,
  timestamp_col,
  entity_col,
  dep_var_col,
  lin_related_regressors = NULL,
  which_matrices = c("Y1", "Y2", "Z", "cur_Y2", "cur_Z", "res_maker_matrix")
)

Arguments

df

Dataframe with data for the likelihood computations.

timestamp_col

Column which determines time stamps. For now only natural numbers can be used.

entity_col

Column which determines entities (e.g. countries, people)

dep_var_col

Column with dependent variable

lin_related_regressors

Vector of strings of column names. Which subset of regressors is in non trivial linear relation with the dependent variable (dep_var_col). In other words regressors with non-zero beta parameters.

which_matrices

character vector with names of matrices which should be computed. Possible matrices are "Y1", "Y2", "Z", "cur_Y2", "cur_Z", "res_maker_matrix". Default is c("Y1", "Y2", "Z", "cur_Y2","cur_Z", "res_maker_matrix") in which case all possible matrices are generated

Value

Named list with matrices as its elements

Examples

matrices_from_df(economic_growth, year, country, gdp, c("pop", "sed"),
                 c("Y1", "Y2"))

bdsm documentation built on April 4, 2025, 1:06 a.m.