Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Home
- /
- Programming
- /
- SAS Procedures
- /
- How to define class-like variable in PROC NLMIXED?

Options

- RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Posted 11-05-2019 12:24 PM
(366 views)

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

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

@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

**Don't miss out on SAS Innovate - Register now for the FREE Livestream!**

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

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.