I tried the common factor model without SNP effects. It had problems with convergence (see below):
> commonfactor_DWLS <- commonfactor(covstruc = LDSCoutput, estimation="DWLS")
[1] "The common factor initially failed to converge. A lower bound of 0 on residual variances has been added to try and troubleshoot this."
[1] "The common factor model failed to converge on a solution. Please try specifying an alternative model using the usermodel function."
Error in lav_fit_measures(object = object, fit.measures = fit.measures, :
lavaan ERROR: fit measures not available if model did not converge
I also used the first 100 snps in the common factor gwas with a cluster of 38 cpus. And it had 38 warnings below. I think these warnings were related to the 38 cores requested and caused by the failure to converge as indicated above.
> SNPs <- commonfactor_sumstats[1:100, ]
> cores <- 38
> covstruc <- LDSCoutput
> snp100_commonfactor_gwas <- commonfactorGWAS(covstruc = covstruc, SNPs = SNPs, cores=cores)
[1] "Please note that an update was made to commonfactorGWAS on 11/21/19 so that it combines addSNPs and commonfactorGWAS."
This is lavaan 0.6-5
lavaan is BETA software! Please report any bugs.
elapsed
37.7
There were 38 warnings (use warnings() to see them)
> warnings()
Warning messages:
1: In for (i in 1:length(args)) { ... :
closing unused connection 40 (<-localhost:11471)
2: In for (i in 1:length(args)) { ... :
closing unused connection 39 (<-localhost:11471)
3: In for (i in 1:length(args)) { ... :
closing unused connection 38 (<-localhost:11471)
4: In for (i in 1:length(args)) { ... :
closing unused connection 37 (<-localhost:11471)
5: In for (i in 1:length(args)) { ... :
closing unused connection 36 (<-localhost:11471)
6: In for (i in 1:length(args)) { ... :
closing unused connection 35 (<-localhost:11471)
7: In for (i in 1:length(args)) { ... :
closing unused connection 34 (<-localhost:11471)
8: In for (i in 1:length(args)) { ... :
closing unused connection 33 (<-localhost:11471)
9: In for (i in 1:length(args)) { ... :
closing unused connection 32 (<-localhost:11471)
10: In for (i in 1:length(args)) { ... :
closing unused connection 31 (<-localhost:11471)
11: In for (i in 1:length(args)) { ... :
closing unused connection 30 (<-localhost:11471)
12: In for (i in 1:length(args)) { ... :
closing unused connection 29 (<-localhost:11471)
13: In for (i in 1:length(args)) { ... :
closing unused connection 28 (<-localhost:11471)
14: In for (i in 1:length(args)) { ... :
closing unused connection 27 (<-localhost:11471)
15: In for (i in 1:length(args)) { ... :
closing unused connection 26 (<-localhost:11471)
16: In for (i in 1:length(args)) { ... :
closing unused connection 25 (<-localhost:11471)
17: In for (i in 1:length(args)) { ... :
closing unused connection 24 (<-localhost:11471)
18: In for (i in 1:length(args)) { ... :
closing unused connection 23 (<-localhost:11471)
19: In for (i in 1:length(args)) { ... :
closing unused connection 22 (<-localhost:11471)
20: In for (i in 1:length(args)) { ... :
closing unused connection 21 (<-localhost:11471)
21: In for (i in 1:length(args)) { ... :
closing unused connection 20 (<-localhost:11471)
22: In for (i in 1:length(args)) { ... :
closing unused connection 19 (<-localhost:11471)
23: In for (i in 1:length(args)) { ... :
closing unused connection 18 (<-localhost:11471)
24: In for (i in 1:length(args)) { ... :
closing unused connection 17 (<-localhost:11471)
25: In for (i in 1:length(args)) { ... :
closing unused connection 16 (<-localhost:11471)
26: In for (i in 1:length(args)) { ... :
closing unused connection 15 (<-localhost:11471)
27: In for (i in 1:length(args)) { ... :
closing unused connection 14 (<-localhost:11471)
28: In for (i in 1:length(args)) { ... :
closing unused connection 13 (<-localhost:11471)
29: In for (i in 1:length(args)) { ... :
closing unused connection 12 (<-localhost:11471)
30: In for (i in 1:length(args)) { ... :
closing unused connection 11 (<-localhost:11471)
31: In for (i in 1:length(args)) { ... :
closing unused connection 10 (<-localhost:11471)
32: In for (i in 1:length(args)) { ... :
closing unused connection 9 (<-localhost:11471)
33: In for (i in 1:length(args)) { ... :
closing unused connection 8 (<-localhost:11471)
34: In for (i in 1:length(args)) { ... :
closing unused connection 7 (<-localhost:11471)
35: In for (i in 1:length(args)) { ... :
closing unused connection 6 (<-localhost:11471)
36: In for (i in 1:length(args)) { ... :
closing unused connection 5 (<-localhost:11471)
37: In for (i in 1:length(args)) { ... :
closing unused connection 4 (<-localhost:11471)
38: In for (i in 1:length(args)) { ... :
closing unused connection 3 (<-localhost:11471)
I'll try usermodel and post the results.
Many thanks,
patrick