Super User

## PROCs for multiplicative (?) model

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
SAS Super FREQ

## Re: PROCs for multiplicative (?) model

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
Lapis Lazuli | Level 10

## Re: PROCs for multiplicative (?) model

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

-unison

-unison
Super User

## Re: PROCs for multiplicative (?) model

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.
SAS Super FREQ

## Re: PROCs for multiplicative (?) model

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.

Super User

## Re: PROCs for multiplicative (?) model

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.
SAS Super FREQ

## Re: PROCs for multiplicative (?) model

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

Discussion stats
• 5 replies
• 950 views
• 6 likes
• 3 in conversation