Help using Base SAS procedures

A question regarding PROC MODEL

Reply
New Contributor
Posts: 3

A question regarding PROC MODEL

Hello

I have a question regarding SAS’s PROC MODEL:

If I define a variables starting value for the iteration process, PROC MODEL uses it for the first observation of the processed dataset.

For the next observation it uses the final value of the previous iteration process to start the next iteration process.

In some cases this leads to trouble because the function I use has a singularity.

So how can I force proc model to use assigned starting values for the iteration process for every observation!

Thank you in advance.

Regards, Klaus

New Contributor
Posts: 3

Re: A question regarding PROC MODEL

Maybe some code can illustrate my problem:

The 2 input files differ in nothing but the sort order of the data.

In proc model initial values of the interation process are provided.

But after processing the first observation the procedure takes the final values

of the last iteration process as initial values of the next.

In some cases this works (See output of ascending.). In others it doesnt (Because of singularitys per instance).

So what i want to do is to provide initial values for variables at every observation.

data ascending;

      input @@ Total;

      cards;

      89 807

      ;

run;

data descending;

      input @@ Total;

      cards;

      807 89

      ;

run;

proc model noprint data=ascending;

      var fract_adsorbed 0.01 fract_balance 0.01;    

   eq.ISO=fract_adsorbed-((120*fract_balance*0.5)/(1+fract_balance*0.5));

   eq.REST=(fract_balance)-(Total-fract_adsorbed);

      solve fract_adsorbed fract_balance /itprint solveprint out=correct_result;         

run;quit;

proc model noprint data=descending;

      var fract_adsorbed 0.01 fract_balance 0.01;    

   eq.ISO=fract_adsorbed-((120*fract_balance*0.5)/(1+fract_balance*0.5));

   eq.REST=(fract_balance)-(Total-fract_adsorbed);

      solve fract_adsorbed fract_balance /itprint solveprint out=incorrect_result;       

run;quit;

New Contributor
Posts: 3

Re: A question regarding PROC MODEL

I think I solved the problem by adding the initial values of the variables to the input dataset..

Ask a Question
Discussion stats
  • 2 replies
  • 206 views
  • 0 likes
  • 1 in conversation