add_metrics {RCTS}R Documentation

Adds several metrics to df_results.

Description

Adds several metrics to df_results.

Usage

add_metrics(
  df_results,
  index_configuration,
  pic_sigma2,
  beta_est,
  g,
  comfactor,
  lambda,
  factor_group,
  lambda_group,
  iteration,
  g_true = NA,
  add_rand = FALSE
)

Arguments

df_results

dataframe with results for each estimated configuration

index_configuration

index of the configuration of groups and factors

pic_sigma2

sum of squared errors divided by NT

beta_est

estimated values of beta

g

Vector with estimated group membership for all individuals

comfactor

estimated common factors

lambda

loadings of the estimated common factors

factor_group

estimated group specific factors

lambda_group

loadings of the estimated group specific factors

iteration

number of iteration

g_true

vector of length NN with true group memberships

add_rand

adds the adjusted randindex to the df (requires the mclust package); used for simulations

Value

data.frame with final estimations of each configuration

Examples

df_results <- add_configuration(initialise_df_results(TRUE),
  3, 0, c(3, 3, 3, rep(NA, 17))) #data.frame with one configuration
add_metrics(df_results, 1, 3.94, NA, round(runif(30, 1, 3)), NA, NA, NA, NA, 9)

[Package RCTS version 0.2.4 Index]