Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • help w r(103) error for reshaping data

    Hi, I'm trying to reshape a data set from wide to long but keep getting an error that there are too many variables specified. I'd love some help.
    Code:
    . reshape long houserace, i(CC18*) j(issue)
    CC18_326c CC18_328b CC18_417_b CC18_328d CC18_328e CC18_332a CC18_332b CC18_332c CC
    > 18_332e CC18_417_a CC18_417_c CC18_417_d CC18_417_e CC18_415a CC18_415b CC18_415c
    >  CC18_415d CC18_320a CC18_320b CC18_320c CC18_320d CC18_321a CC18_321b CC18_321c 
    > CC18_321d CC18_321e CC18_321f CC18_322a CC18_322b CC18_322c CC18_322c_new CC18_32
    > 2e CC18_322f CC18_323d_new CC18_323b CC18_323c CC18_327a CC18_327b CC18_327c CC18
    > _327d CC18_327e CC18_331a CC18_331b CC18_331c CC18_324a CC18_324b CC18_324c CC18_
    > 324d CC18_324e CC18_416 CC18_325a CC18_325b CC18_325c CC18_325d CC18_325e CC18_32
    > 5f_new CC18_325g CC18_325h CC18_326
    too many variables specified
    r(103);

  • #2
    Please refer to the FAQ (http://www.statalist.org/forums/help) and follow the instruction to pose some sample data using -dataex-.

    Without knowing much, it seems there is a misunderstanding of the command -reshape-. Perhaps try -help reshape- and work through the example at the bottom of the technical document.

    The code in #1 is implying that a unique case can only be identified by combining all the information from all the variables with names starting with "CC18". That is very unlikely to be true. We sometimes may need an household ID + an individual ID to get to a unique subject, but seldom this many. Maybe the variables to be restructured are confused with the ID (which I assume is houserace?)

    Comment

    Working...
    X