LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (November 2000, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Thu, 16 Nov 2000 09:05:42 -0600
Reply-To:     Jaclyn Whitehorn <jaclyn@BAMA.UA.EDU>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Jaclyn Whitehorn <jaclyn@BAMA.UA.EDU>
Subject:      Re: covariance matrix from file to iml matrix
Comments: To:
In-Reply-To:  <>
Content-Type: text/plain; charset="us-ascii"; format=flowed

At 09:19 PM 11/15/00 -0600, you wrote: >Working on a matrix element in IML is like handling a temporary arry in data >step(index i j k l). IML has a rich set of matrix functions. If you don't >need use specific matrix functions, a temporary array works no worse.

Unfortunately, she does want to work with it as a matrix, i.e. get trace, determinant, eigenvalues, etc. She basically is checking for typos! They've already caused her some problems, and she wants to make sure she caught them all.

Working on the assumption that she won't do the conversion very often, I did get something to work, although it's quite ugly:

1. First problem was that not every element in each matrix had an entry. PROC MIXED assumes that if one isn't present, that it is equal to zero. So I created a dummy data set with an observation for each element, merged it with the original one, and set missing values to zero.

2. Then used PROC TRANSPOSE to get the data set to look like 6 matrices stacked on top of each other (i.e. have variables col1-col40 as opposed to a column variable and a value variable)

3. Then used PROC IML's READ statement with WHERE to get six matrices. She can then do whatever operations on them she wants.

I'm sure that I could have investigated a slick solution completely in IML, possibly using the INPUT DATA function, but the amount of research involved was too much for a one-time solution.

>Jaclyn Whitehorn wrote: > > > Hi group, > > > > One of my users is a PHd candidate that is doing simulations in SAS. She > > is using PROC MIXED with the REPEATED statement and specifying a lin(6) > > covariance structure. Her covariance data set, then, has variables PARM > > (for which of the 6 parameters), ROW, COLUMN, and VALUE. For error > > checking purposes, she would like to read this data set into 6 PROC IML > > matrices and compute some basic summary statistics. > > > > Problem: I am not as familiar with IML as I would like. I know how to > > read in a data set that already looks like a matrix, but how would I loop > > through a data set, using each observation's values of PARM, ROW, and > > COLUMN to determine which matrix it belongs in and where? Any pointers > > would be greatly appreciated! > > > > TIA, > > Jaclyn > > > > --------------------------------------------------- > > Jaclyn Whitehorn * User Service Consultant > > Seebeck Computer Center * The University of Alabama

--------------------------------------------------- Jaclyn Whitehorn * User Service Consultant Seebeck Computer Center * The University of Alabama (205)348-8720

Back to: Top of message | Previous page | Main SAS-L page