Categorical covariate coding

questions concerning analysis/theory using program MARK

Categorical covariate coding

Postby RyanFisher » Fri May 24, 2013 7:17 pm

Hi there,
Apologies for a potentially easy question. I have a categorical covariate with 3 categories (soil type 1, soil type 2 and soil type 3). I would rather use this variable as a covariate rather than using it as a group. But I'm a bit confused as to how to code this for use as a covariate. Normally (for a regression analysis or something) I would construct 2 new columns, assign a reference category that would be represented by 0 0, and the other two categories would be coded as 1 0 or 0 1. However, in the Gentle Intro Page 11-42/11-43 (last sentence on 11-42 and first sentence on 11-43) it suggests that if we were to incorporate the three colonies as individual covariates, we would construct two columns (c1 and c2) and then the three colonies should be coded as 1 0, 0 1 and 1 1. So I'm not sure which direction to go, code my third soil type as 0 0 or 1 1.
Thanks so much for any advice!
RyanFisher
 
Posts: 3
Joined: Tue Jun 21, 2011 1:09 pm

Re: Categorical covariate coding

Postby jlaake » Fri May 24, 2013 9:23 pm

Ryan-

Haven't looked at that section of the book but my guess it is about specifying the DM for a group categorical covariate. But for what you want to do, what you suggest is correct where you define k-1 individual covariates when the categorical covariate has k levels. You chose one as the intercept and the other two categories are coded with a 1 in one of the 2 covariates.

Now realize that there is some real disadvantages in doing what you are suggesting. Models with individual covariates run more slowly and and you have to compute real parameter values by setting specific covariate values. If you use it with groups, the real parameter estimates are provided directly without any work on your part.

--jeff
jlaake
 
Posts: 1480
Joined: Fri May 12, 2006 12:50 pm
Location: Escondido, CA

Re: Categorical covariate coding

Postby RyanFisher » Sat May 25, 2013 3:27 pm

Hi Jeff,
Thanks very much for the input. Good to know I'm on the right track! Right now I'm more just playing around with the indvidual covariate way to do things to make sure I understand how to code things vs using the grouping method. It's good to know some of the drawbacks of the technique though.
Ryan
RyanFisher
 
Posts: 3
Joined: Tue Jun 21, 2011 1:09 pm

Re: Categorical covariate coding

Postby cooch » Sat May 25, 2013 3:34 pm

jlaake wrote:Ryan-

Haven't looked at that section of the book but my guess it is about specifying the DM for a group categorical covariate. But for what you want to do, what you suggest is correct where you define k-1 individual covariates when the categorical covariate has k levels. You chose one as the intercept and the other two categories are coded with a 1 in one of the 2 covariates.


Actually, that part of TFM goes over the mechanics of using the individual covariate for groups in the DM. It covers the pros, and cons fairly well (although I'm obviously biased). The main advantage is mechanical convenience. There are a number of disadvantages - some of which make the approach rather unwieldy (especially for >2 levels of a categorical variable, as seems to be the case here).
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 3 guests

cron