ICTatRTI / PersonAlytics

PersonAlytics: Analytics for single-case and small N intensive longitudinal designs, idiographic clinical trials (ICT), and interrupted time series.
3 stars 2 forks source link

redundant code in `pa1` and `htp` #27

Closed stueller closed 3 years ago

stueller commented 3 years ago

allow for formula override so that we can test intercept only and

  # slope only models
  if( any(unlist(lapply(userFormula, function(x) !is.null(x)))) )
  {
    isnnform <- function(x)
    {
      if( !is.null(x) )
      {
        return( is.formula(x) )
      }
      else return(FALSE)
    }
    if( isnnform(e$userFormula$fixed) ) t0$fixed <- userFormula$fixed
    if( isnnform(e$userFormula$random) ) t0$random <- userFormula$random
    if( isnnform(e$userFormula$formula) ) t0$formula <- userFormula$formula
  }
stueller commented 3 years ago

implemented as Palytic$set("public", "applyUserFormula",...