grid_add_variables {RCTS}R Documentation

Function which is used to have a dataframe (called "grid") with data (individualindex, timeindex, XT and LF) available.

Description

It is used in iterate().

Usage

grid_add_variables(
  grid,
  Y,
  X,
  beta_est,
  g,
  lambda,
  comfactor,
  method_estimate_beta,
  vars_est,
  S,
  limit_est_groups_heterogroups = 15
)

Arguments

grid

dataframe containing values for X*beta_est and LF (product of common factor and its loadings)

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 estimated group membership for all individuals

lambda

loadings of the estimated common factors

comfactor

estimated common factors

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".

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.

S

number of estimated groups

limit_est_groups_heterogroups

maximum amount of groups that can be estimated when method_estimate_beta is set to "group"

Value

data.frame


[Package RCTS version 0.2.4 Index]