BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
harmonic
Quartz | Level 8

Hello community,

 

I am trying to build a regression equation using the proc fmm output:

/* MLE */
ods graphics on /height=900 width=1600;
*ods select DensityPlot;
proc fmm data=casuser.ds gconv=0 plots=density(bins=90) seed=12345 maxiter=2000 plots=all;
class reg_clim_num; 
*bayes MUPRIORPARMS((0,  2E12	) (-40000, .)  ) ;
    model dk_cons = reg_clim_num / dist=normal k=2 parms(-63745 1688330000000,  -39981.1 33440000000);
	ods output ParameterEstimates=ParameterEstimates;
	*ods output PostSummaries=PostSummaries;
	performance cpucount=8;
	output out=ds_out predicted=predicted pred=pred mean=mean residual=residual mixprobs=mixprobs mixweights=mixweights; 
run;


Which parameters should I use? 
y = intercept + ...?

 

harmonic_0-1717141489135.png

 

1 ACCEPTED SOLUTION

Accepted Solutions
Rick_SAS
SAS Super FREQ

The First Component:

1. For observations for which group="group 1", the conditional distribution of dk_cons is 

   f_11 = N(Intercept_1 + beta_1, 1.0489), where the second argument is the estimated Variance

2. For observations for which group="group 2", the conditional distribution of dk_cons is 

   f_12 = N(Intercept_1, 1.0489)

 

The Second Component:

1. For observations for which group="group 1", the conditional distribution of dk_cons is 

   f_21 = N(Intercept_2 + beta_2, 1.0197), where the second argument is the estimated Variance

2. For observations for which group="group 2", the conditional distribution of dk_cons is 

   f_22 = N(Intercept_2, 1.0197)

 

Let p = 0.2573 be the mixing probability. Then the full model  is:

- For observations for which group="group 1", the conditional distribution is p*f_11 + (1-p)*f_21

- For observations for which group="group 2", the conditional distribution is p*f_12 + (1-p)*f_22

 

 

 

View solution in original post

3 REPLIES 3
Rick_SAS
SAS Super FREQ

The image you posted looks like a summary of the descriptive statistics for variables. You want to use the ParameterEstimates table to interpret the model. In the upper left corner of the screen is a drop-down menu that says PostSummaries. Click on that and see if ParameterEstimates is another option to view.

 

In addition, for the FMM procedure, you will need to output the MixingProbs table, so add the statement 

 

ods output ParameterEstimates=ParameterEstimates MixingProbs=MixingProbs;

 

The parameter estimates give the parameters for each component. You will see a column 'Component' that has values 1 and 2, and parameter estimates for "Intercept", the relative increment for each class level, and the variance for each component.  The MixingProbs table will have one mixing probability. Use 1-probability as the second mixing probability.

 

 

harmonic
Quartz | Level 8

I created my own distribution with the values in the csv, I found just one predicted value with this formula:
predicted=([@[intercept_1]]+[@[beta_1]])*[@probs1]+([@intercept2]+[@[beta_2]])*[@probs2]

 

harmonic_2-1717154284644.png

 


How can i find the other predicted value for the other observations?

Rick_SAS
SAS Super FREQ

The First Component:

1. For observations for which group="group 1", the conditional distribution of dk_cons is 

   f_11 = N(Intercept_1 + beta_1, 1.0489), where the second argument is the estimated Variance

2. For observations for which group="group 2", the conditional distribution of dk_cons is 

   f_12 = N(Intercept_1, 1.0489)

 

The Second Component:

1. For observations for which group="group 1", the conditional distribution of dk_cons is 

   f_21 = N(Intercept_2 + beta_2, 1.0197), where the second argument is the estimated Variance

2. For observations for which group="group 2", the conditional distribution of dk_cons is 

   f_22 = N(Intercept_2, 1.0197)

 

Let p = 0.2573 be the mixing probability. Then the full model  is:

- For observations for which group="group 1", the conditional distribution is p*f_11 + (1-p)*f_21

- For observations for which group="group 2", the conditional distribution is p*f_12 + (1-p)*f_22

 

 

 

sas-innovate-white.png

Our biggest data and AI event of the year.

Don’t miss the livestream kicking off May 7. It’s free. It’s easy. And it’s the best seat in the house.

Join us virtually with our complimentary SAS Innovate Digital Pass. Watch live or on-demand in multiple languages, with translations available to help you get the most out of every session.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 1324 views
  • 1 like
  • 2 in conversation