Calculates Z = Y - X*beta_est - LF. It is used to estimate the groupfactorstructure.
calculate_Z_group(
Y,
X,
beta_est,
g,
lambda,
comfactor,
group,
k,
method_estimate_beta,
initialise,
vars_est
)NxT matrix
Y: NxT dataframe with the panel data of interest
X: NxTxp array containing the observable variables
estimated values of beta
Vector with group membership for all individuals
loadings of the estimated common factors
estimated common factors
indexnumber of the group
number of common factors to be estimated
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".
indicator of being in the initialisation phase
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.