In the simplified NLIN example below, giving initial values to model parameters in the PARAMETER statement is NOT equivalent to specifying them in a dataset. It looks like parameter names are not known at the time of array definitions when the parameters are given in a dataset. Is this an undocumented "feature"?
/* Parameter array given initial values in PARAMETER statement. Works fine. */
proc nlin data=sashelp.class;
parameters w=1 h=1;
bounds w h >= 0;
array x{*} weight height;
array y{*} w h;
s = 0;
do i = 1 to dim(x);
s = s + x{i}*y{i};
end;
model age = s;
run;
/* Same problem. Parameter array given initial values in PDATA dataset. Doesn't work. */
data pd;
Parameter="w"; Estimate=1; output;
Parameter="h"; Estimate=1; output;
run;
proc nlin data=sashelp.class;
parameters / pdata=pd;
bounds w h >= 0;
array x{*} weight height;
array y{*} w h;
s = 0;
do i = 1 to dim(x);
s = s + x{i}*y{i};
end;
model age = s;
run;
ERROR: The variable y was referenced but not given a value.
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
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.