Date: Fri, 7 Jul 2006 10:42:28 -0700
Reply-To: shiling99@YAHOO.COM
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: shiling99@YAHOO.COM
Organization: http://groups.google.com
Subject: Re: DIAG function
In-Reply-To: <1152292363.025066.90830@s53g2000cws.googlegroups.com>
Content-Type: text/plain; charset="iso-8859-1"
The diag function belongs to SAS/IML package. It cannot be used in data
step.
Here is an example in SAS/IML. IML package needs a separate license.
proc iml;
a={1 2,
3 4}
;
b=diag(a);
print a b;
quit;
A B
1 2 1 0
3 4 0 4
For regression analysis you may take a look of all canned regression
procedures in SAS/STAT. They should fit most of regression analyses.
HTH
Sharon wrote:
> Hi all,
>
> I was wondering if anyone has worked with the DIAG function in SAS. I'm
> trying to get the the diagonal elements for these variables: COST1
> COST2 which I intend to use to do regression modeling on to find
> lambda. (Not sure about the econometrics but that's what my professor
> suggested I do for my project...forgive me if my question isn't very
> clear.) My cost1 and cost2 variables each have about 14,000
> observations.
>
> COST1 and COST2 are coded as Numbers (with 2 decimal places). When I
> try to define diag_cost1= diag(cost1) I get an error: "The function
> DIAG is unknown or cannot be accessed". Checked SAS Help and it's a
> function, but I don't know how to get it to work.
>
> Any ideas? Thanks!!!!!
>
> Sharon
|