Programming the statistical procedures from SAS

How to estimate the parameters for nonlinear function?

Reply
Contributor
Posts: 36

How to estimate the parameters for nonlinear function?

Hi Guys,

I want to fit my data with the function as below:

y=a*exp(b*x1)+c*x2+d*x3+e*x4

x1,x2 are continoues preditc variables,and x3,x4 are catogory preditc variables. a,b,c,d,e are paramters which need to be estimated.

Which procedure will work? proc nlin works for catogory preditc variables?

Thanks.

Tomi

Respected Advisor
Posts: 2,655

Re: How to estimate the parameters for nonlinear function?

If you have x3 and x4 coded as categorical, then you should be ready to use PROC NLIN.  If they have not yet been coded, you will probably want to run your data through PROC GLMMOD to automatically convert categorical variables to the coded form needed for regression.

Steve Denham

Contributor
Posts: 36

Re: How to estimate the parameters for nonlinear function?

Thanks, Steve.

I'm supposed to create dummy variables for all catogary data first and then use PROC NLIN to do regreesion, right?

Tomi

Valued Guide
Valued Guide
Posts: 679

Re: How to estimate the parameters for nonlinear function?

Yes, you need dummy variables. If X3 has three levels, then you need two dummy variables. Using GLM-type parametrization, you would need X3_1 (where X3_1 = 1 if X3 is at level 1, 0 otherwise) and X3_2 (where X3_2 = 1 if X3 is at level 2, and 0 otherwise). Same for X4. This means you could have many parameters to estimate and interpret with proc nlin or proc nlmixed. It can get tricky.

Ask a Question
Discussion stats
  • 3 replies
  • 152 views
  • 0 likes
  • 3 in conversation