Re: [R] Dealing with data

2010-08-14 Thread Jonathan Christensen
...@imail.org 801.408.8111 -Original Message- From: TGS [mailto:cran.questi...@gmail.com] Sent: Friday, August 13, 2010 11:51 AM To: Greg Snow Cc: r-help@r-project.org Subject: Re: [R] Dealing with data # Greg, if R automatically does that then I don't know why it's treating each

Re: [R] Dealing with data

2010-08-13 Thread David Winsemius
On Aug 13, 2010, at 1:03 PM, TGS wrote: # how would I code in R to look at the letter of the alphabet # in the second column and create a indicator column for the # corresponding letter? data(InsectSprays) InsectSprays$spray It's already what most people mean when they say indicator column,

Re: [R] Dealing with data

2010-08-13 Thread TGS
To clarify, I'd like to create a column of indicators for the respective letters so that I could maybe do regression on indicators, etc. For instance, A gets 1, B gets 2, and so on. On Aug 13, 2010, at 10:19 AM, David Winsemius wrote: On Aug 13, 2010, at 1:03 PM, TGS wrote: # how would I

Re: [R] Dealing with data

2010-08-13 Thread Greg Snow
-help-boun...@r- project.org] On Behalf Of TGS Sent: Friday, August 13, 2010 11:22 AM To: David Winsemius Cc: r-help@r-project.org Subject: Re: [R] Dealing with data To clarify, I'd like to create a column of indicators for the respective letters so that I could maybe do regression

Re: [R] Dealing with data

2010-08-13 Thread Erik Iverson
TGS wrote: To clarify, I'd like to create a column of indicators for the respective letters so that I could maybe do regression on indicators, etc. For instance, A gets 1, B gets 2, and so on. That's precisely how factors are handled by modeling functions in R! No need to reinvent the

Re: [R] Dealing with data

2010-08-13 Thread David Winsemius
On Aug 13, 2010, at 1:22 PM, TGS wrote: To clarify, I'd like to create a column of indicators for the respective letters so that I could maybe do regression on indicators, etc. You can just enter that column name in a regression formula. No need to create a separate variable. Try:

Re: [R] Dealing with data

2010-08-13 Thread TGS
-Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r- project.org] On Behalf Of TGS Sent: Friday, August 13, 2010 11:22 AM To: David Winsemius Cc: r-help@r-project.org Subject: Re: [R] Dealing with data To clarify, I'd like to create a column of indicators

Re: [R] Dealing with data

2010-08-13 Thread Greg Snow
Snow Cc: r-help@r-project.org Subject: Re: [R] Dealing with data # Greg, if R automatically does that then I don't know why it's treating each indicator # as a different regressor. In other words, I am interested in treating 'spray' as one # independent variable. # # Erik, which book do

Re: [R] Dealing with data

2010-08-13 Thread TGS
-project.org Subject: Re: [R] Dealing with data # Greg, if R automatically does that then I don't know why it's treating each indicator # as a different regressor. In other words, I am interested in treating 'spray' as one # independent variable. # # Erik, which book do you suggest I read? Thanks

Re: [R] Dealing with data

2010-08-13 Thread TGS
PM To: Greg Snow Subject: Re: [R] Dealing with data P.S. The degrees of freedom for sprays would be 5 and not 1. On Aug 13, 2010, at 12:27 PM, Greg Snow wrote: So you want 1 degree of freedom for InsectSprays? You believe that the difference between A and B is exactly the same