- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
I have multiple predictors and a continuous outcome. I want to do a nonlinear regression, not sure about model parameters. What approach/procedure should I use? Could you please provide good SAS example code?
Many thanks!
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
The values in the PARMS statement are starting values for the function. The maximum likelihood algorithm updates these until the convergence criterion is met.
Now if you only want to do Poisson regression, there are other PROCs already geared for that - GENMOD and GLIMMIX come to mind, depending on whether you have random effects (GLIMMIX) or not (GENMOD). Other PROCs capable of this sort of regression are really not for a first voyage into Poisson regression (BGLIMM, HPGENSELECT, MCMC) And that is just in SAS/STAT - there are more in SAS/ETS.
SteveDenham
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
There are many examples in the PROC NLIN documentation.
Paige Miller
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
know what to fit? I would like SAS to determine the best-fitting curve.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
"Best fitting curve" can mean a lot of different things. Without a much more detailed description of the problem you have, no one can give you a detailed answer.
And just because the examples are exponential, the same methods can be used on other non-linear models.
Paige Miller
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
fitting curve. Is there a separate procedure for that? Then i can provide
this equation to proc nlin. There are multiple predictors and the outcome
is a normally distributed continuous variable.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Since you don't care for any particular function (or set of functions) I would suggest that you try proc adaptivereg.
it does (almost) everything for you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Another option is to use PROC TRANSREG, there are many different types of spline fits in there.
Paige Miller
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
However, proc nlin is parametric, vs. proc adaptivereg is non-parametric. It is good to know about proc adaptivereg, but the results of proc nlin may be more interpretable.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Here is the issue: There are an infinite number of possible non-linear curves. Some will have interpretable coefficients, some may not. You need to define a family of possible curves that have some sort of meaning for the data and the process that generates them. Then I would suggest using NLMIXED to fit each of these to exactly the same data, and collecting the AIC values, and selecting the model with the minimum AIC. This preserves the most information in the data. In most cases, this is the "best-fitting" model, plus you already have the output you need.
SteveDenham
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Thank you very much for helpful suggestions! @SteveDenham , about NLMIXED, maybe I can use Poisson regression described here for my continuous outcome variable?:
https://stats.idre.ucla.edu/sas/faq/how-can-i-run-simple-linear-and-nonlinear-models-using-nlmixed/
Do you know why they set all parameters to zero in the code?:
proc nlmixed data='D:datahsbdemo.sas7bdat';
parms b0=0 b1=0 b2=0;
xb=b0+b1*read+b2*female;
mu = exp(xb);
model awards ~ poisson(mu);
run;
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
The values in the PARMS statement are starting values for the function. The maximum likelihood algorithm updates these until the convergence criterion is met.
Now if you only want to do Poisson regression, there are other PROCs already geared for that - GENMOD and GLIMMIX come to mind, depending on whether you have random effects (GLIMMIX) or not (GENMOD). Other PROCs capable of this sort of regression are really not for a first voyage into Poisson regression (BGLIMM, HPGENSELECT, MCMC) And that is just in SAS/STAT - there are more in SAS/ETS.
SteveDenham
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Also try EFFECT statement in many PROC ,like proc glm ......
@Rick_SAS wrote a couple of blog about this topic .