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 (July 2001, week 2)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Thu, 12 Jul 2001 15:55:56 -0700
Reply-To:     Dale McLerran <dmclerra@MY-DEJA.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Dale McLerran <dmclerra@MY-DEJA.COM>
Subject:      Re: PROC MODEL QUESTION!
Comments: To: adelina.gschwandtner@univie.ac.at
Content-Type: text/plain

Whoops, I just noticed a problem with indexing in the macro code below. The second %do loop should be indexed from 2 to 187. The correct code would be

%macro model; proc model data=ad1; parms pi1-pi187 ps1-ps187; prof = %do _i=1 %to 187; pi&_i.*i&_i + ps&_i.*s&_i %end; ; fit prof; test %do _i=2 %to 187; pi1/(1-ps1)=pi&_i./(1-ps&_i.) %if &_i<187 %then ,; %end; ; run; quit; >%mend model;

Dale

> adelina.gschwandtner@univie.ac.at sas-l@listserv.uga.edu dmclerra@my-deja.comDate: Thu, 12 Jul 2001 11:06:56 > RE: PROC MODEL QUESTION! >Adelina, > >There are a couple of problems with your code below, mostly from >trying to port code from PROC REG into PROC MODEL. First, PROC >MODEL requires separate names for parameters and variables. You are >trying to use variables i1-i187 and s1-s187 as parameters. You must >declare separate parameters with names that are different from the >names of variables on the right hand side of your model. Suppose that >we call the parameters pi1-pi187 and ps1-ps187. Now we can identify >both parameters and variables separately in the PROC MODEL statements. >In addition to naming the parameters something other than the names of >variables, you also need to specify how the parameters and variables >enter the predictive model. Again, you are trying to use some >modified PROC REG code. You need to state explicitly how each >variable and each parameter enter the model, not using any dash >notation. Thus, you would need to specify > >parms pi1-pi187 ps1-ps187; >prof=pi1*i1 + pi2*i2 + pi3*i3 + ... + pi187*i187 + > ps1*s1 + ps2*s2 + ps3*s3 + ... + ps187*s187; > >Then your test statement would be > >test pi1/(1-ps1)=pi2/(1-ps2), pi1/(1-ps1)=pi3/(1-ps3), ... > pi1/(1-ps1)=pi187/(1-ps187); > >Note that there is a lot of typing to specify this code if you type >it all out. Instead of typing it all out, I think that you will want >to use a macro to fill out the code. So here is a macro for you: > >%macro model; >proc model data=ad1; >parms pi1-pi187 ps1-ps187; >prof = %do _i=1 %to 187; pi&_i.*i&_i + ps&_i.*s&_i %end; ; >fit prof; >test %do _i=1 %to 186; > pi1/(1-ps1)=pi&_i./(1-ps&_i.) > %if &_i<186 %then ,; > %end; ; >run; >quit; >%mend model; > >Hope this works out for you. Thanks for informing me of the test of >nonlinear functions of the parameters using PROC MODEL. I did not >know that SAS had that feature. I would caution you about the above >tests though with regard to what Phillip Whitall (I believe) >mentioned previously about error structures. The above tests are >only acceptable if the errors are uncorrelated. Is this assumption >reasonable? If not, then you will have to keep searching for the >some other solution. Write back to the list if you believe that such >problems may exist in your data. > >Dale > > >>Date: Thu, 12 Jul 2001 12:07:17 +0200 >>Reply-To: Adelina Gschwandtner <Adelina.Gschwandtner@UNIVIE.AC.AT> >> Adelina Gschwandtner <Adelina.Gschwandtner@UNIVIE.AC.AT> PROC MODEL QUESTION! SAS-L@LISTSERV.UGA.EDU >>Hello Everybody! >> >>Ok, so I found out that I can test nonlinear restrictions only with PROC >>MODEL. >>So I tried this: >> >>proc model data=ad1; >>parms i1-i187 s1-s187; >>prof=i1-i187 + s1-s187/NoInt; >>test i1/(1-s1)=i2/(1-s2); >>fit prof; >>run; >> >>And I got the following error message: >> >>WARNING: Wald test Test0 failed because the test covariance matrix is >>singular >>WARNING: The hypothesis specified in the Test Test0 is not testable. >> >> >>Has anyone any idea what this means and how I can correct for it??? >> >>Thanks, >>Adelina. >> >> >> >> >>¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø¤º°`°º¤ø,¸¸,ø >> >>ADELINA GSCHWANDTNER MAG. >> >>University of Vienna >>Department of Economics >>BWZ, Bruennerstr.72 Tel:(00431) 4277 37480 >>A-1210 Vienna Fax:(00431) 4277 37498 >> >>Mail: gschwand@econ.bwl.univie.ac.at >>Adelina.Gschwandtner@univie.ac.at >> >>http://www.univie.ac.at/Wirtschaftswissenschaften/gschwand/ >> >>¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø¤º°`°º¤ø,¸¸,ø > > > > >--------------------------------------- >Dale McLerran >Fred Hutchinson Cancer Research Center >mailto: dmclerra@fhcrc.org >Ph: (206) 667-2926 >Fax: (206) 667-5977 >---------------------------------------

--------------------------------------- Dale McLerran Fred Hutchinson Cancer Research Center mailto: dmclerra@fhcrc.org Ph: (206) 667-2926 Fax: (206) 667-5977 ---------------------------------------

------------------------------------------------------------ --== Sent via Deja.com ==-- http://www.deja.com/


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