Hi,

I am new to R and am a STATA user. I am using R as I need the np package to
perform a local linear non parametric regression on a panel data of
countries. My data contains 138 countries, each observed for 31 years, from
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 am
not sure however what to use to set the data into a panel format when using
the np package.

What I have done so far was to

read.csv ("C:/folder/filename.csv")

then i explore it
str(filename)

and my country variable appears as a "factor", which I think is good right?
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 for
31 years and so that the data should be treated as a panel of 138 countries
observed each for 31 consecutive years?

Many Thanks in advance for your help, and apologies if this is a very basic
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.

Best,
Serena

        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to