covaruber / sommer

38 stars 25 forks source link

multivariate model specification with different fixed effects per trait #50

Closed ghost closed 1 year ago

ghost commented 1 year ago

Hi.

Thanks for the great package.

I would like to ask how to specify a bi-variate model with different fixed effects for each trait.

Say y1=fix1b1+cov1c1+e1, and y2=fix2b2+cov2c2+e2,

where y1 and y2 are continuous responses, fix1 and fix2 are fixed classification variables, cov1 and cov2 are continuous co-variables, and e1 and e2 are residuals.

The task is to estimate a 2x2 residual co-variance matrix. How would such model be specified?

I could not find any example for this case in the manual.

Running trial and error, I have not reach the point of fitting the co-variables.

I successfully tried mmer(fixed=cbind(y1,y2)~vs(fix1,Gtr=fcm(c(1,0))),data=data).

But I stuck at fitting fix2: mmer(fixed=cbind(y1,y2)~vs(fix1,Gtr=fcm(c(1,0)))+vs(fix2,Gtr=fcm(c(0,1)))-1,data=data) .........

where I am getting message "fixed-effect model matrix is rank deficient so dropping 253 columns / coefficients" which implies that either "fix1" or "fix2" is entirely dropped from the model.

Any help much appreciated.

Best regards.

covaruber commented 1 year ago

Sorry for the late response. Could you please provide a reproducible example to fix it? :)

Cheers, Eduardo