Message-ID: <21ce39b21001020916s225fdcacvd2fe1d8f0c018e1f@mail.gmail.com>
Date: 2010-01-02T17:16:26Z
From: William Simpson
Subject: scatterplot matrix question
In-Reply-To: <Pine.LNX.4.64.1001020845140.19039@tajo.ucsd.edu>
On Sat, Jan 2, 2010 at 4:55 PM, Charles C. Berry <cberry at tajo.ucsd.edu> wrote:
> On Sat, 2 Jan 2010, William Simpson wrote:
>
>> I would like a scatterplot matrix and a correlation matrix for the
>> following set-up.
>> The data (dataframe d) are like this:
>>
>> angle resp
>> -90 182
>> -60 137
>> -30 ...etc
>> 0
>> 30
>> 60
>> 90
>> ...etc
>>
>> I would like each cell in the matrix to be the scatterplot of the
>> responses for each pair of angles ( -90 vs -60, -90 vs -30, etc). Same
>> for the correlation matrix.
>>
>> Please tell me what to do. Thanks very much!
>
> 1) You need to "provide commented, minimal, self-contained, reproducible
> code."
d<-read.table("rstuff/data.dat",header=TRUE)
Now what? :-)
certainly it's not
pairs(d)
> 2) You need to fill in some missing info: Either you have only one
> response for each angle, or you need a third variable to pair up the
> corresponding responses for one angle with those of another.
contents of rstuff/data.dat:
angle resp ID
-90 182 1
-60 137 1
-30 123 1
0 67 1
30 32 1
60 12 1
90 13 1
-90 178 2
-60 111 2
-30 137 2
0 94 2
30 59 2
60 1 2
90 19 2
I actually have a lot more than 2 experimental units (ID)...
Thanks for any help
Bill