Statalist


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

Re: AW: st: AW: RE: Problem importing data


From   "Ted Lundgren" <odovakar@spray.se>
To   <statalist@hsphsun2.harvard.edu>
Subject   Re: AW: st: AW: RE: Problem importing data
Date   Thu, 12 Mar 2009 13:15:52 -0700

Again - thank you very much - and thanks to Jeff for the information. I didn't know that.
I have now estimated the panels with relative success, but the results became completely different from when I used Eviews. I would like to use panel EGLS (cross section weights), like I did then, but I'm not sure how, having read the help file. Therefore, if I may pleeeaase ask you just one more question: Is this possible in Stata, and if so, how?




<-----Ursprungligt Meddelande----->
  From: Martin Weiss [martin.weiss1@gmx.de]
Sent: 12/3/2009 7:20:34 PM
To: statalist@hsphsun2.harvard.edu
Subject: Re: AW: st: AW: RE: Problem importing data 


<>
It is not "country" that is strongly balanced, but the panel - which is good
and saves you from having to deal with missings (see a thread this morning
about this issue). Just look at the patterns in

***********
webuse psidextract, clear
xtset id t
xtdes
webuse grunfeld, clear
xtset company time
xtdes
************

BTW, -h xtset- seems to refer to your exact problem under "Examples"


HTH
Martin
_______________________
----- Original Message -----
From: Ted Lundgren
To: statalist@hsphsun2.harvard.edu
Cc: statalist@hsphsun2.harvard.edu
Sent: Thursday, March 12, 2009 8:02 PM
Subject: Re: AW: st: AW: RE: Problem importing data


Okay, here it goes:

"panel variable: countrynum (strongly balanced)
time variable: year, 1992 to 2005
delta: 1 unit"

In other words, I first used 'Encode country, gen(countrynum)'. Then I got
the above. What does it mean that 'Country' is now strongly balanced? Should
I be concerned about this?





<-----Ursprungligt Meddelande----->
From: Martin Weiss [martin.weiss1@gmx.de]
Sent: 12/3/2009 5:13:50 PM
To: statalist@hsphsun2.harvard.edu
Subject: AW: st: AW: RE: Problem importing data

<>
" I get a message that the ID variable is heavily weighted, or something
like that."


You have to be more specific here. Just paste the error in its entirety,
otherwise it is hard to debug...


HTH
Martin

Von: owner-statalist@hsphsun2.harvard.edu
[mailto:owner-statalist@hsphsun2.harvard.edu] Im Auftrag von Ted Lundgren
Gesendet: Donnerstag, 12. März 2009 17:41
An: statalist@hsphsun2.harvard.edu
Cc: statalist@hsphsun2.harvard.edu
Betreff: Re: st: AW: RE: Problem importing data

Thank you very much for your help so far!
Yes, Country is a string variable with the names of different countries. I
was able to carry out the regression by using 'Encode country,
gen(countrynum)' in the end, but now I was wondering: Have I done this
correctly? 'Cause when I do this, I get a message that the ID variable is
heavily weighted, or something like that.

Another question when I'm at it...In order to lag a variable two periods
(for example), I just use the command 'L2.[variable]', right? Or should I
use a minus sign in some way? (For example, in Eviews you simply write:
'variable(-2)', and that's it.


<-----Ursprungligt Meddelande----->


From: Martin Weiss [martin.weiss1@gmx.de]
Sent: 12/3/2009 2:48:37 PM
To: statalist@hsphsun2.harvard.edu
Subject: st: AW: RE: Problem importing data

<>

BTW, there is nothing wrong with year being treated as "int". See -help
data types-: The years conventionally found in today´s datasets are well
within the range of the maximum and minimum for "int"...




HTH
Martin


-----Ursprüngliche Nachricht-----
Von: owner-statalist@hsphsun2.harvard.edu
[mailto:owner-statalist@hsphsun2.harvard.edu] Im Auftrag von Howard Lempel
Gesendet: Donnerstag, 12. März 2009 15:30
An: statalist@hsphsun2.harvard.edu
Betreff: st: RE: Problem importing data

Hi there,

You'll get a better answer if you give a bit more detail. Two things that
would be particularly helpful: 1) What exactly does your data look like? Is
"country" a string variable with the names of different countries? Or does
it consist of numbers that are codes for countries? 2) Exactly what
commands have you typed into Stata so far and exactly what error message did

you get?

That being said, you may want to take a look at -help encode-, which creates

a new variable giving assigning a unique number to each value of a string
variable. If your country variable already consists of numbers, -help
destring- will convert it to a numeric variable. Some non-numeric
characters may have found their way into your country variable, in which
case, you'll need to eliminate those before -destring-ing.

Once you convert country to a numeric variable, you should be able to
-xtset- your data, which tells Stata that your data is a panel and specifies

which variables contain your cross-sectional and time units.

Lastly, you might want to try importing your data using the Stata command
-xmluse- or saving your data as a CSV and using -insheet-.

Hope this helps.
Howie

________________________________________
From: owner-statalist@hsphsun2.harvard.edu
[mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of Ted Lundgren
Sent: Thursday, March 12, 2009 10:13 AM
To: statalist@hsphsun2.harvard.edu
Subject: st: Problem importing data

Hi all,

I am new to Stata (have been using Eviews earlier), and despite this
excellent forum I'm still having trouble getting my panel data right. I have

a "normal" panel so to speak, with "Country" in the first column, "Year" in
the second, and then the variables. When I try to get the data into Stata
from Excel by either Stattransfer or Copy/Paste, "Country" is all the time
being treated as a string variable, no matter what I do. Therefore, the
panel can't be estimated, i.e. I am getting an error message. "Year" is also

being treated as 'Int'. What am I doing wrong?

*
* 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/


*
* 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/
...
_______________________________________________________________
Eniro Supersök - är vad det heter


*
* 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/
..


_______________________________________________________________
Eniro Supersök - är vad det heter

*
* 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/
.

_______________________________________________________________
Eniro Supersök - är vad det heter




© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index