You are here

Expansion of the Bruins et al., GxE + PRS model to include additional univariate moderators

2 posts / 0 new
Last post
tvo015's picture
Joined: 01/18/2024 - 13:58
Expansion of the Bruins et al., GxE + PRS model to include additional univariate moderators

Hi All,
My question pertains to wanting to expand the Bruins et al., GxE + PRS model to include additional univariate moderators of age and sleep duration in addition to the PRS. The goal is to answer questions related to whether individuals at higher genetic risk for Alzheimer's disease (AD-PGS) show similar or differing etiological patterns compared to individuals at lower genetic risk for AD, and relatedly, to what extent does the AD-PGS account for the amplified genetic influences that were previously found at shorter sleep durations (previously conducted in MPLUS).

Essentially, I am trying to combine the van der Sluis extended univariate moderation model with the Bruins model. In addition to the expansion of the Bruins' model to include the additional univariate moderators, I am attempting to include age and sleep as covariates (covariates are not included in the Bruins' model currently). With our current attempts for the expansion of the model, we have run into an error message that neither I nor my PI and collaborators have come across before:

Error in (function (cl, name, valueClass) :

assignment of an object of class “MxDataStatic” is not valid for @‘observed’ in an

object of class “MxDataStatic”; is(value, "MxOptionalDataFrameOrMatrix") is not TRUE

If anyone has thoughts regarding this error message or ideas regarding the attempt at the expansion of the Bruins' model, I would greatly appreciate any and all thoughts. Our current attempt is attached and supplementary material regarding the Bruins' model is provided below.

Supplementary Information:
Bruins' paper & model: Bruins, S., Hottenga, J. J., Neale, M. C., Pool, R., Boomsma, D., & Dolan, C. (2022). Environment-by-PGS Interaction: Combining the classical twin design and Polygenic Scores to test for Genotype x Environment Interaction.
Bruins' Model OSF link with R script: []

Thank you in advance!

Tina V

AdminHunter's picture
Joined: 03/01/2013 - 11:03

I'm not sure why that is the error message you're getting but I'm finding some errors in your script.

# Create a 1x3 vector of definition variable values for age1, age1 [sic], and age3
# WHY is age 1 used twice?!?
defLage <- mxMatrix( type="Full", nrow=1, ncol=3, free=FALSE, labels=c("data.ageX_1", "data.ageX_1",  "data.ageX_2"), name="defage" ) #defL from hermine's
# Create a 1x3 vector of free parameter values
# WHY is bageA fixed to zero?!?
pathbage     <- mxMatrix( type="Full", nrow=1, ncol=3, free=c(FALSE,TRUE,TRUE), values=c(0, 0.01, 0.01) , label=c("bageA", "bageB", "bageB")   , name="betaage" ) #A=pgs, B=Phen

Then these are used here

expMeanMZ <- mxAlgebra( expression= meanMZ + betaage%*%defage + betasleepMZ%*%defsleepMZ + betasleepMZ2%*%defsleepMZ2 , name="expMeanMZ" )
# This multiplication is not conformable: betaage%*%defage
# It's 1x3 times another 1x3.  I think you want defage to be 3x1

My guess is a lot of these matric multiplications are similarly not conformable.

My suggestion is to fix this problem, check for similar ones throughout your script, and see what new error you get.