Re: [R] help with R

From: Peter Dalgaard <>
Date: Wed, 09 Jan 2008 23:11:49 +0100 wrote:
> Folks, Two simple questions :
> (1) I have a data set (call it data.xls) in a folder in my hard drive. How
> do I perform a simple regression between two variables from that data set?
> After I click on 'R', what exactly do I type in?
Ideally, you shouldn't really start from there (because transfer of data between different applications is not for beginners -- it is better to have your data in a text file with a well-defined format), but let's try:

  1. Open the spreadsheet. Make sure that the 1st element of each column has the name of the variable. Let us assume that the 2 relevant ones are called "x" and "y". Highlight the relevant region and copy to clipboard.
  2. In R type

mydata <- read.delim2("clipboard")
plot(y~x, data=mydata)
summary(lm(y~x, data=mydata))

This assumes that you are using a German locale (comma is decimal separator), otherwise use read.delim("clipboard").

> (2) Where do I get to see the complete library of packages offered by R?
> In particular, I am interested in quantile regression and logistic
> regression.
> Thanks.
> Sitadri

   O__  ---- Peter Dalgaard             ุster Farimagsgade 5, Entr.B
  c/ /'_ --- Dept. of Biostatistics     PO Box 2099, 1014 Cph. K
 (*) \(*) -- University of Copenhagen   Denmark          Ph:  (+45) 35327918
~~~~~~~~~~ - (                  FAX: (+45) 35327907

______________________________________________ mailing list
PLEASE do read the posting guide
and provide commented, minimal, self-contained, reproducible code.
Received on Wed 09 Jan 2008 - 22:18:39 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Thu 10 Jan 2008 - 00:30:06 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.

list of date sections of archive