[R] Help on np package - how to set the data into a panel format
jrkrideau at inbox.com
Sat Jul 13 17:30:38 CEST 2013
We really need to see the data, I think.
You can use the function dput(), see ?dput
dput(filename) will give you a formatted output that you can just copy and paste into an e-mail. An R-help reader can just copy and paste that into R and have an exact copy of your data set.
Kingston ON Canada
> -----Original Message-----
> From: serenamasino at gmail.com
> Sent: Sat, 13 Jul 2013 12:30:34 +0100
> To: r-help at r-project.org
> Subject: [R] Help on np package - how to set the data into a panel format
> I am new to R and am a STATA user. I am using R as I need the np package
> perform a local linear non parametric regression on a panel data of
> countries. My data contains 138 countries, each observed for 31 years,
> 1981 to 2011.
> I am aware of the panel package in R which sets the data in panel format
> telling R which one is the "id" and which one is the "time" variable. I
> not sure however what to use to set the data into a panel format when
> the np package.
> What I have done so far was to
> read.csv ("C:/folder/filename.csv")
> then i explore it
> and my country variable appears as a "factor", which I think is good
> Because it means that is a string to which R has attached a value.Year
> instead appears as "int".
> Now, how can I tell R that the data has repeated country cross sections
> 31 years and so that the data should be treated as a panel of 138
> observed each for 31 consecutive years?
> Many Thanks in advance for your help, and apologies if this is a very
> question, I have tried looking it up in a number of places but all I came
> by was the panel package instructions and I am not sure whether they can
> transfer to the np package too.
> [[alternative HTML version deleted]]
> R-help at r-project.org mailing list
> PLEASE do read the posting guide
> and provide commented, minimal, self-contained, reproducible code.
GET FREE SMILEYS FOR YOUR IM & EMAIL - Learn more at http://www.inbox.com/smileys
Works with AIM®, MSN® Messenger, Yahoo!® Messenger, ICQ®, Google Talk™ and most webmails
More information about the R-help