Error in inspect(ModelQ_Results_WLS, "se") : object 'ModelQ_Results_WLS' not found

117 views
Skip to first unread message

Jerome Foo

unread,
Mar 16, 2021, 6:38:37 PM3/16/21
to Genomic SEM Users
Hello! 

I'm just trying to run the most basic mediation model using 3 sumstats files as specified in the tutorial. The LDSC function seems to work but I keep getting the error message:

Error in inspect(ModelQ_Results_WLS, "se") : 
  object 'ModelQ_Results_WLS' not found

at the step:

[1] "Calculating model chi-square"

(I also get the same message when trying the basic 'Direct' model.)

I've verified that there are no spelling mistakes anywhere....I've more or less just copy and pasted the code in the tutorial.  Any ideas what might be going wrong?

Thank you very much in advance!

Best,
Jerome Foo


agro...@gmail.com

unread,
Mar 16, 2021, 7:13:26 PM3/16/21
to Genomic SEM Users
Hi Jerome, 

See the response to the post in the link below; the error has to do with a recent update to lavaan. I'm working on putting in the patches for this over the next week, but in the meantime you can download the previous version of lavaan and it should run ok. Apologies for the inconvenience and I'll post back here when the code fix is in!


Best, 
 Andrew

Tetyana Zayats

unread,
Mar 17, 2021, 12:28:31 AM3/17/21
to 'qh...@wisc.edu' via Genomic SEM Users
Hi,

I was wondering if I could ask for some help to code the attached model in genomicSEM?
I’d like to estimate the alpha, beta and gamma, but struggle to specify the h2 shared between trait 1 and trait 2.
Any help would be greatly appreciated!
Many thanks,
Tetyana
SEM model.pdf

Jerome Foo

unread,
Mar 17, 2021, 1:21:08 AM3/17/21
to Genomic SEM Users
Hi Andrew,

Thank you so much for your quick reply, I really appreciate it! No need for apologies at all- sorry for not noticing the other thread, I'm just trying genomic sem for the first time! I'll give the older lavaan version a try.
Thanks again for your help.

Best regards,
Jerome

Elliot Tucker-Drob

unread,
Mar 17, 2021, 9:46:01 AM3/17/21
to Tetyana Zayats, 'qh...@wisc.edu' via Genomic SEM Users

Hi Tetyena,

It looks like you are trying to estimate a model with more free parameters than pieces of information contained in your genetic covariance matrix. Various issues similar to this have come up on our google group before. I would suggest you look through some of our previous google group threads and perhaps review a book on SEM, as this is not an issue specific to Genomic SEM. I would recommend the book by Kline.

This classic note by Loehlin may also be of relevance: 

Finally, the Qtrait statistic that we introduce in this preprint may be suited toward your needs: 

Elliot
--
You received this message because you are subscribed to the Google Groups "Genomic SEM Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to genomic-sem-us...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/genomic-sem-users/482261FC-BF75-471D-A102-884521A26F96%40broadinstitute.org.


--
You received this message because you are subscribed to the Google Groups "Genomic SEM Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to genomic-sem-us...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/genomic-sem-users/482261FC-BF75-471D-A102-884521A26F96%40broadinstitute.org.
--
--
Elliot M. Tucker-Drob, Ph.D.
Professor
Department of Psychology
Faculty Research Associate
Population Research Center
The University of Texas at Austin
108 E. Dean Keeton Stop A8000
Austin, TX 78712-0187
tucke...@utexas.edu
www.lifespanlab.com

Michel Nivard

unread,
Mar 17, 2021, 1:13:53 PM3/17/21
to Elliot Tucker-Drob, Tetyana Zayats, 'qh...@wisc.edu' via Genomic SEM Users
Ho Tetyana,

I think it might help if we knew what quantity you were interested in specifically, also I think I may be involved in this project directly? If so feel free to email me and we can discuss outside the group, idf not you can choose to explain what you want to estimate precisely her or via email

As Elliot said, your current model has more free parameters (5) pertaining to the covariance between traits then the pieces of information/covariances you put in(3), so you'll have to put in some constraints.

Best,
Michel






Tetyana Zayats

unread,
Mar 17, 2021, 2:02:47 PM3/17/21
to Michel Nivard, Elliot Tucker-Drob, 'qh...@wisc.edu' via Genomic SEM Users
Hi Elliot and Michel,

Thank you for your thoughts and suggestions.
I will follow up with Michel directly.

Many thanks for your help,
Tetyana

Katerina Zorina-Lichtenwalter

unread,
Mar 22, 2021, 2:12:00 PM3/22/21
to Genomic SEM Users
Hi Andrew,

Joining the conversation on the error:

Error in inspect(ModelQ_Results_WLS, "se") : 
  object 'ModelQ_Results_WLS' not found

I installed the older version of lavaan (0.6-7) as you suggest in the thread https://groups.google.com/u/2/g/genomic-sem-users/c/aXqUAvJ2ZN4 , restarted R and reloaded both packages, but I continue to get the same error.

Anything else I should try?

Thanks!
Katerina

On Tuesday, March 16, 2021 at 5:13:26 PM UTC-6 agro...@gmail.com wrote:

Michel Nivard

unread,
Mar 22, 2021, 2:50:26 PM3/22/21
to Katerina Zorina-Lichtenwalter, Genomic SEM Users
Hi,

try uninstalling/removing the packages entirely, then rebooting R (in Rstudio, in the package pane hit the little grey button with a x to delete a package entirely).

Michel

--
You received this message because you are subscribed to the Google Groups "Genomic SEM Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to genomic-sem-us...@googlegroups.com.

Katerina Zorina-Lichtenwalter

unread,
Mar 22, 2021, 4:58:57 PM3/22/21
to Genomic SEM Users
Hi Michel,

The lavaan version installed on my lab's server is 0.6.7, verified using packageVersion(). I tried installing to and loading that version of lavaan from my local library, which did not help. Further, it is only one of the models I am specifying that gives this error. Most variations on it run smoothly.
Is it possible that something else could be causing the same error? 


Thank you,
Katerina

agro...@gmail.com

unread,
Mar 23, 2021, 10:37:36 AM3/23/21
to Genomic SEM Users
Hi Katerina, 

The models without individual SNP effects should be working now with the more recent update of lavaan if you want to redownload Genomic SEM (the GWAS functions should be updated early next week so if this is a multivariate GWAS issue stay tuned). If you are still getting the error feel free to send me the code and LDSCoutput and I'll take a look. 

Best, 
 Andrew

Katerina Zorina-Lichtenwalter

unread,
Mar 30, 2021, 11:52:55 AM3/30/21
to Genomic SEM Users
Many thanks, Andrew. I re-downloaded Genomic SEM, but I am still getting this error, so, I'll email you my code and data.

Best,
Katerina

agro...@gmail.com

unread,
Apr 1, 2021, 5:47:39 PM4/1/21
to Genomic SEM Users
Hi Katerina, 

Thanks for sending and for flagging this! It turned out to be an additional error related to the lavaan update and how start values are specified for those follow-up models. I just put in the fix and was able to run your code without issue if you want to redownload the package and your end and give it a try. 

Best, 
  Andrew

Katerina Zorina

unread,
Apr 1, 2021, 11:45:30 PM4/1/21
to agro...@gmail.com, Genomic SEM Users
Thanks very much, Andrew!

After redownloading GenomicSEM, I was able to run it successfully as well.

Best,
Katerina

From: genomic-...@googlegroups.com <genomic-...@googlegroups.com> on behalf of agro...@gmail.com <agro...@gmail.com>
Sent: Thursday, April 1, 2021 3:47 PM
To: Genomic SEM Users <genomic-...@googlegroups.com>
Subject: Re: Error in inspect(ModelQ_Results_WLS, "se") : object 'ModelQ_Results_WLS' not found
 
You received this message because you are subscribed to a topic in the Google Groups "Genomic SEM Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/genomic-sem-users/iWuSbZbAzUU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to genomic-sem-us...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/genomic-sem-users/d31614fc-f160-4d79-ad26-340f20960264n%40googlegroups.com.

Stephen Wang

unread,
Apr 4, 2021, 2:36:01 AM4/4/21
to Genomic SEM Users
Hi Andrew,

I just received the same error while running GenomicSEM with the SNP effect (lavaan 0.6-8). Should the models with individual SNP effects be working now?

Best,
Stephen

Katerina Zorina-Lichtenwalter

unread,
Apr 5, 2021, 11:39:50 AM4/5/21
to Genomic SEM Users
I am also getting error with userGWAS().

Thanks,
Katerina

agro...@gmail.com

unread,
Apr 6, 2021, 9:34:34 AM4/6/21
to Genomic SEM Users
Hi all, 

Sorry for delays! I uploaded the patches this morning so the userGWAS and commonfactorGWAS functions should both be working now.  I also want to highlight that in the last day the GWAS functions were also updated to no longer take output from addSNPs and instead performs the function of addSNPs (combining the sumstats and ldsc output to create the SNP-specific matrices) within the context of the function. The GWAS functions were changed over a year to accept the ldsc and sumstats output directly, but just in case you are still using the addSNPs output I wanted to make sure to flag so you don't end up running into a whole new set of issues. Let me know if you run into any problems!

Best, 
  Andrew
Reply all
Reply to author
Forward
0 new messages