Yes.
Assuming the method of moments converges, PROC UNIVARIATE will create the ParameterEstimates table. You can write any SAS table to a data set by using the ODS OUTPUT statement. See ODS OUTPUT: Store any statistic created by any SAS procedure - The DO Loop
/* Johnson SB(threshold=theta, scale=sigma, shape=gamma, shape=delta) */
data SB(keep= X);
call streaminit(1);
do i = 1 to 1000;
x = rand("Lognormal", 0, 0.4);
output;
end;
run;
/* set bins: https://blogs.sas.com/content/iml/2014/08/25/bins-for-histograms.html */
proc univariate data=SB;
histogram X / SB(theta=0 sigma=145 fitmethod=moments);
ods output ParameterEstimates = PE;
output out = temp_file_1 mean = x_var_Mean std = x_var_Std;
run;
data _null_;
set temp_file_1;
call symput('x_var_Mean', x_var_Mean);
call symput('x_var_Std', x_var_Std);
run;
data _null_;
set PE;
if symbol='Delta' then
call symput('dist_delta', Estimate);
if symbol='Gamma' then
call symput('dist_gamma', Estimate);
run;
%put &=x_var_Mean;
%put &=x_var_Std;
%put &=dist_delta;
%put &=dist_gamma;
... View more