<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Programming a Multivariate Mixed Effects Model in SAS/IML Software and Matrix Computations</title>
    <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Programming-a-Multivariate-Mixed-Effects-Model/m-p/350466#M3422</link>
    <description>&lt;P&gt;This has nothing to do with the SAS/IML language. I suggest you move the post to the Statistical Procedures Community. (Or I can move it if you can't.)&lt;/P&gt;</description>
    <pubDate>Mon, 17 Apr 2017 10:19:56 GMT</pubDate>
    <dc:creator>Rick_SAS</dc:creator>
    <dc:date>2017-04-17T10:19:56Z</dc:date>
    <item>
      <title>Programming a Multivariate Mixed Effects Model</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Programming-a-Multivariate-Mixed-Effects-Model/m-p/350434#M3421</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm using PROC NLMIXED to generate a multivariate mixed-effects model. The data is rather complex and is in a "stacked" format like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/8339i47DCEB0A41FC56EC/image-size/original?v=1.0&amp;amp;px=-1" alt="large.png" title="large.png" border="0" /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;the SUBID variable identifies the subject and the Response variable consists of the QRTS (quantitative task) and VRTS (verbal task) variables literally stacked on top of each other. The TimeV and TimeQ variables denote the Time for each task.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am not only interested in the fixed/random effects for the quantitative and verbal tasks separately, but I am most interested in the joint covariances between the random effects for the tasks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am posting this in this board because I think that my problem is in the programming statements in my syntax, and not in the statistics. Here is the code I used to try to fit the model:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;*multivariate structured latent curve model combining the quant and verbal scores using PROC NLMIXED*;
proc nlmixed data = combined method = gauss noad gconv = 0;

	parms aV = 7 bV = 7 rV = -.7 s2V var_aV cov_aVbV var_bV
		  cov_aVrV cov_bVrV var_rV
		  aQ = 8 bQ = 8 rQ = -.7 s2Q var_aQ cov_aQbQ var_bQ
		  cov_aQrQ cov_bQrQ var_rQ
		  cov_aVaQ cov_aVbQ cov_aVrQ cov_bVaQ cov_bVbQ 
		  cov_bVrQ cov_rVaQ cov_rVbQ cov_rVrQ = .1; 
		  *aQ = a parameter for quant*; *bQ = b parameter for quant*; *rQ = r parameter for quant*;
		  *aV = v parameter for verbal*; *bV = b parameter for verbal*; *rV = r parameter for verbal*;;

	pi = arcos(-1);

	n0Q = aQ + z0Q; n1Q = bQ + z1Q; n2Q = z2Q; *fixed plus random for quantitative*;
	basis0Q = 1-exp(-rQ*(Time-1)); basis1Q = exp(-rQ*(Time-1)); basis2Q = (aQ-bQ)*(Time-1)*exp(-rQ*(Time-1));
	basis3Q = 0; basis4Q = 0; basis5Q = 0;
	*basis functions for quantitative*;

	n0V = aV + z0V; n1V = bV + z1V; n2V = z2V; *fixed plus random for verbal*;
	basis0V = 1-exp(-rV*(Time-1)); basis1V = exp(-rV*(Time-1)); basis2V = (aV-bV)*(Time-1)*exp(-rV*(Time-1));
	basis3V = 0; basis4V = 0; basis5V = 0;
	*basis functions for verbal*;

	if Type = "Q" then do;
	predvQ = n0Q*basis0Q + n1Q*basis1Q + n2Q*basis2Q;
	llQ = (-1/2)*(log(2*pi) + (((QRTS - predvQ)**2)/s2Q) + log(s2Q)); end;

	else if Type = "V" then do; predvV = n0V*basis0V + n1V*basis1V + n2V*basis2V;
	llV = (-1/2)*(log(2*pi) + (((VRTS - predvV)**2)/s2V) + log(s2V)); end;

	ll = llQ + llV;

	model Response ~ general(ll);

	random z0Q z1Q z2Q z0V z1V z2V ~ normal([0,0,0,0,0,0], 
	[var_aQ, cov_aQbQ, var_bQ, cov_aQrQ, cov_bQrQ, var_rQ, 
	cov_aVaQ, cov_aVbQ, cov_aVrQ, cov_bVaQ, cov_bVbQ, cov_bVrQ,
	cov_rVaQ, cov_rVbQ, cov_rVrQ,
	var_aV, cov_aVbV, var_bV, cov_aVrV, cov_bVrV, var_rV]) subject = SUBID;

run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Any and all help is appreciated. Thanks.&lt;/P&gt;</description>
      <pubDate>Mon, 17 Apr 2017 05:21:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Programming-a-Multivariate-Mixed-Effects-Model/m-p/350434#M3421</guid>
      <dc:creator>tbanh</dc:creator>
      <dc:date>2017-04-17T05:21:02Z</dc:date>
    </item>
    <item>
      <title>Re: Programming a Multivariate Mixed Effects Model</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Programming-a-Multivariate-Mixed-Effects-Model/m-p/350466#M3422</link>
      <description>&lt;P&gt;This has nothing to do with the SAS/IML language. I suggest you move the post to the Statistical Procedures Community. (Or I can move it if you can't.)&lt;/P&gt;</description>
      <pubDate>Mon, 17 Apr 2017 10:19:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Programming-a-Multivariate-Mixed-Effects-Model/m-p/350466#M3422</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2017-04-17T10:19:56Z</dc:date>
    </item>
    <item>
      <title>Re: Programming a Multivariate Mixed Effects Model</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Programming-a-Multivariate-Mixed-Effects-Model/m-p/350575#M3423</link>
      <description>&lt;P&gt;Hi Rick,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Apologies for posting this in the IML board. I thought it appropriate because I was having problems with the way I was inducing the matrices in PROC NLMIXED.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I had posted this in the statistical procedures board earlier and I wanted to see if the problem was with the programming statements. Do you think you could comb through the code I posted and see if there's a problem with the programming? On the stat procedures board, they said the problem was that the model was too complex for the data but I do not think that is the problem.&lt;/P&gt;</description>
      <pubDate>Mon, 17 Apr 2017 17:04:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Programming-a-Multivariate-Mixed-Effects-Model/m-p/350575#M3423</guid>
      <dc:creator>tbanh</dc:creator>
      <dc:date>2017-04-17T17:04:51Z</dc:date>
    </item>
    <item>
      <title>Re: Programming a Multivariate Mixed Effects Model</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Programming-a-Multivariate-Mixed-Effects-Model/m-p/350576#M3424</link>
      <description>&lt;P&gt;I have nothing to contribute. I am not an expert on complex mixed models.&lt;/P&gt;</description>
      <pubDate>Mon, 17 Apr 2017 17:08:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Programming-a-Multivariate-Mixed-Effects-Model/m-p/350576#M3424</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2017-04-17T17:08:17Z</dc:date>
    </item>
    <item>
      <title>Re: Programming a Multivariate Mixed Effects Model</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Programming-a-Multivariate-Mixed-Effects-Model/m-p/350577#M3425</link>
      <description>&lt;P&gt;Okay, thank you for your time anyway.&lt;/P&gt;</description>
      <pubDate>Mon, 17 Apr 2017 17:14:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Programming-a-Multivariate-Mixed-Effects-Model/m-p/350577#M3425</guid>
      <dc:creator>tbanh</dc:creator>
      <dc:date>2017-04-17T17:14:53Z</dc:date>
    </item>
  </channel>
</rss>

