BookmarkSubscribeRSS Feed
Mruizv
Obsidian | Level 7

Trying to compare parameter estimates for a repeated measure study but not getting anything when running independent correlation- any hint on what is wrong with the program?

 

data egg;
input treat clutch hatch total;
datalines;
1 1 0 6
1 2 0 13
1 3 0 10
1 4 0 16
1 5 0 32
1 6 0 7
1 7 0 21
2 1 3 6
2 2 0 13
2 3 8 10
2 4 10 16
2 5 25 28
2 6 7 7
2 7 10 20
3 1 0 6
3 2 0 13
3 3 6 9
3 4 9 16
3 5 23 30
3 6 5 7
3 7 4 20
;
run;


* all observations independent;
proc logistic data=egg; 
class treat(ref='1') / param=ref; 
model hatch/total = treat / scale=none; 
title 'all observations independent';
run; 

* gee with independent corr structure;
proc genmod data=egg ; 
class treat(ref='1') clutch / param=ref; 
model hatch/total = treat/ link=log dist=bin type3 wald; 
repeated subject=clutch / type=ind corrw; 
title 'gee with independent corr structure';
run; 
4 REPLIES 4
ballardw
Super User

The first thing is to read your log. Running your code this what the log I get looks like, posted below in the text box.

The items I have highlighted in green indicate that the data provided does not work well with the options or analysis chosen. Note the warning with Proc logistic that the results could be questionable. The log for Proc Genmod says the data can't be used at all.

30   proc logistic data=egg;
31   class treat(ref='1') / param=ref;
32   model hatch/total = treat / scale=none;
33   title 'all observations independent';
34   run;

NOTE: Writing HTML Body file: sashtml.htm
WARNING: There is possibly a quasi-complete separation of data points. The maximum likelihood
         estimate may not exist.
WARNING: The LOGISTIC procedure continues in spite of the above warning. Results shown are based
         on the last maximum likelihood iteration. Validity of the model fit is questionable.
NOTE: There were 21 observations read from the data set WORK.EGG.
NOTE: PROCEDURE LOGISTIC used (Total process time):
      real time           0.45 seconds
      cpu time            0.32 seconds


35
36
37   proc genmod data=egg ;
38   class treat(ref='1') clutch / param=ref;
39   model hatch/total = treat/ link=log dist=bin type3 wald;
40   repeated subject=clutch / type=ind corrw;
41   title 'gee with independent corr structure';
42   run;


WARNING: The negative of the Hessian is not positive definite. The convergence is questionable.
WARNING: The procedure is continuing but the validity of the model fit is questionable.
WARNING: The specified model did not converge.
WARNING: Negative of Hessian not positive definite.
WARNING: The generalized Hessian matrix is not positive definite. Iteration will be terminated.
ERROR: Error in parameter estimate covariance computation.
ERROR: Error in estimation routine.
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE GENMOD used (Total process time):
      real time           0.06 seconds
      cpu time            0.01 seconds

42 !      title;


Without knowing more about the actual analysis desired I am not going to make detailed model suggestions.

A comment though is that with hatch 0 for all records in treat=1 that means that treatment is basically showing no other results. You might try only using Treat 2 and 3 to test the code and see if that helps. You would have to modify the Reference level when using Treat as a class.

Mruizv
Obsidian | Level 7

I am aware that the independence correlation model might not be ideal but I need to compare parameter estimates and difference in errors of the estimates.

I do note now what you mention in red which is probably why I am not getting any results - doubting the repeated subject as there were 21 clusters assigned to the treatments in batches of 7 but really no clutch has a repeated observation.

ballardw
Super User

@Mruizv wrote:

I am aware that the independence correlation model might not be ideal but I need to compare parameter estimates and difference in errors of the estimates.

I do note now what you mention in red which is probably why I am not getting any results - doubting the repeated subject as there were 21 clusters assigned to the treatments in batches of 7 but really no clutch has a repeated observation.


I didn't say anything about Clutch having repeated observations. I said that for your first treatment the values of HATCH are the same.

 

datalines;
1 1 0 6
1 2 0 13
1 3 0 10
1 4 0 16
1 5 0 32
1 6 0 7
1 7 0 21

See the red? All those zeroes are Hatch. Which is the dependent variable for your model. Think about what that means in terms of a supposed binomial distribution, the Dist=bin.

 

 

Mruizv
Obsidian | Level 7

Oh I see, that is what I was trying to offset with the hatch/total and not using the counts itself as the response.
tried changing the reference level to 2 or 3 and getting same output in the Log

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!

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 4 replies
  • 834 views
  • 0 likes
  • 2 in conversation