AnieBee / LCVAR

Other
6 stars 2 forks source link

Non-conformable arrays? #1

Closed Gryphire closed 3 years ago

Gryphire commented 3 years ago

Hi!

First off, thanks for building this interesting new analysis method, I am really excited to give it a try. However, in my own ESM data I can't seem to get it working. After having adjusted for every participant having at least 13 observations, I get this error.

"Error in Snum + (FZY[i, j] * (U[, (PersStartU[[Lags[j]]][i]):(PersEndU[[Lags[j]]][i]), : non-conformable arrays"

Any thoughts on why this might be and how to solve it? I specified the model as follows:

LCVAR_result <- LCVARclust(Data=df_ema_lcvar_ppwith13ormore,
                           yVars=3, #PA
                           Time=2, #id_file
                           ID=1, #ppID
                           Covariates = "equal-within-clusters",
                           Clusters = 2, 
                           LowestLag = 1, 
                           HighestLag = 2, 
                           smallestClN = 3,
                           ICType = "HQ", 
                           seme = 3, 
                           Rand = 2, 
                           Rational = TRUE, 
                           SigmaIncrease = 10, 
                           it = 25, 
                           Conv = 1e-06, 
                           xContinuous = 7:9, #selfcomp, rejectsens, fomo
                           xFactor = 4:6) #socMediaQuality, socMediaContacts, socMediaActivities

See the screenshot for an idea of the data structure. image

Any help would be very much appreciated, thanks!

AnieBee commented 3 years ago

Hi,

Thank you very much for making such a clear issue report! This issue arises because you use only a single endogenous variable (i.e, yVars), at the moment the function is implemented only for multiple endogenous variables not for single endogenous variables. I have now added an error message for univariate datasets to make this clear.

I am unsure when/whether the function will be extended to include single endogenous variables. But: the LCVAR model is the multivariate extension of a model proposed in https://doi.org/10.1007/s00357-016-9216-4, if you are interested in fitting the univariate model you could contact the authors, maybe they are willing to share their analysis code with you.

Good luck!

-Anja