user23404792
user23404792

Reputation: 1

Why my temporal network matrix has 5 NaN data columns?

I am estimating a fully idiographic (N = 1) temporal unregularized network model, using gvar (psychonetrics). data is the name of my dataset with the first, second and third colums as subject, day and beep. Then, the other 6 columns are the EMA variables collected in the subject. 70 datapoints are measured (5 beeps per 14 days) However, once I estimate the network, the matrix shows NaN in 5 of the 6 colums. Have I done some mistake? Every help is appreciated. It's the first time it's happening to me with one of my subjects.

Here the output matrix:

             [,1] [,2] [,3] [,4] [,5] [,6]                                                       [1,] -0.14935668  NaN  NaN  NaN  NaN  NaN
[2,]  0.31337746  NaN  NaN  NaN  NaN  NaN
[3,]  0.13307204  NaN  NaN  NaN  NaN  NaN
[4,]  0.09941676  NaN  NaN  NaN  NaN  NaN
[5,] -0.21538628  NaN  NaN  NaN  NaN  NaN
[6,]  0.04097002  NaN  NaN  NaN  NaN  NaN

Here the R code I have used:

#Check of missing data: present data compared to the full dataset (over 100%)
nrow(na.omit(data[,vars[1]])) / nrow(data)
#Results: 0.9

#Select the variables
vars <- colnames(data[,4:9]) 

#select dayvar and beepvar
dayvar <- colnames(data[,2])
beepvar <- colnames(data[,3])

#Specify the model
mod <- gvar(data, vars = vars, 
            dayvar = dayvar, 
            beepvar = beepvar, 
            estimator = "FIML")

#Estimate the unregularized model
mod <- mod %>% runmodel

#Standardized temporal network
TempNet <- getmatrix(mod, matrix = "PDC") 

#Plot temporal network using qgraph
qgraph(TempNet, labels = vars, 
       theme = "colorblind", layout = "circle")
    
    

Upvotes: 0

Views: 42

Answers (1)

Sacha Epskamp
Sacha Epskamp

Reputation: 47602

This has to do with the starting values that are not very good at the moment. The next version of psychonetrics will have better starting values! For now, standardizing the data with standardize = "z" in gvar(...) seems to work.

Upvotes: 0

Related Questions