Hello, I've imported a csv, semi-colon spearated file with read.csv2, containing one column of rownames and one column of floating point numbers. When I look at the column of data with framename$columnname, I get the values of the column plus level values. Are these level values created automatically ? The problem is when I try to calcluate the correlation coefficient between this set of data and another with lm(x~y), the result indicates that each level seems to have been used as independent variable, making my results unusable. How can I suppress the automatic creation of these levels ? Or how can I model with lm() without the levels interfering ? I've been trying to find the response in some of the manuals, but haven't been able to, so if someone could just point me to the right place... Thank you ! P.S. I'm not subscribed to the list so I would aprreciate cc's to my address. -- Moritz Lennert Charg? de recherche IGEAT - ULB t?l: 32-2-650.65.16 fax: 32-2-650.50.92 email: mlennert at ulb.ac.be -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
On Fri, 6 Apr 2001, Moritz Lennert wrote:> Hello, > > I've imported a csv, semi-colon spearated file with read.csv2, > containing one column of rownames and one column of floating point > numbers. When I look at the column of data with framename$columnname, I > get the values of the column plus level values. Are these level values > created automatically ?Yes. It thinks the columns is not numeric. Is read.csv2 actually appropriate? That is, are the numbers using `,' as the decimal separator? Maybe you should be using read.table( , sep=";")?> The problem is when I try to calcluate the correlation coefficient > between this set of data and another with lm(x~y), the result indicates > that each level seems to have been used as independent variable, making > my results unusable.That's not how to calculate correlation coefficients: see ?cor.> How can I suppress the automatic creation of these levels ? Or how can I > model with lm() without the levels interfering ? > I've been trying to find the response in some of the manuals, but > haven't been able to, so if someone could just point me to the right > place...Well, we don't know what you actually did and you supplied no examples, but my guess is that you need to go the R Data Manual and work out how to read your file as numbers. -- Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272860 (secr) Oxford OX1 3TG, UK Fax: +44 1865 272595 -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Hello, Thanks for the extremely rapid response !> On Fri, 6 Apr 2001, Moritz Lennert wrote: > > > Hello, > > > > I've imported a csv, semi-colon spearated file with read.csv2, > > containing one column of rownames and one column of floating point > > numbers. When I look at the column of data with framename$columnname, I > > get the values of the column plus level values. Are these level values > > created automatically ? > > Yes. It thinks the columns is not numeric. Is read.csv2 actually > appropriate? That is, are the numbers using `,' as the decimal separator? > Maybe you should be using read.table( , sep=";")?read.csv2 uses sep=";" as default. The problem was the dec="," setting in read.csv2. My text file contained decimal points. Thanks again for your help ! Moritz -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._