Announcement

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

  • Is "reshape long" limited by the number of "i"s: too many variables specified

    Hi everyone,
    I am trying to run a reshape long command with 10 variables specified as i (below command). Interestingly when the number of variables specified as i exceeds 10 variables, stata does not reshape the variable generating an error: "too many variables specified." When the number of vars in i is less than 10 then the command works. Is there any way to fix this. I am using stata 16. Thanks.

    reshape long spousal_CG@ r@073 r@074 r@076 CR@ cogfunction@ r@082 r@223 r@129 r@216 r@001 r@053 r@adla r@iadla r@iwstat r@agey_m r@cesd r@shlt r@mstat h@itot r@jstres r@conde r@bmi r@smoken r@smokev r@drinkd r@nhmliv r@wtresp, i(hhidpn rabyear radyear ragender rahispan raracem raedyrs raeduc raehsamp raestrat OPN OPN_SP) j(wave)


  • #2
    Do you really need all those variables to uniquely identify an observation? I think not. If you are concerned isthat the variables be retained in the long dataset, that happens automatically for any variable that isn't reshaped. I suspect the only variable you need for i() is hhidpn, because I think you have survey data of individuals (identified by hhidpn) over several waves (to be identified by wave).

    Comment


    • #3
      Thansk William for the clarification. The below code deos the same job:

      reshape long spousal_CG@ r@073 r@074 r@076 CR@ cogfunction@ r@082 r@223 r@129 r@216 r@001 r@053 r@adla r@iadla r@iwstat r@agey_m r@cesd r@shlt r@mstat h@itot r@jstres r@conde r@bmi r@smoken r@smokev r@drinkd r@nhmliv r@wtresp, i(hhidpn) j(wave)

      Comment

      Working...
      X