Re: [R] using aggregate with survey-design and survey functions

2003-09-21 Thread Thomas Lumley
On Sat, 20 Sep 2003 [EMAIL PROTECTED] wrote: In a message dated 9/20/03 9:19:57 AM Pacific Daylight Time, [EMAIL PROTECTED] writes: svymean needs the survey metadata to get the right mean, and aggregate doesn't give it enough information. aggregate would need a separate method for

Re: [R] using aggregate with survey-design and survey functions

2003-09-20 Thread Spencer Graves
In the following command: s - aggregate(income,list(age,sex),function(x) (svymean(~x,design=d.na))) Since 'is.element(income, objects())' was FALSE, it was not in the search path, which it must be for aggregate to find it. I suggest you read or reread something like An Introduction to R,

Re: [R] using aggregate with survey-design and survey functions

2003-09-20 Thread Thomas Lumley
On Fri, 19 Sep 2003 [EMAIL PROTECTED] wrote: Hi R users, I am trying to use the aggregate function with a survey design object and survey functions, but get the following error. I think I am incorrectly using the syntax somehow, and it may not be possible to access variables directly by

Re: [R] using aggregate with survey-design and survey functions

2003-09-20 Thread TyagiAnupam
In a message dated 9/20/03 9:19:57 AM Pacific Daylight Time, [EMAIL PROTECTED] writes: svymean needs the survey metadata to get the right mean, and aggregate doesn't give it enough information. aggregate would need a separate method for svydesign objects. Thanks for the info. I tried

Re: [R] using aggregate with survey-design and survey functions

2003-09-20 Thread Spencer Graves
?UseMethod reveals a command method, which I often use in situations like this: methods(aggregate) [1] aggregate.data.frame aggregate.defaultaggregate.ts Now list aggregate.data.frame, aggregate.default, and aggregate.ts. This works for functions written using the old S3

[R] using aggregate with survey-design and survey functions

2003-09-19 Thread TyagiAnupam
Hi R users, I am trying to use the aggregate function with a survey design object and survey functions, but get the following error. I think I am incorrectly using the syntax somehow, and it may not be possible to access variables directly by name in a survey-design object. Am I right? How do

Re: [R] using aggregate with survey-design and survey functions

2003-09-19 Thread Spencer Graves
What do you get from the following: is.element(income, objects()) spencer graves [EMAIL PROTECTED] wrote: Hi R users, I am trying to use the aggregate function with a survey design object and survey functions, but get the following error. I think I am incorrectly using the syntax

Re: [R] using aggregate with survey-design and survey functions

2003-09-19 Thread TyagiAnupam
In a message dated 9/19/03 7:46:07 PM Pacific Daylight Time, [EMAIL PROTECTED] writes: What do you get from the following: is.element(income, objects()) spencer graves is.element(income, objects()) [1] FALSE The following may give further info about why I am getting this. Design