Hi All,

This is surely an easy question but somehow I am not being able to get it.

I am using R 2.13.2 and have a data set where variable names like this appear:

pci1990, pci1991, ... , pci2009.

"pci1990" has data on per capita income for 1990, "pci1991" has data on per capita income for 1991, and so on.

I would like to create the logarithm of per capita for each of the year and could do so in STATA with the following commands:

forvalues number = 1990/2009 {
    gen lpci`number' = log(pci`number')
}

What would be the corresponding set of commands in R?

Thanks a lot in advance.

Deepankar

______________________________________________
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