I want to reshape my data from
Code:
* Example generated by -dataex-. For more info, type help dataex clear input str5 PERMCO float(year StdRoe) "2" 1975 .02604264 "2" 1976 .03198922 "2" 1977 .025451105 "2" 1978 .02033993 "2" 1979 .025600005 "2" 1980 .032773662 "2" 1981 .023405595 "2" 1982 .026683416 "2" 1983 .021286255 "2" 1984 .017309014 "2" 1986 .032624885 "2" 1987 .031919986 "2" 1988 .01871327 "2" 1989 .016740492 "2" 1990 .027773445 "2" 1991 .02142349 "2" 1992 .02851901 "2" 1993 .03728526 "2" 1994 .024088325 "2" 1995 .02030456 "2" 1996 .018913666 "2" 1997 .02324366 "2" 1998 .0339806 "2" 1999 .04271915 "3" 1977 .010217588 "3" 1978 .009057497 "3" 1979 .033250727 "3" 1980 .01473159 "3" 1981 .005305711 "6" 1975 . "6" 1976 . "6" 1977 . "6" 1978 .07418431 "6" 1979 .04513262 "6" 1980 .04573657 "6" 1981 .03478802 "6" 1982 .020467434 "7" 1980 .04983418 "7" 1981 .03319309 "7" 1982 .032644138 "7" 1983 .04126972 "7" 1984 .03021032 "7" 1985 .027953945 "7" 1986 .025011664 "7" 1987 .04130636 "7" 1988 .02106795 "7" 1989 .021255067 "7" 1990 .027528655 "7" 1991 .02926473 "7" 1992 .022373516 "7" 1993 .03160573 "7" 1994 .02753087 "7" 1995 .02607618 "7" 1996 .032099083 "7" 1997 .04045224 "7" 1998 .03917439 "7" 1999 .037070394 "7" 2000 .05513763 "7" 2001 .03933773 "7" 2002 .03052923 "7" 2003 .02335937 "7" 2004 .025469614 "7" 2005 .02447843 "7" 2006 .024264125 "7" 2007 .02377071 "7" 2008 .036665488 "7" 2009 .02136858 "7" 2010 .016854567 "7" 2011 .016539475 "7" 2012 .018564763 "7" 2013 .017985135 "7" 2014 .013643025 "7" 2015 .016842585 "8" 1975 .04183307 "8" 1976 .03343424 "8" 1977 .0340899 "9" 1975 .04805205 "9" 1976 .04093822 "9" 1977 .03844003 "9" 1978 .06068356 "9" 1979 .04337344 "9" 1980 .04058704 "9" 1981 .022602564 "9" 1982 .0220113 "9" 1983 .036598172 "9" 1984 .04735023 "9" 1985 .02819145 "11" 1975 .04581549 "11" 1976 .017742202 "11" 1977 .02047562 "11" 1978 .01522885 "11" 1979 .018443298 "11" 1980 .04646411 "11" 1981 .032919172 "11" 1982 .02646196 "11" 1983 .012007782 "13" 1975 .032886866 "13" 1976 .02515096 "13" 1977 .02131989 "13" 1978 .009190379 end
to
year | 2 | 3 | 6 | 7 |
1975 | x | x | x | x |
1976 | x | x | x | x |
1977 | x | x | x | x |
1978 | x | x | x | x |
1979 | x | x | x | x |
1980 | x | x | x | x |
1981 | x | x | x | x |
I thought it would be a simple command using reshape but non of the resulting outcomes are as in the table above. I also receive the notification that "variable PERMCO takes on too many values".
Does anyone see what the problem could be?
Best,
Tom
0 Response to Reshape long with multiple values in i
Post a Comment