Turn on suggestions

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

Showing results for

- Home
- /
- Analytics
- /
- Stat Procs
- /
- PROCs for multiplicative (?) model

Options

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

🔒 This topic is **solved** and **locked**.
Need further help from the community? Please
sign in and ask a **new** question.

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

Posted 12-12-2019 09:31 AM
(949 views)

Hi All,

I'm not a modeling person, though at times in my life I've run PROC REG, PROC LOGISTIC, and a few other basic modeling PROCs like those.

So I know how to fit a linear model like:

y= B0 + B1*X1 + B2*X1**2

I've been asked to play around with some data, fitting a model like:

y= (B0 + B1*X1 + B2*X1**2 ) ***** (1 + B3*X2 + B4*X2**2) ***** (1 + B5*X3 + B6*X3**2)

The concept of the model (I think : ) is that the first term in parentheses uses X1 to predict Y, the second term uses X2 to inflate/deflate the prediction, and the third term uses X3 to further inflate/deflate the prediction. We want estimates of B0-B6, which will ultimately used for prediction/scoring. Y and all of the predictors are continuous.

So this looks to me like it's not an additive model, it's some mix of additive and multiplicative. I was reading up last night on GLMSELECT, but I don't think it's meant for this sort of model. What PROCs should I be reading up on?

Is this the world of PROC NLIN, PROC MODEL or something else? I have SAS/STAT SAS/ETS and SAS/QC.

Thanks,

-Q.

BASUG is hosting ** free webinars **! Check out our recordings of past webinars: https://www.basug.org/videos. Be sure to subscribe to our email list for notification of future BASUG events.

1 ACCEPTED SOLUTION

Accepted Solutions

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

I don't think I'd describe the model the same way you did (a quadratic that is inflated/deflated), but I will leave the interpretation to you. Yes, this is probably a good task for PROC NLIN, which performs least-squares estimates for nonlinear regression models.

```
data Have;
array B[0:6] B0-B6 (1 2 -0.3
0.4 -0.5
0.1 0.2 );
call streaminit(123);
do x1 = -1 to 1;
do x2 = -1 to 1;
do x3 = -1 to 1;
y = (B0 + B1*X1 + B2*X1**2 ) *
(1 + B3*X2 + B4*X2**2) *
(1 + B5*X3 + B6*X3**2)
+ rand("Normal", 0, 0.2);
output;
end;
end;
end;
drop B0-B6;
run;
proc nlin data=Have method=marquardt;
parms B0 0
B1 0
B2 -1
B3 0
B4 -1
B5 0
B6 1;
model Y = (B0 + B1*X1 + B2*X1**2 ) *
(1 + B3*X2 + B4*X2**2) *
(1 + B5*X3 + B6*X3**2);
run;
```

Note well the error structure that I used for the simulated data. The errors are additive.

5 REPLIES 5

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

Perhaps model the log() of your desired model and then it becomes some sort of linear-log model? Just a thought.

-unison

-unison

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

Thanks @unison . I think that's a good thought when the model is Y=X1*X2*X3, e.g. **http://www-ist.massey.ac.nz/dstirlin/CAST/CAST/Hmultiplicative/multiplicative1.html.**

But I don't have variables being multiplied, I have expressions being multiplied:

y= (B0 + B1*X1 + B2*X1**2 ) ***** (1 + B3*X2 + B4*X2**2) ***** (1 + B5*X3 + B6*X3**2)

And I want an estimate for all 7 parameters (B0-B6).

So I don't have a variable to take the log of.

BASUG is hosting ** free webinars **! Check out our recordings of past webinars: https://www.basug.org/videos. Be sure to subscribe to our email list for notification of future BASUG events.

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

I don't think I'd describe the model the same way you did (a quadratic that is inflated/deflated), but I will leave the interpretation to you. Yes, this is probably a good task for PROC NLIN, which performs least-squares estimates for nonlinear regression models.

```
data Have;
array B[0:6] B0-B6 (1 2 -0.3
0.4 -0.5
0.1 0.2 );
call streaminit(123);
do x1 = -1 to 1;
do x2 = -1 to 1;
do x3 = -1 to 1;
y = (B0 + B1*X1 + B2*X1**2 ) *
(1 + B3*X2 + B4*X2**2) *
(1 + B5*X3 + B6*X3**2)
+ rand("Normal", 0, 0.2);
output;
end;
end;
end;
drop B0-B6;
run;
proc nlin data=Have method=marquardt;
parms B0 0
B1 0
B2 -1
B3 0
B4 -1
B5 0
B6 1;
model Y = (B0 + B1*X1 + B2*X1**2 ) *
(1 + B3*X2 + B4*X2**2) *
(1 + B5*X3 + B6*X3**2);
run;
```

Note well the error structure that I used for the simulated data. The errors are additive.

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

Thanks much @Rick_SAS , will read up on NLIN tonight. I've used it once before, but I was spoon-fed the code from a statistician. It is cool how you just write the model.

BASUG is hosting ** free webinars **! Check out our recordings of past webinars: https://www.basug.org/videos. Be sure to subscribe to our email list for notification of future BASUG events.

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

Glad to help. I have some prior experience with simulating data.

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. **Registration is now open through August 30th**. Visit the SAS Hackathon homepage.

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.