input file for multiple groups and individual covariates

questions concerning analysis/theory using program MARK

input file for multiple groups and individual covariates

Postby megpetrie » Tue Dec 21, 2010 9:11 pm

Hello,
I have searched for an example of how to set up an .inp file to code for multiple groups and individual covariates without luck. I assume one must list individual encounter histories, and then a column of 1's to indicate the frequency for the second column. After that would I set up dummy variable columns (# of groups-1) before the column for the covariate?

Thanks for any help!

Megan
megpetrie
 
Posts: 23
Joined: Tue Feb 06, 2007 4:48 pm

Re: input file for multiple groups and individual covariates

Postby cooch » Tue Dec 21, 2010 10:02 pm

megpetrie wrote:Hello,
I have searched for an example of how to set up an .inp file to code for multiple groups and individual covariates without luck.


Kudos on at least trying. Not surprising that you didn't find anything, because I don't think this has been addressed before (odd, since your questions considers a situation which I suspect is pretty common. I'll have to add this to the book for a future 'printing' -- thanks!)

I assume one must list individual encounter histories, and then a column of 1's to indicate the frequency for the second column. After that would I set up dummy variable columns (# of groups-1) before the column for the covariate?


Not quite (or I'm not quite understanding you). There are a couple of ways you could handle this. You can either code for the groups explicitly in the .inp file, or use an individual covariate for the groups. There are pros and cons to either approach (discussed in Chapter 11).

Here is an snippet from data set with 2 groups coded explicitly, and an individual covariate. In this snippet, the first 8 contiguous values are the encounter history, followed by 2 columns representing the frequencies depending on group: "1 0" indicating group 1, and "0 1" indicating group 2, followed by the value of the covariate:

Code: Select all
11111111 1 0 123.211;
11111111 0 1  92.856;
11111110 1 0 122.115;
11111110 1 0 136.460;   


So, the first record with an encounter history of 11111111 is in group 1, and has a covariate value of 123.211. The second individual, also with an encounter history of 11111111, is in group 2, and has a covariate value of 92.856. The third individual has an encounter history of 11111110, and is in group 1, with a covariate value of 122.115. And so on.

If you wanted to code the group as an individual covariate, this same input file snippet would look like:

Code: Select all
11111111 1 1 123.211;
11111111 1 0  92.856;
11111110 1 1 122.115;
11111110 1 1 136.460;   


Here, following the encounter history, is a column of 1's, indicating the frequency for each individual, followed by a column containing a 0/1 dummy code to indicate group (in this example, I've used a 1 to indicate group 1, 0 to indicate group 2), followed by the value of the covariate.
cooch
 
Posts: 1654
Joined: Thu May 15, 2003 4:11 pm
Location: Cornell University

Re: input file for multiple groups and individual covariates

Postby megpetrie » Wed Dec 22, 2010 12:37 pm

Thanks for your help!
Just to make sure, since I have 17 groups (is that crazy?), how would I extend that to more than 2 groups?

For three groups, would the encounter history look like this?

11111 1 0 0 123.5;
11110 0 1 0 99.8;
11111 0 0 1 115.2;

The first individual is in group 1 and has an encounter history of 11111 and covariate 123.5, second individual (group 2) has encounter history 11110 and covariate 99.8, third individual (group 3) has encounter history 11111 and covariate 115.2.

Thanks again,
Megan
megpetrie
 
Posts: 23
Joined: Tue Feb 06, 2007 4:48 pm

Re: input file for multiple groups and individual covariates

Postby cooch » Wed Dec 22, 2010 12:48 pm

megpetrie wrote:Thanks for your help!
Just to make sure, since I have 17 groups (is that crazy?),


Well, perhaps not crazy, but you will have some challenges building models, unless you have some strong covariates you can use to apply constraints to your groups (based on the premise that heterogeneity among groups is not particularly interesting in and of itself. What *is* interesting is *why* there are differences, and what the magnitude of those differences might relate to biologically).

how would I extend that to more than 2 groups?

For three groups, would the encounter history look like this?

11111 1 0 0 123.5;
11110 0 1 0 99.8;
11111 0 0 1 115.2;

The first individual is in group 1 and has an encounter history of 11111 and covariate 123.5, second individual (group 2) has encounter history 11110 and covariate 99.8, third individual (group 3) has encounter history 11111 and covariate 115.2.


Correct. There are examples of this (multiple groups -- even groups within groups -- sans the individual covariates) in Chapter 2.
cooch
 
Posts: 1654
Joined: Thu May 15, 2003 4:11 pm
Location: Cornell University


Return to analysis help

Who is online

Users browsing this forum: No registered users and 4 guests