s-news
[Top] [All Lists]

Correlation matrix with dummy coded variables

To: <s-news@lists.biostat.wustl.edu>
Subject: Correlation matrix with dummy coded variables
From: "Fletcher, Thomas" <fletchert@umsl.edu>
Date: Mon, 10 Oct 2005 12:32:00 -0500
Thread-index: AcXNwIVX57oXAb0pQ0GSSbDS0c+Tbw==
Thread-topic: Correlation matrix with dummy coded variables

List,

 

I am trying to do (understand) 2 related things involving dummy coded variables.

 

  1. When assessing a model with functions such as lm or lme, SPLUS automatically creates dummy variables when appropriate. How can you interpret these? That is, how do you know what is the reference category and which of the new dummy variables are related to which level of the original variable? Is it the case that the original levels are alphabetically arranged and the first is the reference?
    1. For example, suppose original variable is group (A, B, C, D) with 4 levels. Would the new dummy variables be group1, group2, group3 where, group 1 is (B=1), group2 is (C=1), group3 is (D=1).

 

  1. Suppose you want to create a correlation matrix involving the new dummy codes from question one above. Is there a built in function (i.e., something within ‘cor’) to assist in this? Do you have to ‘manually’ create the new dummies? I think this latter step shouldn’t be too difficult; I am just struggling with trying to match up the regression results with the correlation matrix I need to present.

 

Thanks

TF

 

-------------------------------------------------

Thomas D. Fletcher, PhD

Assistant Professor

Department of Psychology

University of Missouri - St. Louis

One University Boulevard

St. Louis, MO 63121

-------------------------------------------------

 

<Prev in Thread] Current Thread [Next in Thread>