Learn R Programming

fmi (version 0.1.7)

test_scalar: Test for Scalar Invariance

Description

Permutation test to check if the mean functions (intercepts) are equivalent across groups, after accounting for latent factors.

Usage

test_scalar(Y_mat, group_vec, argvals, pooled_fpca, n_perms, alpha, progress)

Value

A list with passed (boolean), p_value, and statistic.

Arguments

Y_mat

Numeric matrix (N x M).

group_vec

A vector of length N specifying group membership.

argvals

Numeric vector of length M.

pooled_fpca

The fpca.sc object from the determine_npc function.

n_perms

Integer, number of permutations.

alpha

Significance level (default: 0.05).

progress

Boolean, show progress bar? (default: interactive()).

Examples

Run this code
# \donttest{
  sim <- simulate_fmi_data(N_A = 20, N_B = 20, T_points = 30)
  npc_info <- determine_npc(sim$Y_mat, sim$argvals, max_npc = 3)
  res <- test_scalar(sim$Y_mat, sim$group_vec, sim$argvals,
                     pooled_fpca = npc_info$pooled_fpca,
                     n_perms = 9, alpha = 0.05, progress = FALSE)
  print(res$p_value)
# }

Run the code above in your browser using DataLab