Programming the statistical procedures from SAS

proc genmod error

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 8
Accepted Solution

proc genmod error

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

 


Accepted Solutions
Solution
‎07-03-2017 07:52 AM
SAS Super FREQ
Posts: 3,547

Re: proc genmod error

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


All Replies
SAS Super FREQ
Posts: 3,547

Re: proc genmod error

[ Edited ]

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

Also, spell GENMOD correctly.

Occasional Contributor
Posts: 8

Re: proc genmod error

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

SAS Super FREQ
Posts: 3,547

Re: proc genmod error

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.

 

Occasional Contributor
Posts: 8

Re: proc genmod error

No i have only the errors stated in the first comment

 

SAS Super FREQ
Posts: 3,547

Re: proc genmod error

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;
Occasional Contributor
Posts: 8

Re: proc genmod error

 

                    Dep 1month

Postcode (frequency)

Y

N

total

missing

0

10

10

Rural

181

42127

42308

urbain

955

189304

190259

 

232577

SAS Super FREQ
Posts: 3,547

Re: proc genmod error

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.

Occasional Contributor
Posts: 8

Re: proc genmod error

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 ?

Occasional Contributor
Posts: 8

Re: proc genmod error

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 ?

SAS Super FREQ
Posts: 3,547

Re: proc genmod error

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.

Occasional Contributor
Posts: 8

Re: proc genmod error

after that what should i do ?
SAS Super FREQ
Posts: 3,547

Re: proc genmod error

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 ;
Occasional Contributor
Posts: 8

Re: proc genmod error

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 Smiley Sad

Solution
‎07-03-2017 07:52 AM
SAS Super FREQ
Posts: 3,547

Re: proc genmod error

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!

☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 14 replies
  • 1339 views
  • 0 likes
  • 2 in conversation