SAS Procedures

Help using Base SAS procedures
BookmarkSubscribeRSS Feed
Ajktulm
Calcite | Level 5

I'm trying to model the some variable according to the normal distribution with the following parameters:

- It has some mean, depending on in which class it is (for this I have the indicator variables V3,V4,V5,V6 which for each entry one is 1, the others are 0) and some variance depending on a few parameters: the group, subgroup, device and method. Now all these have some normal distribution with mean 0 and unknown variance (it is the variance that I want to model), but all groups are identically distributed (so group 1 and 2 follow the same distribution), but within a group all values are the same (so the contribution that being in group 1 yields to every sample in the group is the same). In total I get

 

V2 = mean + variance caused by group + variance caused by subgroup + variance caused by device + variance caused by method

 

Where all variances are stochastic and assumed to be normal(0,x) where I want to find the 4 x's..

 

I wanted to do this with proc NLmixed and classifying the group,subset,device,method as class variables, but that doesn't exist... so my question is how to deal with this problem? The code I have is

 

PROC NLMIXED DATA=para1;

PARMS a = 0.00001, b = 0.000001, c = 0.000001,d = 0.000001,e = 0.000001;
mu = a + b*V3 + c*V4 + d*V5 + e*V6;
sigma = ???;
MODEL V2 ~ Normal(mu,sigma);
RUN;

 

where if I take for example sigma=0.00001 I can find the a,b,c,d,e I'm looking for, but I also want to estimate the variances.

1 REPLY 1
DWilson
Pyrite | Level 9

@Ajktulm wrote:

I'm trying to model the some variable according to the normal distribution with the following parameters:

- It has some mean, depending on in which class it is (for this I have the indicator variables V3,V4,V5,V6 which for each entry one is 1, the others are 0) and some variance depending on a few parameters: the group, subgroup, device and method. Now all these have some normal distribution with mean 0 and unknown variance (it is the variance that I want to model), but all groups are identically distributed (so group 1 and 2 follow the same distribution), but within a group all values are the same (so the contribution that being in group 1 yields to every sample in the group is the same). In total I get

 

V2 = mean + variance caused by group + variance caused by subgroup + variance caused by device + variance caused by method

 

Where all variances are stochastic and assumed to be normal(0,x) where I want to find the 4 x's..

 

I wanted to do this with proc NLmixed and classifying the group,subset,device,method as class variables, but that doesn't exist... so my question is how to deal with this problem? The code I have is

 

PROC NLMIXED DATA=para1;

PARMS a = 0.00001, b = 0.000001, c = 0.000001,d = 0.000001,e = 0.000001;
mu = a + b*V3 + c*V4 + d*V5 + e*V6;
sigma = ???;
MODEL V2 ~ Normal(mu,sigma);
RUN;

 

where if I take for example sigma=0.00001 I can find the a,b,c,d,e I'm looking for, but I also want to estimate the variances.


 

See example 82.6:

https://support.sas.com/documentation/onlinedoc/stat/141/nlmixed.pdf

 

 

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!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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
  • 1 reply
  • 840 views
  • 0 likes
  • 2 in conversation