BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
sheriefsalah
Calcite | Level 5

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

 

1 ACCEPTED SOLUTION

Accepted Solutions
Rick_SAS
SAS Super FREQ

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!

View solution in original post

14 REPLIES 14
Rick_SAS
SAS Super FREQ

Start by closing the parentheses on the CLASS statement.  Do you still get an error?

Also, spell GENMOD correctly.

sheriefsalah
Calcite | Level 5

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

Rick_SAS
SAS Super FREQ

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.

 

sheriefsalah
Calcite | Level 5

No i have only the errors stated in the first comment

 

Rick_SAS
SAS Super FREQ

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;
sheriefsalah
Calcite | Level 5

 

                    Dep 1month

Postcode (frequency)

Y

N

total

missing

0

10

10

Rural

181

42127

42308

urbain

955

189304

190259

 

232577

Rick_SAS
SAS Super FREQ

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.

sheriefsalah
Calcite | Level 5

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 ?

sheriefsalah
Calcite | Level 5

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 ?

Rick_SAS
SAS Super FREQ

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.

sheriefsalah
Calcite | Level 5
after that what should i do ?
Rick_SAS
SAS Super FREQ

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 ;
sheriefsalah
Calcite | Level 5

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 😞

Rick_SAS
SAS Super FREQ

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!

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

What is ANOVA?

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.

Discussion stats
  • 14 replies
  • 7315 views
  • 1 like
  • 2 in conversation