BookmarkSubscribeRSS Feed
lucyygao
Calcite | Level 5

Hi,

I am trying to run an NLMIXED model with firm fixed effects. However I have thousands of firms, and there is no by class command that can be used for the NLMIXED model.

What is the best way to incorporate the fixed effects into the model? I'm not sure if dummies would work as I would have to create thousands of dummies.

Thanks,

Lucy

3 REPLIES 3
SteveDenham
Jade | Level 19

I think the best you might do is to fit for each firm separately, with a BY statement or by setting up some sort of macro loop.  But is that really meaningful?  Do you need a separate equation for each firm as a deliverable?  With thousands of firms, I would think of firm as a random effect--that there is a single underlying equation, and the firms are a source of variability for the parameters in that equation.

Steve Denham

lucyygao
Calcite | Level 5

Hi Steve,

Thanks for your response.

I don't need the parameters for each firm, only the ones of the main equation. If that's the case, how would I go about including the firms as a random effect using the NLMIXED command?

Thanks,

Lucy

SteveDenham
Jade | Level 19

There is a very good example (Example 70.1 One-Compartment Model with Pharmacokinetic Data) in the SAS/STAT13.2 documentation.  It is in previous versions as well.  In this example there is data for several subjects, and an overall equation is fit, with a random statement fitting additional components.  Simply replace subjects with firms and I think you will be good to go.

Steve Denham

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

Register Now

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

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