BookmarkSubscribeRSS Feed
cbaer
Calcite | Level 5

I'm a biologist with little training in linear algebra.  So: I want to calculate a covariance matrix in MIXED then constrain the DIFFERENCE between two matrices to be equal to the difference of two other matrices, and use a LRT to compare the constrained model to the unconstrained model.  Here's the setup:

I have two Populations (N and P), each of which is present in two Treatments (C and M).  Each Population contains 15 Lines in the C treatment and 45 Lines in the M treatment; C Lines are independent from M Lines.  Each Line consists of ~ 25 Replicates.  Each Replicate was measured for a set of four (continuous) Traits, normalized to the Trait mean.  Population and Treatment are fixed effects, Line and Replicate are random effects.   The quantity of interest is the DIFFERENCE IN THE DIFFERENCE in the among-Line (co)variances between the two treatment groups in the two Populations.   Representing the among-Line covariance matrix as L, the question is: Does L(M)-L(C) differ between the two Populations?

To calculate the covariance matrix(s), I use the following code:

PROC MIXED data=<datasetname>;

     CLASS Trait Treatment Population LIne Replicate;

     MODEL Value=Trait;

     RANDOM Trait/SUBJECT=Line GROUP=Population*Treatment TYPE=un; 

     REPEATED Trait/SUBJECT=Rep(Line Population Treatment) TYPE=un;

     ODS OUTPUT covparms=cov_parms;

RUN;

This code generates unstructured among-Line covariance matrices for each Population*Treatment combination and an overall likelihood.  The next step is to constrain L(M)-L(C) for Population N equal to L(M)-L(C) for population P and compare the likelihood to the first model.  Which is where I'm stuck.

thanks!

2 REPLIES 2
SteveDenham
Jade | Level 19

I have never tried TYPE=LIN(q), but it looks like it might be a way to construct a linear combination of known matrices.  The constraint that you want could be (might be, not sure how) coded in a datastep.  This looks difficult from an outside perspective, though.

Steve Denham

cbaer
Calcite | Level 5

thanks Steve, I knew the job was dangerous when I took it.

-Charlie Baer

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 416 views
  • 0 likes
  • 2 in conversation