Announcement

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

  • new reshape issue

    Sorry, this should be straightforward but I can't figure it out even after trying and using the manual. I was able to collapse the data I asked about before but I made a mistake for one country that has two different values in the data set (and the one I want to merge with it). Italy is Italy/Sardinia for observation number 90 and Italy for observation 206. I need to replace the observations with a score of 0 in observation 90 with the values of the variables for observation 216. I tried a replace in a loop that included:
    replace gwno1901[_216] if *[_90]==0

    but got:

    weights not allowed

  • #2
    Code:
    help replace
    gives the allowed syntax, which is

    replace oldvar = exp [if] [in] [, nopromote]

    Evidently your syntax should start

    Code:
    replace gwno1901 =
    The use of subscripts before an equals sign can only be understood by Stata as an attempt to specify weights which are not allowed. There isn't an equals sign but Stata bails out at seeing something that doesn't belong before an equals sign.

    Beyond that I guess that you want

    Code:
    replace gwno1901 =  gwno1901[216] in 90
    and perhaps to do something similar for other variables in the dataset

    or perhaps use 206 not 216.

    Your post lacks a specific data example and seems to allow all these interpretations.

    Comment


    • #3
      Thanks, that worked.

      Comment

      Working...
      X