BookmarkSubscribeRSS Feed
harmonic
Obsidian | Level 7

Hello community,

 

I am struggling finding the components for a normal distribution function using the parameter class, where should I find for each category the parameters to write my probability function.

 

My first step was to fit my function to my data like that:

ods graphics on /height=900 width=1600;
ods select DensityPlot;
proc hpfmm data=casuser.ds_11_15 gconv=0 plots=density(bins=90);
class reg_clim_num; 
bayes MUPRIORPARMS((0,  2E12	) (-40000, .)  ) ;
   model dk_cons =/ dist=normal k=2 /*parms(23000000 ., 34000000 ., 120000000 . )*/;
	ods output PostIntervals=PostIntervals;
	ods output PostSummaries=PostSummaries;
run;

harmonic_0-1716987251324.png

Then I would like to define the parameters by my category variable reg_clim

 

ods graphics on /height=900 width=1600;
ods select DensityPlot;
proc hpfmm data=casuser.ds_11_15 gconv=0 plots=density(bins=90);
class reg_clim; 
bayes MUPRIORPARMS((0,  2E12	) (-40000, .)  ) ;
   model dk_cons = reg_clim/ dist=normal k=2 /*parms(23000000 ., 34000000 ., 120000000 . )*/;
	ods output PostIntervals=PostIntervals;
	ods output PostSummaries=PostSummaries;
run;

 

 

WARNING: Output 'DensityPlot' was not created.  Make sure that the output object name, label, or path is spelled correctly.  Also, 
         verify that the appropriate procedure options are used to produce the requested output object.  For example, verify that 
         the NOPRINT option is not used.

I got this warning with no plot distribution and with these outputs

harmonic_2-1716987491739.png

harmonic_3-1716987533523.png

 

I don't know how to interpret them. The mean has strange values and the reg_clim 15 has missing parameters.

 

Do you have any advice, thank you 🙂



I will upload my data and my output.


2 REPLIES 2
ballardw
Super User

@harmonic wrote:

Hello community,

 

I am struggling finding the components for a normal distribution function using the parameter class, where should I find for each category the parameters to write my probability function.




If you are looking for separate output for each level of your Reg_clim_num or Reg_clim then I think that means you want the variable as a BY variable and not CLASS. Sort the data by Reg_clim_num and then use:

ods select DensityPlot;
proc hpfmm data=casuser.ds_11_15 gconv=0 plots=density(bins=90);
by reg_clim_num; 
bayes MUPRIORPARMS((0,  2E12	) (-40000, .)  ) ;
   model dk_cons =/ dist=normal k=2 /*parms(23000000 ., 34000000 ., 120000000 . )*/;
	ods output PostIntervals=PostIntervals;
	ods output PostSummaries=PostSummaries;
run;

From the online help:

BY Statement

  • BY variables;

 

You can specify a BY statement in PROC HPFMM to obtain separate analyses of observations in groups that are defined by the BY variables. When a BY statement appears, the procedure expects the input data set to be sorted in order of the BY variables. If you specify more than one BY statement, only the last one specified is used.

 

 

 

harmonic
Obsidian | Level 7

I would like the same output but with class define different regressors for each combination of reg_clim and period.

harmonic_0-1716998008844.png