Reputation: 339
How can I get the following code to overwrite the optimal values of my parameters (which is mean
and sigma
) in the parameter
dataset?
data parameter(type=est);
Keep _type_ sigma mean;
_type_='parms'; sigma=0.1; mean=0.1;
data data;
input x @@;
datalines;
1 3 4 5 7;
proc nlp data=Data NOMISS tech=tr inest=parameter Pcov phes;
max loglik;
parms sigma mean;
loglik=-0.5*((x-mean)/sigma)**2-log(sigma);
run;
Upvotes: 0
Views: 93
Reputation: 1210
On the PROC NLIN statement, use the OUTEST= option to create an output data set that contains the optimal parameter values, among other statistics.
Although I don't recommend directly overwriting the INEST= data set, you can do it by using the same name on the OUTEST= statement. Use a WHERE clause and a KEEP clause to make the output data set look exactly like the input data. For example:
proc nlp data=D NOMISS tech=tr inest=parameter Pcov phes
outest=ParamOpt(where=(_TYPE_="PARMS") keep=_type_ sigma mean);
I've used 'ParamOpt' as the name of the output data set, but you can use 'Parameter' to overwrite the input data set.
Upvotes: 1