pcFit: Projection clustering function

Description Usage Arguments Value See Also Examples

View source: R/pcFit.R

Description

Compute LMM fitted values based on posterior mean output of parameters, with chosen random effects to project on.

Usage

1
pcFit(id_var, ls_par, dat, ls_idxA)

Arguments

id_var

Character of id variable

ls_par

Posterior mean of LMM parameters generated from postMean output

dat

Longitudinal data input

ls_idxA

List of random effect indices to project on

Value

Matrix containing fitted values, with each column corresponding to a set of chosen random effects indices specified in ls_idxA

See Also

Other BayesPC main functions: clustKL(), modelStan(), postMean()

Examples

1
2
3
4
5
6
7
8
9
data(df_of_draws)
ls_par <- postMean(df_of_draws, paste0("Z", 1:10), "ID", DATASET)
ls_idxA <- list(
  seq(10),
  1:4,
  5:7,
  8:10
)
mat_fitted <- pcFit("ID", ls_par, DATASET, ls_idxA)

maoyinan/BayesPC documentation built on Dec. 21, 2021, 1:48 p.m.