s-news
[Top] [All Lists]

Re: Survey design in S+8

To: "Walter R. Paczkowski" <dataanalytics@earthlink.net>
Subject: Re: Survey design in S+8
From: Thomas Lumley <tlumley@u.washington.edu>
Date: Tue, 5 Jun 2007 23:29:34 -0700 (PDT)
Cc: s-news@lists.biostat.wustl.edu
In-reply-to: <E1HvjKB-00028I-RD@elasmtp-spurfowl.atl.sa.earthlink.net>
References: <E1HvjKB-00028I-RD@elasmtp-spurfowl.atl.sa.earthlink.net>

I don't have access to S-PLUS 8 at the moment, but it may be that the 'survey' port to S-PLUS isn't recognising the ~1 and that you need ~id for some identifier. That is, you need to create a variable that has a unique level for each record and specify it in the id formula.

        -thomas


On Tue, 5 Jun 2007, Walter R. Paczkowski wrote:

Hi,

I just loaded my new copy of 8.0 on Windows XP.  I wanted to run a small
function I had written in R using the survey package to do a raking of
survey data.  The function works perfectly under R.  In S, however, I get
an error message:

        Problem: Length of 1 (variable 1) is 1 != length of others (3560)
        Use traceback() to see the call stack

Does anyone know what this means? This is for an SRS, nothing fancy. The problem is with the svydesign function which I specify as

         svydesign(ids = ~1, data = x)

where x is a dataframe with dimension 3560 by 3.  Again, this worked
perfectly in R.  Any insight?

Thanks,

Walt Paczkowski

_________________________________

Walter R. Paczkowski, Ph.D.
Data Analytics Corp.
44 Hamilton Lane
Plainsboro, NJ  08536
(V) 609-936-8999
(F) 609-936-3733



Thomas Lumley                   Assoc. Professor, Biostatistics
tlumley@u.washington.edu        University of Washington, Seattle

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