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]

st: Unexpected errors using levelsof


From   "Morales Arilla, Jose" <[email protected]>
To   "[email protected]" <[email protected]>
Subject   st: Unexpected errors using levelsof
Date   Wed, 28 Aug 2013 17:46:01 +0000

Hi! Hope all is well.

I am getting unexpected errors using levelsof on the WDI database.  For
instance:

    levelsof countryname if countrycode=="BRA", local(j)
    `"Brazil"'

    display "`j'" 
    `Brazil"'" invalid name
    r(198);

Without running display, I believe this problem manifests in a larger code
trying to reference countryname of a given countrycode:

    .         local y BRA
    .         preserve
    .         keep if countrycode== "`y'"
    (12985 observations deleted)
    .         
    .         levelsof countryname, local(j)
    `"Brazil"'
    .         
    .         #delimit ;
    delimiter now ;
    .         twoway
    >         (scatter FR_INR_RINR NE_GDI_TOTL_ZS, mlabel(year))
    >         (line FR_INR_RINR NE_GDI_TOTL_ZS)
    >         (lfit FR_INR_RINR NE_GDI_TOTL_ZS)
    >         , title("Sensibility of Investment to Interest Rate")
subtitle("`j'")
    >         ytitle("Real Interest Rate") xtitle("Gross Capital
Formation") legend(off) note("Data source:  World
    >  Development Indicators, 2013");
    too few quotes
    r(132);


I get the same errors despite the countryname (I thought it may be due to
the fact that some countrynames have spaces, hence messing with the code)

Do you have any thoughts on what may be going on and how to solve it?
Alternatively, is there any other code that could help me do the same?

Thanks in advanced!!!

Jose Morales


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


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