Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: Data Management

From   David Ashcraft <>
To   "" <>
Subject   Re: st: Data Management
Date   Mon, 2 Apr 2012 01:34:18 -0700 (PDT)

Thanks Nick. I was expecting -type mismatch- in the stub. However, it was in the data. Reshape need float data to change and I had string in some of the variables. I changed those variables in float and now data is LONG. Thanks for your help.


----- Original Message -----
From: Nick Cox <>
Sent: Monday, April 2, 2012 10:27:20 AM
Subject: Re: st: Data Management

I would believe Stata here. You haven't shown us the result of -d
netchgloan*- so haven't ruled out the report of a type mismatch.

If there were a limit on -reshape- of this kind, and none is
documented at -help limits-,  it would I think show up in other ways.

On Mon, Apr 2, 2012 at 8:13 AM, David Ashcraft <> wrote:
> Thanks Nick. The command works for few variables but as the list get longer the error message start showing up as per below.
> reshape long deposit3m deposit312 deposit1to5yrs depositover5yrs intinc intexp totintexp netintinc netonder totnonintinc totnonin texp ni loanmortg loancandi loanresnpl loannet loangross obsder asset depositcurrent depositsaving depositterm deposittotal obsdir fairdebt eqtycom eqtytotal roa rorwasset tier1 totregcap oretier1 netchgtoloan obsmsasset otherobs guar obsdoccr obscomcr loanavg assetavg eqtyavg loan3m loan3to12 loan1to5yrs loanover5yrs sub sub3m sub3to12m sub1to5yrs subover5yrs intmtg intcandi intincloans, i(id) j(year)
> (note: j = 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011)
> netchgtoloan2007 type mismatch with other netchgtoloan variables
> I do not see any type mismatch. Am I doing anything wrong here or there is any limitation in terms of number of variables that -reshape- can handle at a time.
> Regards
> David
> ----- Original Message -----
> From: Nick Cox <>
> To:
> Cc:
> Sent: Sunday, April 1, 2012 4:11:41 PM
> Subject: Re: st: Data Management
> -reshape- wants stubnames as input, not variable names. These look for
> all the world like variable names.
> The "@" is not needed if the years are suffixes.
> At a guess your stubnames are
> asset assetavg coretier1 deposit1to5yrs deposit312 deposit3m
> depositcurrent depositover5yrs depositsaving depositterm deposittotal
> eqtyavg eqtycom eqtytotal fairdebt growasst growloan guar intexp
> intinc loan1to5yrs loan3m loan3to12 loanavg loancandi loangross
> loanmortg loannet loanover5yrs loanresnpl netchgtoloan netintinc
> netonder ni npltoloan obscomcr obsder obsdir obsdoccr obsmsasset
> otherobs roa roe rorwasset sub sub1to5yrs sub3m sub3to12m tier1
> totintexp totnonintexp totnonintinc totregcap
> Nick
> On Sun, Apr 1, 2012 at 2:01 PM, David Ashcraft <> wrote:
>> I could not change the wide to long. I implemented the following command and hoped that data will change to long. The error message is "no xij variables found" Any idea what is the problem with the command. I have checked the id variable is numeric and this command should generate the year itself. The examples mentioned in stata manual has two digit for years. I think I have to use @ sign to define the year. Any suggestion?
>> Regards
>> David
>> reshape long deposit3m2011 deposit3m2010 deposit3m2009 deposit3m2008 deposit3m2007 deposit3m2006 deposit3m2005 deposit3m2004 deposit3m2003 deposit3m2002 deposit3m2001 deposit3m2000 deposit3m1999 deposit3m1998 deposit3m1997 deposit3122011 deposit3122010 deposit3122009 deposit3122008 deposit3122007 deposit3122006 deposit3122005 deposit3122004 deposit3122003 deposit3122002 deposit3122001 deposit3122000 deposit3121999 deposit3121998 deposit3121997 deposit1to5yrs2011 deposit1to5yrs2010 deposit1to5yrs2009 deposit1to5yrs2008 deposit1to5yrs2007 deposit1to5yrs2006 deposit1to5yrs2005 deposit1to5yrs2004 deposit1to5yrs2003 deposit1to5yrs2002 deposit1to5yrs2001 deposit1to5yrs2000 deposit1to5yrs1999 deposit1to5yrs1998 deposit1to5yrs1997 depositover5yrs2011 depositover5yrs2010 depositover5yrs2009 depositover5yrs2008 depositover5yrs2007 depositover5yrs2006 depositover5yrs2005 depositover5yrs2004 depositover5yrs2003 depositover5yrs2002 depositover5yrs2001
>>  depositover5yrs2000 depositover5yrs1999 depositover5yrs1998 depositover5yrs1997 intinc2011 intinc2010 intinc2009 intinc2008 intinc2007 intinc2006 intinc2005 intinc2004 intinc2003 intinc2002 intinc2001 intinc2000 intinc1999 intinc1998 intinc1997 intexp2011 intexp2010 intexp2009 intexp2008 intexp2007 intexp2006 intexp2005 intexp2004 intexp2003 intexp2002 intexp2001 intexp2000 intexp1999 intexp1998 intexp1997 totintexp2011 totintexp2010 totintexp2009 totintexp2008 totintexp2007 totintexp2006 totintexp2005 totintexp2004 totintexp2003 totintexp2002 totintexp2001 totintexp2000 totintexp1999 totintexp1998 totintexp1997 netintinc2011 netintinc2010 netintinc2009 netintinc2008 netintinc2007 netintinc2006 netintinc2005 netintinc2004 netintinc2003 netintinc2002 netintinc2001 netintinc2000 netintinc1999 netintinc1998 netintinc1997 netonder2011  netonder2010 netonder2009 netonder2008 netonder2007 netonder2006 netonder2005 netonder2004 netonder2003 netonder2002
>>  netonder2001 netonder2000 netonder1999 netonder1998 netonder1997 totnonintinc2011 totnonintinc2010 totnonintinc2009 totnonintinc2008 totnonintinc2007 totnonintinc2006 totnonintinc2005 totnonintinc2004 totnonintinc2003 totnonintinc2002 totnonintinc2001 totnonintinc2000 totnonintinc1999 totnonintinc1998 totnonintinc1997 totnonintexp2011 totnonintexp2010 totnonintexp2009 totnonintexp2008 totnonintexp2007 totnonintexp2006 totnonintexp2005 totnonintexp2004 totnonintexp2003 totnonintexp2002 totnonintexp2001 totnonintexp2000 totnonintexp1999 totnonintexp1998 totnonintexp1997 ni2011 ni2010 ni2009 ni2008 ni2007 ni2006 ni2005 ni2004 ni2003 ni2002 ni2001 ni2000 ni1999 ni1998 ni1997 loanmortg2011 loanmortg2010 loanmortg2009 loanmortg2008 loanmortg2007 loanmortg2006 loanmortg2005 loanmortg2004 loanmortg2003 loanmortg2002 loanmortg2001 loanmortg2000 loanmortg1999 loanmortg1998 loanmortg1997 loancandi2011 loancandi2010 loancandi2009 loancandi2008 loancandi2007
>>  loancandi2006 loancandi2005 loancandi2004 loancandi2003 loancandi2002 loancandi2001 loancandi2000 loancandi1999 loancandi1998 loancandi1997 loanresnpl2011 loanresnpl2010 loanresnpl2009 loanresnpl2008 loanresnpl2007 loanresnpl2006 loanresnpl2005 loanresnpl2004 loanresnpl2003 loanresnpl2002 loanresnpl2001 loanresnpl2000 loanresnpl1999 loanresnpl1998 loanresnpl1997 loannet2011 loannet2010 loannet2009 loannet2008 loannet2007 loannet2006 loannet2005 loannet2004 loannet2003 loannet2002 loannet2001 loannet2000 loannet1999 loannet1998 loannet1997 loangross2011 loangross2010 loangross2009 loangross2008 loangross2007 loangross2006 loangross2005 loangross2004 loangross2003 loangross2002 loangross2001 loangross2000 loangross1999 loangross1998 loangross1997 obsder2011 obsder2010 obsder2009 obsder2008 obsder2007 obsder2006 obsder2005 obsder2004 obsder2003 obsder2002 obsder2001 obsder2000 obsder1999 obsder1998 obsder1997 asset2011 asset2010 asset2009 asset2008
>>  asset2007 asset2006 asset2005 asset2004 asset2003 asset2002 asset2001 asset2000 asset1999 asset1998 asset1997 depositcurrent2011 depositcurrent2010 depositcurrent2009 depositcurrent2008 depositcurrent2007 depositcurrent2006 depositcurrent2005 depositcurrent2004 depositcurrent2003 depositcurrent2002 depositcurrent2001 depositcurrent2000 depositcurrent1999 depositcurrent1998 depositcurrent1997 depositsaving2011 depositsaving2010 depositsaving2009 depositsaving2008 depositsaving2007 depositsaving2006 depositsaving2005 depositsaving2004 depositsaving2003 depositsaving2002 depositsaving2001 depositsaving2000 depositsaving1999 depositsaving1998 depositsaving1997 depositterm2011 depositterm2010 depositterm2009 depositterm2008 depositterm2007 depositterm2006 depositterm2005 depositterm2004 depositterm2003 depositterm2002 depositterm2001 depositterm2000 depositterm1999 depositterm1998 depositterm1997 deposittotal2011 deposittotal2010 deposittotal2009
>>  deposittotal2008 deposittotal2007 deposittotal2006 deposittotal2005 deposittotal2004 deposittotal2003 deposittotal2002 deposittotal2001 deposittotal2000 deposittotal1999 deposittotal1998 deposittotal1997 obsdir2011 obsdir2010 obsdir2009 obsdir2008 obsdir2007 obsdir2006 obsdir2005 obsdir2004 obsdir2003 obsdir2002 obsdir2001 obsdir2000 obsdir1999 obsdir1998 obsdir1997 fairdebt2011 fairdebt2010 fairdebt2009 fairdebt2008 fairdebt2007 fairdebt2006 fairdebt2005 fairdebt2004 fairdebt2003 fairdebt2002 fairdebt2001 fairdebt2000 fairdebt1999 fairdebt1998 fairdebt1997 eqtycom2011 eqtycom2010 eqtycom2009 eqtycom2008 eqtycom2007 eqtycom2006 eqtycom2005 eqtycom2004 eqtycom2003 eqtycom2002 eqtycom2001 eqtycom2000 eqtycom1999 eqtycom1998 eqtycom1997 eqtytotal2011 eqtytotal2010 eqtytotal2009 eqtytotal2008 eqtytotal2007 eqtytotal2006 eqtytotal2005 eqtytotal2004 eqtytotal2003 eqtytotal2002 eqtytotal2001 eqtytotal2000 eqtytotal1999 eqtytotal1998 eqtytotal1997 roe2011
>>  roe2010 roe2009 roe2008 roe2007 roe2006 roe2005 roe2004 roe2003 roe2002 roe2001 roe2000 roe1999 roe1998 roe1997  roa2011 roa2010 roa2009 roa2008 roa2007 roa2006 roa2005 roa2004 roa2003 roa2002 roa2001 roa2000 roa1999 roa1998 roa1997  rorwasset2011 rorwasset2010  rorwasset2009 rorwasset2008 rorwasset2007 rorwasset2006 rorwasset2005  rorwasset2004 rorwasset2003 rorwasset2002  rorwasset2001 rorwasset2000  rorwasset1999 rorwasset1998 rorwasset1997 tier12011 tier12010 tier12009 tier12008 tier12007 tier12006 tier12005  tier12004 tier12003 tier12002 tier12001 tier12000 tier11999 tier11998 tier11997 totregcap2011 totregcap2010 totregcap2009 totregcap2008 totregcap2007 totregcap2006 totregcap2005 totregcap2004 totregcap2003 totregcap2002 totregcap2001 totregcap2000 totregcap1999 totregcap1998 totregcap1997 coretier12011 coretier12010 coretier12009 coretier12008 coretier12007 coretier12006 coretier12005 coretier12004 coretier12003 coretier12002
>>  coretier12001 coretier12000 coretier11999 coretier11998 coretier11997 growasst2011 growasst2010 growasst2009 growasst2008 growasst2007 growasst2006 growasst2005 growasst2004 growasst2003 growasst2002 growasst2001 growasst2000 growasst1999 growasst1998 growasst1997 growloan2011 growloan2010 growloan2009 growloan2008 growloan2007 growloan2006 growloan2005 growloan2004 growloan2003 growloan2002 growloan2001 growloan2000 growloan1999 growloan1998 growloan1997 npltoloan2011 npltoloan2010 npltoloan2009 npltoloan2008 npltoloan2007 npltoloan2006 npltoloan2005 npltoloan2004 npltoloan2003 npltoloan2002 npltoloan2001 npltoloan2000 npltoloan1999 npltoloan1998 npltoloan1997 netchgtoloan2011 netchgtoloan2010 netchgtoloan2009 netchgtoloan2008 netchgtoloan2007 netchgtoloan2006 netchgtoloan2005 netchgtoloan2004 netchgtoloan2003 netchgtoloan2002 netchgtoloan2001 netchgtoloan2000 netchgtoloan1999 netchgtoloan1998 netchgtoloan1997 obsmsasset2011 obsmsasset2010
>>  obsmsasset2009 obsmsasset2008 obsmsasset2007 obsmsasset2006 obsmsasset2005 obsmsasset2004 obsmsasset2003 obsmsasset2002 obsmsasset2001 obsmsasset2000 obsmsasset1999 obsmsasset1998 obsmsasset1997 otherobs2011 otherobs2010 otherobs2009 otherobs2008 otherobs2007 otherobs2006 otherobs2005 otherobs2004 otherobs2003 otherobs2002 otherobs2001 otherobs2000 otherobs1999 otherobs1998 otherobs1997 guar2011 guar2010 guar2009 guar2008 guar2007 guar2006 guar2005 guar2004 guar2003 guar2002 guar2001 guar2000 guar1999 guar1998 guar1997 obsdoccr2011 obsdoccr2010 obsdoccr2009 obsdoccr2008 obsdoccr2007 obsdoccr2006 obsdoccr2005 obsdoccr2004 obsdoccr2003 obsdoccr2002 obsdoccr2001 obsdoccr2000 obsdoccr1999 obsdoccr1998 obsdoccr1997 obscomcr2011 obscomcr2010 obscomcr2009 obscomcr2008 obscomcr2007 obscomcr2006 obscomcr2005 obscomcr2004 obscomcr2003 obscomcr2002 obscomcr2001 obscomcr2000 obscomcr1999 obscomcr1998 obscomcr1997 loanavg2011 loanavg2010 loanavg2009 loanavg2008
>>  loanavg2007 loanavg2006 loanavg2005 loanavg2004 loanavg2003 loanavg2002 loanavg2001 loanavg2000 loanavg1999 loanavg1998 loanavg1997 assetavg2011 assetavg2010 assetavg2009 assetavg2008 assetavg2007 assetavg2006 assetavg2005 assetavg2004 assetavg2003 assetavg2002 assetavg2001 assetavg2000 assetavg1999 assetavg1998 assetavg1997 eqtyavg2011 eqtyavg2010 eqtyavg2009 eqtyavg2008 eqtyavg2007 eqtyavg2006 eqtyavg2005 eqtyavg2004 eqtyavg2003 eqtyavg2002 eqtyavg2001 eqtyavg2000 eqtyavg1999 eqtyavg1998 eqtyavg1997 loan3m2011 loan3m2010 loan3m2009 loan3m2008 loan3m2007 loan3m2006 loan3m2005 loan3m2004 loan3m2003 loan3m2002 loan3m2001 loan3m2000 loan3m1999 loan3m1998 loan3m1997 loan3to122011 loan3to122010 loan3to122009 loan3to122008 loan3to122007 loan3to122006 loan3to122005 loan3to122004 loan3to122003 loan3to122002 loan3to122001 loan3to122000 loan3to121999  loan3to121998 loan3to121997 loan1to5yrs2011 loan1to5yrs2010 loan1to5yrs2009 loan1to5yrs2008 loan1to5yrs2007
>>  loan1to5yrs2006 loan1to5yrs2005 loan1to5yrs2004 loan1to5yrs2003 loan1to5yrs2002 loan1to5yrs2001 loan1to5yrs2000 loan1to5yrs1999 loan1to5yrs1998 loan1to5yrs1997 loanover5yrs2011 loanover5yrs2010 loanover5yrs2009 loanover5yrs2008 loanover5yrs2007 loanover5yrs2006 loanover5yrs2005 loanover5yrs2004 loanover5yrs2003 loanover5yrs2002 loanover5yrs2001 loanover5yrs2000 loanover5yrs1999  loanover5yrs1998 loanover5yrs1997 sub2011 sub2010  sub2009 sub2008  sub2007 sub2006  sub2005 sub2004 sub2003 sub2002 sub2001 sub2000 sub1999 sub1998 sub1997 sub3m2011 sub3m2010 sub3m2009 sub3m2008 sub3m2007 sub3m2006 sub3m2005 sub3m2004 sub3m2003 sub3m2002 sub3m2001 sub3m2000 sub3m1999 sub3m1998 sub3m1997 sub3to12m2011 sub3to12m2010 sub3to12m2009 sub3to12m2008 sub3to12m2007 sub3to12m2006 sub3to12m2005 sub3to12m2004 sub3to12m2003 sub3to12m2002 sub3to12m2001 sub3to12m2000 sub3to12m1999 sub3to12m1998 sub3to12m1997 sub1to5yrs2011 sub1to5yrs2010 sub1to5yrs2009 sub1to5yrs2008,
>>  i(id) j(year)
>> ----- Original Message -----
>> From: Nick Cox <>
>> To:
>> Cc:
>> Sent: Wednesday, March 28, 2012 8:21:06 PM
>> Subject: Re: st: Data Management
>> The different prefixes are not a problem. You want them to end up as
>> separate variables.
>> The -help- for -reshape- makes this explicit with examples like
>> reshape long inc ue, i(id) j(year)
>> In your case it will presumably be something like
>> reshape long cash securities <and so on>
>> Nick
>> On Wed, Mar 28, 2012 at 5:37 PM, David Ashcraft
>> <> wrote:
>>> These all are balance sheet and income statement items e.g. cash, securities, inventory fixed assets sales etc.
>> Joerg Luedicke <>
>>> "In my case v1 v2 v3 have completely different names."
>>> What does that mean? In what way exactly do they differ? What you
>>> posted does not indicate any differences between variable names across
>>> years or years across variable names.
>>> J.
>>> On Wed, Mar 28, 2012 at 9:10 AM, David Ashcraft
>>> <> wrote:
>>>> I have my data in the following format
>>>> id v1_97 v1_98 v1_99 ...... v1_11 v2_97 v2_98
>>>> Each variable span over 15 years and there are total of 200 variables and about 4000 subjects (id). I want to change the dataset in a panel where data can be arranged like this:
>>>> id year v1 v2 v3
>>>> 1  1997
>>>> 2  1998
>>>> 3  1999
>>>> I thought this  may be the case of RESHAPE - wide to long. In my case v1 v2 v3 have completely different names. Somehow I could not figure out, how to deal with this scenario. Any help will be really appreciated.

*   For searches and help try:

*   For searches and help try:

© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index