08-26-2014 03:31 AM
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.
08-27-2014 11:27 AM
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.
08-27-2014 06:55 PM
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?
08-28-2014 10:29 AM
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.