Hello,
I'm a beginner with stata, and I've been trying to reshape a dataset. An example of the data below:
input str9 Season double(ATL BOS) str17 CHA
"2016-17" .78 .82 ".78"
"2015-16" .87 .85 ".51"
"2014-15" .88 .5 ".61"
"2013-14" .53 .59 ".64"
"2012-13" .52 .53 ".49"
"01dec2011" .72 .65 ".57"
"01nov2010" .88 .76 ".7"
"01oct2009" .8 .79 ".59"
"01sep2008" .79 .94 ".52"
"01aug2007" .76 .5 ".66"
"01jul2006" .72 .75 ".72"
"01jun2005" .5 .72 ".66"
"01may2004" .11 .67 "-"
"01apr2003" .52 .5 ""
"01mar2002" .74 .78 ""
"01feb2001" .61 .79 ".79"
"01jan2000" .64 .65 ".55"
"1999-00" .45 .68 ".67"
"1998-99" .68 .61 ".36"
I have been trying to reshape using this code: reshape long Team, i(Season) j(Team)
My goal is for the individual city columns to be labeled as one column "team" where the rows represent the cities, instead of having a different colum for each city. My final dataset needs to have a column for season, a column for team, and then a column with the percentages in my example. I keep getting an error that says "no xij variables found", and I'm not sure what this means. Does anyone have any tips? Thank you.
I'm a beginner with stata, and I've been trying to reshape a dataset. An example of the data below:
input str9 Season double(ATL BOS) str17 CHA
"2016-17" .78 .82 ".78"
"2015-16" .87 .85 ".51"
"2014-15" .88 .5 ".61"
"2013-14" .53 .59 ".64"
"2012-13" .52 .53 ".49"
"01dec2011" .72 .65 ".57"
"01nov2010" .88 .76 ".7"
"01oct2009" .8 .79 ".59"
"01sep2008" .79 .94 ".52"
"01aug2007" .76 .5 ".66"
"01jul2006" .72 .75 ".72"
"01jun2005" .5 .72 ".66"
"01may2004" .11 .67 "-"
"01apr2003" .52 .5 ""
"01mar2002" .74 .78 ""
"01feb2001" .61 .79 ".79"
"01jan2000" .64 .65 ".55"
"1999-00" .45 .68 ".67"
"1998-99" .68 .61 ".36"
I have been trying to reshape using this code: reshape long Team, i(Season) j(Team)
My goal is for the individual city columns to be labeled as one column "team" where the rows represent the cities, instead of having a different colum for each city. My final dataset needs to have a column for season, a column for team, and then a column with the percentages in my example. I keep getting an error that says "no xij variables found", and I'm not sure what this means. Does anyone have any tips? Thank you.
Comment