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
- /
- How to apply a bonus/malus on a linear 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 06-11-2020 05:43 AM
(504 views)

Hello,

I'm looking to run estimate a model that looks like this :

Y = (intercept + B1*X1 + B2*X2)*B3*X3

Where B1, B2 and B3 are the coefficients for the categorical variables X1, X2 and X3. Note that I already know the coefficients for each modality of X3 (it is a Bonus variable whose coefficients are under the form : 0.5; 0.51 ; ... ; 0.99).

I'm not sure what I should to estimate this kind of model. Until now i was using a GLM. My idea was to transform the Y variable into a Y2=Y/(B3*X3) and then run the GLM where the X3 variable is specified but there would be no need to calculate the B3 coefficients...

But maybe an other specification or procedure would be better.

I hope i was clear enough. Thank you for your help. Have a good day.

1 ACCEPTED SOLUTION

Accepted Solutions

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

I am sure that there are ways to fit this with a nonlinear model, but since you specify values for B3, rather than solving for an optimal B3, I believe your idea of transforming the response variable is quite clever, and should provide an analysis.

SteveDenham

3 REPLIES 3

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

I am sure that there are ways to fit this with a nonlinear model, but since you specify values for B3, rather than solving for an optimal B3, I believe your idea of transforming the response variable is quite clever, and should provide an analysis.

SteveDenham

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

Hi,

I did the transformation of Y, but then I don't know how to take the X3 variable into account without asking GLM to predict the coefficients...

And if i don't take it into account, I get a R^2 divided by almost 2...

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

So you should have 50 copies of your data, stepping from 0.5 to 0.99 for B3, where you calculate your new Y variable values based on dividing Y by B3 times the value of X3. So if you fit this rescaled Y with PROC GLM with MODEL Yrescal= X1 X2/solution; and with B3 as a BY variable, you should get 50 R^2 values. From there you can plot what you need.

The drawback here is that you said X3 is categorical. So I have to ask, does the fixed B3 value apply equally to all levels? If X3 has 2 levels, then per GLM parameterization, you would have a vector that looks like [1 0} for the first level and [0 0] for the second level (reference level). So the rescaled Y would be Y/B3 for the first level, and Y for the second level. Easy enough.

But suppose X3 has 3 levels. You will now need vectors with 3 elements [1 0 0] for level 1, [0 1 0] for level 2 and [0 0 0] for level 3. Because you are fitting a constant B3, your rescaled values would look like Y/B3 for level 1, Y/B3 for level 2, and Y for level 3. If this makes sense, then eveything is OK. I feel uncomfortable dividing all of the non-reference level values of Y by the current B3, and leaving the reference level unchanged. I suspect I have missed something critical in the design for your data, so additional information would be helpful.

SteveDenham

**SAS Innovate 2025** is scheduled for May 6-9 in Orlando, FL. Sign up to be **first to learn** about the agenda and registration!

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.