I was using the Proc NLMIXED for estimating my model using poisson and negative binomial model. The results change drastically when using the parms statement and assigning initial values. On what basis do we define the initial parameters in the Parms statement? We run the model for the estimation of those coefficient so how do we initially guess the values?
Any help would be greatly appreciated.
Post your code. There are many ways:
This is the code:
proc NLMIXED data = work.spf;
mu=beta_0 +(beta_1/((1+ beta_2*(maj)**(-beta_3))*(1+ beta_4*(min)**(-beta_5))));
NBLL = (lgamma(tot+(1/k)) - lgamma(tot+1) - lgamma(1/k)+ tot*log(k*mu) - (tot+(1/k))*log(1+k*mu));
model tot ~ general (NBLL);
run;
When I assigned mu as a different function with three parameters to be estimated the model converged. The first three solutions you provided are not applicable as I have less knowledge regarding what the parameters should be and there are 7 parameters. Also, I am not much familiar with the method of moments or grid based methods.
Please specify a PARMS statement. Without it, we have no way of knowing which symbols are parameters and which are parameters in the data. For example, I assume the betas are parameters. What about k, tot, min, and maj? Are there any notes or warnings in the SAS log? How many observations in the data set?
Thank you for the response and I apologize for not being clear.
I have defined the PARMS statement below with the default values.
proc NLMIXED data = work.spf;
PARMS beta_0=1 beta_1=1 beta_2=1 beta_3=1 beta_4=1 beta_5=1 k=1;
mu=beta_0 +(beta_1/((1+ beta_2*(maj)**(-beta_3))*(1+ beta_4*(min)**(-beta_5))));
NBLL = (lgamma(tot+(1/k)) - lgamma(tot+1) - lgamma(1/k)+ tot*log(k*mu) - (tot+(1/k))*log(1+k*mu));
model tot ~ general (NBLL);
run;
The Betas and K are the parameters. There are 198 observation. tot is the dependent variable and maj and min are the independent variables.
Any help regarding the initial parameters would be highly appreciated.
I'd try a grid of values, and also supply bounds for any parameters that I know are positive or otherwise constrained. Use domain knowledge to choose reasonable values for the parameter guesses. The example below indicates how to choose a grid of values. The numbers are just made up since I know nothing about your data or experiment.
PARMS beta_0=-1 0 1
beta_1=0.1 1 10 100
beta_2=-2 0 2
beta_3=10 100
beta_4=10 100
beta_5=1 2
k=1;
BOUNDS k > 0;
For more information about choosing a grid of values, see "Use a grid search to find initial parameter values for regression models in SAS"
Thank you for the help. I did try guessing the initial parameters based on other similar models. The model does converge but I get null values or blank spaces in parameter estimates standard error, t Value, confidence limit and P value. What could possibly be the reason for that? These are the notes and warning in Log:
NOTE: Convergence criterion (GCONV=1E-8) satisfied.
NOTE: At least one element of the gradient is greater than 1e-3.
NOTE: Moore-Penrose inverse is used in covariance matrix.
WARNING: The final Hessian matrix is full rank but has at least one
negative eigenvalue. Second-order optimality condition violated.
There are several reasons, but the two most likely are
1. The model does not fit the data.
2. You are using variables that are linearly dependent. For example, if you include a binary indicator variable for "Males" and also include an indicator variable for "Females," the two variables are not independent and the covariance matrix is singular.
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.
Find more tutorials on the SAS Users YouTube channel.