I have used this programming code
proc gemod data=postalcode descending ; class Nam postcode (param = ref ref='rural' ;
model Dep1month=postcode / link=logit dist=binomial ;
repeated subject =Nam /type= exch;
run ;
I had this error :
error in computing the variance function
error in parameter estimate covarince computation
error in estimation routine.
how to fix this problem by steps please ?
Sherief
Universite de montreal
I'm not going to debug your program for you, but I will give you one last hint:
1) Read the error message, which says "invalid reference value."
2) Look back at the PROC FREQ output for the POSTCODE variable
3) Remember that string comparison is case SENSITIVE.
Good luck!
Start by closing the parentheses on the CLASS statement. Do you still get an error?
Also, spell GENMOD correctly.
I close it but stil have the same problem. Do you have a fix to this problem in steps how can i remove these errors please
Are there any other NOTES or WARNINGS in the log? For example, do you see either of these?
WARNING: The number of response pairs for estimating correlation is less
than or equal to the number of regression parameters. A simpler
correlation model might be more appropriate.
WARNING: The generalized Hessian matrix is not positive definite.
Iteration will be terminated.
No i have only the errors stated in the first comment
Most likely it is something related to your data. Can you post the data or at least provide the results of
proc freq data=postalcode ;
tables Dep1month*postcode / norow nocol nopercent nocum;
run;
| Dep 1month | ||
Postcode (frequency) | Y | N | total |
missing | 0 | 10 | 10 |
Rural | 181 | 42127 | 42308 |
urbain | 955 | 189304 | 190259 |
| 232577 |
I'm confused. The dependent variable should have two levels. Is "missnig" a level in the data, or did you specify an option in PROC FREQ to make that entry appear?
If it is really in the data, put the statement
WHERE postcode ^= "missing";
in your PROC GENMOD call.
my dependent variable here is depression yes or no (binary) while my indepnedent variable is postcode i have 3 levels like you see rural, urbain and missing . my question is why there is an error when i did proc genmode ?
i have this warning when changed the dependent variable :
WARNING: The generalized Hessian matrix is not positive definite.
Iteration will be terminated.
is there is sloution for this ?
Sorry. In my last post I confused the dependent and independent variables.
I suspect the problem is that you have a level of the INdependent variable (missing) for which the response is constant. Get rid of that level, as I suggested. You will be omitting 10 of 232,000 observations.
Then run the procedure:
proc genmod data=postalcode descending;
WHERE postcode ^= "missing";
class Nam postcode (param=ref ref='rural');
model Dep1month=postcode / link=logit dist=binomial ;
repeated subject =Nam / type=exch;
run ;
error : invalid reference value for postcode
error no valid observation due to invalid or missing values in the response, explanatory offset , frequency or weight variable.
after i did ur programation code. how can i solve that 😞
I'm not going to debug your program for you, but I will give you one last hint:
1) Read the error message, which says "invalid reference value."
2) Look back at the PROC FREQ output for the POSTCODE variable
3) Remember that string comparison is case SENSITIVE.
Good luck!
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 16. Read more here about why you should contribute and what is in it for you!
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.