Bookmark and Share

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


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

Re: st: reshape "variable not found in using data" error (Stata 10.1)


From   Nick Cox <[email protected]>
To   [email protected]
Subject   Re: st: reshape "variable not found in using data" error (Stata 10.1)
Date   Wed, 20 Jul 2011 08:42:28 -0500

You don't spell out exactly what you want the -reshape- to do,

At a wild guess, you want

. reshape wide value, i(company_name year) j(datatype_code) string

Otherwise put, your syntax perhaps confuses present and intended data
structure.

Nick

On Tue, Jul 19, 2011 at 10:33 PM, Leandro Brufman
<[email protected]> wrote:
> I've seen a few threads of similar mistakes that suggest updating.
> Still, I couldn't make this reshape to work. Below you'll see the code
> with the output.
> I sequentially describe the dataset, show which variables are the ID,
> try to do the reshape (and get the error), check the version and the
> update query.
>
> Anyone help??
> Many thanks in advance...
> *****************************************
>
> . describe
>
> Contains data
>  obs:     1,692,572
>  vars:            10
>  size:   340,206,972 (75.0% of memory free)
> -------------------------------------------------------------------------------------------------------------------
>              storage  display     value
> variable name   type   format      label      variable label
> -------------------------------------------------------------------------------------------------------------------
> company_name    str20  %20s
> year            int    %9.0g
> type            str6   %9s                    Type
> wc06035         str9   %9s                    WC06035
> wc06001         str65  %65s                   WC06001
> wc06026         str15  %15s                   WC06026
> generalindust~o str4   %9s                    GENERAL INDUSTRY CLASSIFICATIO
> company_4merge  str65  %65s
> value           long   %10.0g
> datatype_code   str7   %9s
> -------------------------------------------------------------------------------------------------------------------
> Sorted by:  company_name
>     Note:  dataset has changed since last saved
>
> . isid company_name datatype_code year
>
> . reshape wide value, i(company_name datatype_code year) j(datatype_code) string
> (note: j = WC01001 WC01051 WC01100 WC01101 WC01151 WC01249 WC01250
> WC01551 WC01651 WC01706 WC02001 WC02051 WC02101
>> WC02201 WC02501 WC02999 WC03040 WC03051 WC03101 WC03251 WC03351 WC03501 WC03999 WC04148 WC04201 WC04251 WC04551 W
>> C04601 WC04860 WC08001 WC18191 WC18198)
> variable datatype_code not found in using data
> r(111);
>
> . version
> version 10.1
>
> . update query
> (contacting http://www.stata.com)
>
> Stata executable
>    folder:               G:\stata10se\
>    name of file:         wsestata.exe
>    currently installed:  10 Jun 2010
>    latest available:     10 Jun 2010
>
> Ado-file updates
>    folder:               G:\stata10se\ado\updates\
>    names of files:       (various)
>    currently installed:  10 Jun 2010
>    latest available:     10 Jun 2010
>
> Utilities updates
>    folder:               G:\stata10se\utilities
>    names of files:       (various)
>    currently installed:  18 Aug 2009
>    latest available:     18 Aug 2009
>
> Comment
>    Stata 11, a new release, is available.
>    New in Stata 11 are: PDF manuals, multiple imputation, GMM, factor
>    variables, competing risks, state-space models, multivariate GARCH,
>    Variables Manager, new Data Editor, and more.
>    For details, point your browser at
>        http://www.stata.com/stata11/
>
> Recommendation
>    Do nothing; all files up to date.
>

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


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