BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Mathis1
Quartz | Level 8

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
SteveDenham
Jade | Level 19

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

View solution in original post

3 REPLIES 3
SteveDenham
Jade | Level 19

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

Mathis1
Quartz | Level 8

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...

 

 

SteveDenham
Jade | Level 19

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-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

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.

Discussion stats
  • 3 replies
  • 340 views
  • 0 likes
  • 2 in conversation