Programming the statistical procedures from SAS

proc nlin and outest statement

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 14
Accepted Solution

proc nlin and outest statement

SAS 9.4 TS LEVEL 1M3

 

Hello,I am having difficulty with outest statement and reference to new (?) dataset koko.  Please see error message below. I think it should output the cov matrix of the parameter estimates? How to do?  Could it be a semicolon or statement placement problem?

 

proc NLIN data = eight
BEST= 10    
MAXITER= 100   
METHOD= Gauss 
CONVERGE=1.0E-6
LIST
ALPHA = 0.10;   
parms Beta1 = 0.05 Beta2 = 4;
parms
Beta1 = 0.753362 to 1.0 by 0.01
Beta2 = 0.53261;
der.Beta1 = exp(beta2 * x);
/* OUTEST = KOKO(where = (_TYPE_ = "COVB")); */
    model y = Beta1 * exp(Beta2 * x);
output
out = eightOut
p= y_hat
r= residual
stdr= SE_Resid
LCLM= LCL_Mean    
UCLM= UCL_Mean ;  
run; quit; title;
 
/*  error msg
OUTEST = KOKO(where = (_TYPE_ = "COVB"))
ERROR: Cannot find a library containing subroutine KOKO.
ERROR: no dependent variable specified.
NOTE: The SAS System stopped processing this step because of errors.
WARNING: The data set WORK.EIGHTOUT may be incomplete.  When this step was
         stopped there were 0 observations and 0 variables.
WARNING: Data set WORK.EIGHTOUT was not replaced because this step was stopped.
 
OUTEST=SAS-data-set
specifies an output data set that contains the parameter estimates produced at each iteration. 
See the section Output Data Sets for details.
*/
 

 


Accepted Solutions
Solution
‎03-25-2017 08:42 AM
Respected Advisor
Posts: 4,753

Re: proc nlin and outest statement

Option OUTEST belongs in the proc nlin statement.

 

proc NLIN data = eight
BEST= 10    
MAXITER= 100   
METHOD= Gauss 
CONVERGE=1.0E-6
LIST
ALPHA = 0.10
OUTEST = KOKO(where = (_TYPE_ = "COVB")); 
PG

View solution in original post


All Replies
Solution
‎03-25-2017 08:42 AM
Respected Advisor
Posts: 4,753

Re: proc nlin and outest statement

Option OUTEST belongs in the proc nlin statement.

 

proc NLIN data = eight
BEST= 10    
MAXITER= 100   
METHOD= Gauss 
CONVERGE=1.0E-6
LIST
ALPHA = 0.10
OUTEST = KOKO(where = (_TYPE_ = "COVB")); 
PG
Occasional Contributor
Posts: 14

Re: proc nlin and outest statement

Hello,

thank you for your reply. There are two problems.
1. koko does not exist
2. can I run multiple parms statements that preferrably are labelled?

Sincerely,
Mary

2. title2 "Non-Linear Regression y ~ X";
proc NLIN data = eight
BEST = 10
MAXITER = 100
METHOD = Gauss
CONVERGE=1.0E-6
LIST
ALPHA = 0.10
OUTEST = KOKO(where = (_TYPE_ = "COVB"));
parms Beta1 = 0.05 Beta2 = 4;
parms
Beta1 = 0.753362 to 1.0 by 0.01
Beta2 = 0.53261;
parms
Beta1 = 0.5 to 2.0 by 0.1
Beta2 = 0.53261;
der.Beta1 = exp(beta2 * x);
model y = Beta1 * exp(Beta2 * x);
output
out = eightOut
p = y_hat
r = residual
stdr = SE_Resid
LCLM = LCL_Mean
UCLM = UCL_Mean ;
run; quit; title;

##- Please type your reply above this line. Simple formatting, no
attachments. -##
Super User
Posts: 10,871

Re: proc nlin and outest statement


MaryA_Marion wrote:
Hello,

thank you for your reply. There are two problems.
1. koko does not exist

OUTEST creates an output set. If you use the name of an existing data set the procedure will overwrite the existing set.

 

 

Respected Advisor
Posts: 4,753

Re: proc nlin and outest statement

I don't think multiple parameter statements are allowed but you can list starting parameter values in a separate dataset. This should work:

 

title2 "Non-Linear Regression y ~ X";

data parameters;
parameter = "beta1"; estimate=0.05; output;
parameter = "beta2"; estimate=4; output;
parameter = "beta2"; estimate=0.53261; output;
parameter = "beta1";
    do estimate = 0.753362 to 1.0 by 0.01;
        output;
        end;
    do estimate = 0.5 to 2.0 by 0.1;
        output;
        end;
run;

proc NLIN data = eight
    BEST = 10
    MAXITER = 100
    METHOD = Gauss
    CONVERGE=1.0E-6
    LIST
    ALPHA = 0.10
    OUTEST = KOKO(where = (_TYPE_ = "COVB"));
parameters / pdata=parameters;
model y = Beta1 * exp(Beta2 * x);
output
    out = eightOut
    p = y_hat
    r = residual
    stdr = SE_Resid
    LCLM = LCL_Mean
    UCLM = UCL_Mean ;
run; quit; 
title;

(untested)

PG
Occasional Contributor
Posts: 14

Re: proc nlin and outest statement

All three did not appear on output. It may be safer to just run these one
at a time.

Mary

##- Please type your reply above this line. Simple formatting, no
attachments. -##
Occasional Contributor
Posts: 14

Re: proc nlin and outest statement

Your approach of using a dataset for the parms was clever. However I did not feel comfortable with the output from SAS. I was not completely sure which set of parameters I was using.  I am doing them one at a time now (3 runs of proc nlin).

 

As for koko, I have a SAS-win10 OS problem sometimes.  After many tries I finally got koko to print out.  proc nlin syntax is very sensitive.

 

Thank you for replying.

 

Mary

☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 6 replies
  • 182 views
  • 1 like
  • 3 in conversation