Announcement

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

  • Problems with reshape command

    Hello,

    I am having issues with the reshape command. I am running Stata 15.1 on Windows.

    My dataset is from the NCES educational database. The columns are district names, district states, and demographic variables (G1HM9899 - Grade 1 Hispanic Males 98-99, etc).

    I would like to reshape this to emphasize district and year.

    My command is: reshape long charter G otherdemographicvariables i(district) j(year)

    Firstly, charter is a dummy variable if the district is a charter district or not. G includes all Grades and their demographic variables and year (since those variables begin with G, I think the command should capture it).
    I would like to reshape this, but it is says r(198), option i() required.

    I don't understand, since i will be the district name and j would be the year in place. Thanks.

  • #2
    Originally posted by Michael Walters View Post
    My command is: reshape long charter G otherdemographicvariables i(district) j(year)

    but it is says r(198), option i() required.
    It looks like you're missing a comma in your command. Options, such as i(), need to be set off from the variable list with a comma.

    Comment


    • #3
      Thanks for responding.

      Even with the comma, I input as follows: reshape long str_charter IEPS Latitude Longitude FLE K G PTD PTPS, i(district), j (year)

      Please note district and year are new variables.

      I am given this response:

      invalid 'j'
      r (198);

      Comment


      • #4
        It is:
        Code:
        reshape long stubs, i(i) j(j)
        https://www.stata.com/manuals13/dreshape.pdf


        So one comma, followed by i(district) j(year)
        And not another comma between i(district) and j(year)

        Comment

        Working...
        X