[R] importing spreadsheet data - linera regression - panel data

Cecilia Carmo cecilia.carmo at ua.pt
Sun Apr 19 13:30:10 CEST 2009


Hi everyone and thank you for the help you could give me.

My data is in a spreadsheet. The 1st column identifies the 
firm (with the fiscal number), the columns 2 to 11 have 
the variable value for 11 years. I have many variables 
(files like this). Each file has about 40.000 firms 
(rows). I transformed all the files in txt files. The data 
is a panel data, like this:
firm	revenu2007	revenue2006	revenue2005	revenue2004	revenue2003	revenue2002	revenue2001	revenue2000	revenue1999	revenue1998		
500100144										
504394029		4282809	3769159	3520807	3548322	3458122										
503264032										
502011475		2595780	2417433	2299563	2060552	1804531	1821638	1789533	1463371	947712
500400911										
504615947		22801	28656	27067	26182	26356	34060	39147		
502616695		1412354	1209619	1429755	1623496	1955123	2273486	2087406	2076868	2036937
500829993		1383396	1095570	805830	793809	777591	791614	779924	774560	702845
The objective of my work is to do linear regressions with 
the variables in the files or with other variables that I 
can obtain from those by doing some mathematical 
operations.  I’ve already tried to import this information 
to an array in R, but I’ve seen that the linear 
regressions functions need the data into a dataframe. So 
I’m asking: How to import this information to a dataframe 
in R, in a manner that I can easily do the mathematical 
operations between the variables and then use it to do the 
regressions?

Cecília Carmo




More information about the R-help mailing list