swh:1:snp:9492dda1ea1583c5fa5285d6ddcd2ab9f57129b4
Raw File
Tip revision: 256eb1eaaa97805c6f0501eebd9a6f8791279ef7 authored by Patrick Mair on 15 March 2024, 08:36:29 UTC
version 1.0-6
Tip revision: 256eb1e
LLRA.R
LLRA <- function(X, W, mpoints, groups, baseline=NULL, itmgrps=NULL,...)
{
  if(missing(mpoints)) stop("Please specify the number of time points. If there are none, you might want to try PCM() or LPCM().")
  Xprep <- llra.datprep(X,mpoints,groups,baseline)
  itmgrps <- rep(1:Xprep$nitems) 
  groupvec <- Xprep$assign.vec
  pplgrps <- length(Xprep$grp_n)
  if(missing(W)) W <- build_W(Xprep$X,length(unique(itmgrps)),mpoints,Xprep$grp_n,groupvec,itmgrps)
  fit <- LPCM(Xprep$X,W,mpoints=mpoints,groupvec=groupvec,sum0=FALSE)
  refg <- unique(names(which(groupvec==max(groupvec))))
  out <- c(fit,"itms"=Xprep$nitems,"refGroup"=refg)
  out$call <- match.call()
  class(out) <- c("llra","Rm","eRm")
  cat("Reference group: ",refg,"\n\n")
  return(out)
}
back to top