calculate_W: Calculates W = Y - X*beta_est. It is used in the...

View source: R/03_IFE_algorithm_functions.R

calculate_WR Documentation

Calculates W = Y - X*beta_est. It is used in the initialization step of the algorithm, to initialise the factorstructures.

Description

Calculates W = Y - X*beta_est. It is used in the initialization step of the algorithm, to initialise the factorstructures.

Usage

calculate_W(Y, X, beta_est, g, vars_est, method_estimate_beta)

Arguments

Y

Y: NxT dataframe with the panel data of interest

X

X: NxTxp array containing the observable variables

beta_est

estimated values of beta

g

Vector with group membership for all individuals

vars_est

number of variables that will be included in the algorithm and have their coefficient estimated. This is usually equal to the number of observable variables.

method_estimate_beta

defines how beta is estimated. Default case is an estimated beta for each individual. Default value is "individual." Possible values are "homogeneous", "group" or "individual".

Value

NxT matrix


eh-in-r/RCTS documentation built on May 19, 2023, 1:09 p.m.