[R] tapply error svyby function survey package

2014-11-12 Thread Martin Canon
Hi. I'm trying to calculate the weighted mean score of a quality of life measure (ovt) in patients with irritable bowel syndrome by their marital status (d7). This is a summary of the structure of the dataset: str(sii.tesis) 'data.frame':1063 obs. of 75 variables: $ id : int 51

Re: [R] tapply error svyby function survey package

2014-11-12 Thread Anthony Damico
try resetting your levels? if that doesn't work, please dput() an example data set that we can test with :) thanks! sii.design - update( sii.design , d6 = factor( d6 ) ) On Wed, Nov 12, 2014 at 7:59 AM, Martin Canon martin.ca...@gmail.com wrote: Hi. I'm trying to calculate the

Re: [R] tapply error svyby function survey package

2014-11-12 Thread Anthony Damico
hi martin, sending the first 25 rows does not help if it does not re-create the problem.. when i run the data you have provided, i do not encounter your problem (see below). someone else may be able to guess the issue, but this would be a lot easier to solve if you can create a minimal

Re: [R] tapply error svyby function survey package

2014-11-12 Thread Martin Canon
Anthony, thanks for your reply. Resetting the levels didn't work. These are the first 25 rows of the dataset: structure(list(id = c(51L, 52L, 53L, 54L, 55L, 56L, 57L, 58L, 59L, 60L, 61L, 62L, 63L, 64L, 65L, 66L, 67L, 68L, 69L, 70L, 71L, 73L, 74L, 75L, 76L), stratum = structure(c(1L, 4L, NA, 4L,