BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Minh2710
Obsidian | Level 7

Hello. I have been using proc nlin to fit a pre-determined model to a set of value with relative success using the following line of code:

 

data example;
	input Notch Rate;
	datalines;
1 0.101750388
2 0.02797293
3 0.007380199
4 0.003547882
5 0.002219785
6 0.000631796
7 0.000507642
8 0.000361024
9 0.000105668
10 0.000315689
11 .
12 .
13 .
14 .
15 .
16 .
;
run;

proc nlin data = example;
  parameters  alpha = 0
              beta = 0;
  model Rate = alpha * exp (beta * Notch);
  output out = exponential predicted = pred_exp sse = sse_exp;
run;

data exponential;
	set exponential;
	format pred_exp Rate percent10.4;
run;

However, as I get further, I need the fitting procedure to use only inputs to the last non-missing value (e.g. in this particular dataset, minimize the sum of squared errors of only up to first 10 observations (Notch = 10), but I also want to generalize the code to use on other datasets).

 

I really appreciate your help.

1 ACCEPTED SOLUTION

Accepted Solutions
FreelanceReinh
Jade | Level 19

Hello @Minh2710,

 

You can exclude observations with missing Rate values by means of a WHERE statement:

proc nlin data = example;
where n(rate);
...

But PROC NLIN doesn't use those observations anyway in the process of estimating the parameters, see these lines in the output table "Estimation Summary" (obtained without the WHERE statement):

Observations Read                 16
Observations Used                 10
Observations Missing               6

So the WHERE statement doesn't change the model.

View solution in original post

1 REPLY 1
FreelanceReinh
Jade | Level 19

Hello @Minh2710,

 

You can exclude observations with missing Rate values by means of a WHERE statement:

proc nlin data = example;
where n(rate);
...

But PROC NLIN doesn't use those observations anyway in the process of estimating the parameters, see these lines in the output table "Estimation Summary" (obtained without the WHERE statement):

Observations Read                 16
Observations Used                 10
Observations Missing               6

So the WHERE statement doesn't change the model.

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 1 reply
  • 385 views
  • 1 like
  • 2 in conversation