Creating multiple records from one record using SPSS V.20

Discussion in 'SPSS' started by Owen Power, Dec 14, 2011.

  1. Owen Power

    Owen Power Guest

    I have a file of about 300 records. For each unique ‘RecordID’ on the
    file I am trying to create 30 duplicates of the record so that I end
    up with 9000 records. Then for each unique ‘RecordID’ I want to number
    the 30 created records from 01 to 30.

    Could you suggest how I might do this in SPSS V.20?

    Owen Power, Dec 14, 2011
    1. Advertisements

  2. Owen Power

    Art Kendall Guest

    David Marso posted this. But I wonder why you do not simply,
    compute weight30 =30.
    weight by weight30.
    Not sure *WHY* you would wish to do this.
    Here is an easy way.
    LOOP SUBREC=1 TO 30.
    GET FILE "C:\TEMP\REPEAT30.sav".
    end quote:

    Art Kendall
    Social Research Consultants
    Art Kendall, Dec 14, 2011
    1. Advertisements

  3. Owen Power

    wopo Guest

    Thanks Art. But your suggestion didn't quite create replicate records.It creates the variable weight30 but it doesn't create multiple records.
    wopo, Dec 15, 2011
  4. Owen Power

    Bruce Weaver Guest

    It creates the variable weight30 but it doesn't create multiple records.

    Art knows very well that using WEIGHT does not create multiple copies of
    the records in the data file.

    Why do you want 30 copies of each record? What do you intend to do
    after creating those copies?
    Bruce Weaver, Dec 15, 2011
  5. Owen Power

    peter m sopp Guest

    The easiest way to do that:
    ADD FILE FILE * /FILE "#".
    * # = duplicated File.
    That's a way to create the dataset you want - hope so.
    (It's sometimes a way to deal with demands on tabulation - weighted and
    unweigted rows in the same table for example. Maybe now there are better
    ways solving those problems by combining different tables by a pyton
    script ...) .

    Am 14.12.2011 06:02, schrieb Owen Power:
    peter m sopp, Dec 15, 2011
  6. Owen Power

    wopo Guest

    I selected a first stage sample based on Village ID. Within each village wewill be selecting 30 households. I need to create a record for each of the30 households and include certain information on each of the 30 records that will be used by a field office when the actual sample of households is selected. I really do need to create 30 records from each sampled village record.
    wopo, Dec 15, 2011
  7. Owen Power

    wopo Guest

    BTW, the solution provided by David Marso worked quite well.
    wopo, Dec 15, 2011
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.