design matrix coding

questions concerning analysis/theory using program MARK

design matrix coding

Postby Kiel » Wed Mar 30, 2005 2:13 pm

I made a mistake in the design matrix while running a survival analysis (Brownie et al. recoveries) that resulted in redundant coding within the design matrix. Upon noticing the mistake, I fixed it, and compared the results from these different codings of the 'same' model. The number of parameters were the same but the deviances were very different. Now I realize that if the design matricies differ, then the deviances should differ; but to satisfy my curiosity I went ahead and ran these two codings on a different data set and this time the number of parameters and the deviances were exactly the same. Below are a couple of simplified examples of how the DMs differed. First the DM with the redundant coding.

110100100000
110010010000
110001001000
110000000000
101100000100
101010000010
101001000001
101000000000

The first column is a common intercept, the 2nd and 3rd are group designation (the 3rd being the first redundant column, the zeros in the 2nd have already coded for this group). Columns 4-6 are time, 7-9 are the group by time interaction, and unnecessary columns 10-12 are the group by time interaction for the second group...that wouldn't be there if the analyst were paying better attention. Nonetheless, I ran this model and then noticed the mistake...disclaimer: the DM I'm working with is 200x200 which makes it a little easier to make this kind of mistake :). I then ran the correct DM coding to:

11100100
11010010
11001001
11000000
10100000
10010000
10001000
10000000

Where column 1 is the common intercept, c2 the group designation, c3-5 time, and c6-8 the group by time interaction.

When I compared the results of these two models and noticed the the number of parameters were the same and I figured that MARK just accounted for the redundant columns, but the deviance were markedly different. When I did the same on a different data set (also Brownie et al. recoveries) both the number of parameters and the deviances were identical. What would cause this inconsistency?

Kiel
Kiel
 

Re: design matrix coding

Postby cooch » Wed Mar 30, 2005 2:49 pm

Just some preliminary clarification...


110100100000
110010010000
110001001000
110000000000
101100000100
101010000010
101001000001
101000000000

The first column is a common intercept, the 2nd and 3rd are group designation (the 3rd being the first redundant column, the zeros in the 2nd have already coded for this group).


First, tell us the basics of the DM - how many groups, how many occasions, and so on. Its tough to wade through a DM without the basic bounds on the problem. I realize your 'real' DM is very large, but for your example (as posted).

I ask because you have 2 columns for group, which implies 3 groups (n-1 columns for n groups). But, your actual coding shows only 2 groups (i.e., everything is either '10' or '01'), which doesn't make sense (and wouldn't work, anyway).
cooch
 
Posts: 1654
Joined: Thu May 15, 2003 4:11 pm
Location: Cornell University

Postby Kiel » Wed Mar 30, 2005 7:19 pm

The basics of the example DM - 2 groups, 4 occasions. The example I've given would be the DM for the global model. I realize that I have 2 columns for group and that it implies that there are 3 groups. This is the exact mistake that I made, except that in the 'real' DM I was working with 8 groups. In the 'real' instance I was testing for sex and marker effects by reducing the parameterization in the DM such that these effects were equal for some groups but not others. While doing this, I ended up with what I have called my redundantly coded DM where I had reduced the number of groups to 6, but had 6 columns for group. Believe it or not, the model did run...if that's what you meant by worked? And, as I stated in my previous message, when I did this with the other data set, not only did it work, but the number of parameters and deviance were exactly the same.
Kiel
 


Return to analysis help

Who is online

Users browsing this forum: No registered users and 0 guests

cron