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

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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