Re: [R] Ridge for logistic regression

2006-11-04 Thread Prof Brian Ripley
On Fri, 3 Nov 2006, Zheng Yuan wrote:

 Dear all experts,

 Does anyone know if there is a R function which can perform Ridge
 regression for logistic models?

multinom and nnet in the package of that name.

-- 
Brian D. Ripley,  [EMAIL PROTECTED]
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 272866 (PA)
Oxford OX1 3TG, UKFax:  +44 1865 272595

__
R-help@stat.math.ethz.ch 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.


[R] R package/function for ridge logistic regression

2006-11-04 Thread Zheng Yuan
Hi,

Is there a R function/package which could do ridge regression for 
logistic regression? Thank you.

-- 
Zheng

__
R-help@stat.math.ethz.ch 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.


[R] Error when using cobs library

2006-11-04 Thread jacinthe
Dear R-Users,

I have problems with the cobs library. When doing the cobs example, I get the 
folling error message:

example(cobs)

cobs x - seq(-1, 3, , 150)

cobs y - (f.true - pnorm(2 * x)) + rnorm(150)/10

cobs con - rbind(c(1, min(x), 0), c(-1, max(x), 1), c(0, 
0, 0.5))

cobs Rbs - cobs(x, y, constraint = increase, pointwise = con)
qbsks2():
 Performing general knot selection ...
Error in as.matrix.csr(new(matrix.coo, ra = c(z1$design), ia = i1, ja = j1,  
: 
unable to find a non-generic version of function as.matrix.csr


Any suggestions how to fix this problem?

Thank you for your help.

Jaci

--

__
R-help@stat.math.ethz.ch 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.


Re: [R] Error when using cobs library

2006-11-04 Thread Martin Maechler
 jacinthe == jacinthe  [EMAIL PROTECTED]
 on Sat, 04 Nov 2006 10:06:10 +0100 writes:

jacinthe Dear R-Users, I have problems with the cobs
jacinthe library.
  ^^^
  It's package!
  It's package!
  .
  [say it load five times, so you re-train your brain ]

jacinthe When doing the cobs example, I get the
jacinthe folling error message:

jacinthe example(cobs)

cobs x - seq(-1, 3, , 150)

cobs y - (f.true - pnorm(2 * x)) + rnorm(150)/10

cobs con - rbind(c(1, min(x), 0), c(-1, max(x), 1), c(0,
jacinthe 0, 0.5))

cobs Rbs - cobs(x, y, constraint = increase, pointwise = con)
cobs 
qbsks2(): Performing general knot selection ...

jacinthe Error in as.matrix.csr(new(matrix.coo, ra =
jacinthe c(z1$design), ia = i1, ja = j1, : unable to find a
jacinthe non-generic version of function as.matrix.csr

Of course, the above works typically, since otherwise the
package would not be on CRAN.

jacinthe Any suggestions how to fix this problem?

It's not easy to help you, since you didn't give any details
about your setup.
Please do so, e.g. by showing the result of sessionInfo().

I guess a mismatch of versions of the packages involved,
notably your version of SparseM maybe outdated.

jacinthe Thank you for your help.

you're welcome.
Martin Maechler, ETH Zurich

__
R-help@stat.math.ethz.ch 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.


Re: [R] plotting residuals

2006-11-04 Thread Martin Maechler
 Jeff == Jeff Miller [EMAIL PROTECTED]
 on Fri, 3 Nov 2006 19:16:20 -0500 writes:

Jeff Does anyone know how to obtain a plot of residuals by
Jeff predicted values for a main-effects aov?

You didn't give a reproducible example, but plot()
[via plot.lm()] will do this {and more by default} :

E.g
   example(aov, echo = FALSE )
   summary(npkM - update(npk.aov, . ~ N+P+K))
  Df Sum Sq Mean Sq F value  Pr(F)  
  N1 189.28  189.28  6.4880 0.01919 *
  P1   8.408.40  0.2880 0.59743  
  K1  95.20   95.20  3.2632 0.08592 .
  Residuals   20 583.48   29.17  
  ---
  Signif. codes:  0 $,1rx(B***$,1ry(B 0.001 $,1rx(B**$,1ry(B 0.01 
$,1rx(B*$,1ry(B 0.05 $,1rx(B.$,1ry(B 0.1 $,1rx(B $,1ry(B 1 

   plot(npkM)  ## the first plot is yours

   plot(npkM, which=1) # does only your plot


The plot is called Tukey-Anscombe plot, and there's also a
bell-and-whistle version of it, TA.plot() in package 'sfsmisc'
(with a longer history than R's plot.lm() !)

Jeff I want to check that the residuals are distributed
Jeff equally across treatment means.
 
Jeff Thanks,

Jeff Jeff
 
Jeff   [[alternative HTML version deleted]]
^
wouldn't have appeared had you followed the
posting guide

Jeff __
Jeff R-help@stat.math.ethz.ch mailing list
Jeff https://stat.ethz.ch/mailman/listinfo/r-help

Jeff PLEASE do read the posting guide
  
Jeff http://www.R-project.org/posting-guide.html and
  
Jeff provide commented, minimal, self-contained,
Jeff reproducible code.

__
R-help@stat.math.ethz.ch 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.


[R] package version error

2006-11-04 Thread Friederike Barthel
Dear List

when trying to run the library(smida) I get the following error:

Error in package_version(vers): invalid version specification


Is there any way to rectify this?

Thank you!

Friederike

__
R-help@stat.math.ethz.ch 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.


Re: [R] read.fwf and header

2006-11-04 Thread Martin Maechler

 FrPi == François Pinard [EMAIL PROTECTED]
 on Wed, 1 Nov 2006 20:21:11 -0500 writes:

FrPi [Martin Maechler]
 In my (and probably R-core's) view, read.fwf() should only have
 to be used for ``legacy data files'' (those times when people used *no*
 separators in order to save disk space), since nowadays, such
 data files should automatically have correct separators. 

FrPi In my day-to-day experience, the main virtue for fixed width format 
FrPi files is basic, humble legibility, much more than disk space savings. 
 
Good point.  For this reason, I often prefer  tab-delimited data files
which are human readable too (and don't need quoting of strings,
typically).  But also, the read.table() default white space-separated files
are very well humanly readable if the column starts are
aligned. You do need to quote (..) strings with embedded white
space then, but that is very well
human-readable if you have a smart editor (such as Emacs ;-)
which then automatically colorizes strings differently than the
rest of the file entries.

However, I think this (human-readibility) only
applies to relatively small files.


FrPi The FWF files I see have delimiters between fields,
FrPi but also embedded space within fields, or at end of
FrPi fields, without extraneous quotes.  XML markup, CSVs,
FrPi quoted fields, etc. are devices meant for helping
FrPi machines much more than for helping humans.  They
FrPi significantly decrease legibility.  Humans not only
FrPi know better, they decipher fixed width format easily
FrPi enough for not really needing hairier devices in
FrPi general.

FrPi FWF files may be archaic, they are not obsolescent.
FrPi They will resist the fashion of the day for
FrPi complexity, and survive in the long run.

I cannot really oppose this statement, 
but am not as sure as you seem  ;-)

Thanks anyway for the thought provoking reply.
With regards,
Martin

__
R-help@stat.math.ethz.ch 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.


[R] question about your photo

2006-11-04 Thread Manuela

   I've accidently found [1]your photo at a flickr and i'm very interested in
   it.
   Can you tell me what place i can see in the background of it?
   ---
   wbr, Barbara

References

   1. 
file://localhost/home/cmf3/tasks/keeper_au_new/0lXwcx/http://www.hunting.pl/flickr.html


[[alternative HTML version deleted]]

__
R-help@stat.math.ethz.ch 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.


[R] User-friendly selective variable-loading function

2006-11-04 Thread Jon Minton
This is probably somewhere in the archives but I couldn't find it:

 

What's the R equivalent function to the Stata command:

 

Use v1 v3 v5 v7 v2 using fileX.dat

 

Where vn are variables named within the headed file fileX.dat 

 

I know I could do this crudely by just loading the file then creating a
subset, but the file is pretty huge. The Import/Export Manual gives some
examples of how to perform some low level operations using scan() but I'd
rather use something more prosaic.

 

Cheers,

 

Jon Minton

 

 


[[alternative HTML version deleted]]

__
R-help@stat.math.ethz.ch 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.


[R] tcltk difficulties

2006-11-04 Thread Charles Annis, P.E.
Friends:

I have a tcltk widget for inputting constants and other values that are
needed by subsequent R functions.  My widget works well.  I have an OnOK
function that does what I had hoped it would.  Among other input items the
widget also uses 6 radio buttons to select one of 6 choices.  It functions
as it should.

Here is the problem:  I would like one of the buttons to be the default and
to be switched on when the widget is created so that the user will have some
guidance.  (Currently all 6 buttons are blank until one is selected.)  I
can't handle the job.  I have Welch and Jones _Practical Programming in Tcl
and Tk_ but would appreciate any help from fellow R users.

Many thanks.


Charles Annis, P.E.

[EMAIL PROTECTED]
phone: 561-352-9699
eFax:  614-455-3265
http://www.StatisticalEngineering.com
 

__
R-help@stat.math.ethz.ch 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.


Re: [R] tcltk difficulties

2006-11-04 Thread Peter Dalgaard
Charles Annis, P.E. [EMAIL PROTECTED] writes:

 Friends:
 
 I have a tcltk widget for inputting constants and other values that are
 needed by subsequent R functions.  My widget works well.  I have an OnOK
 function that does what I had hoped it would.  Among other input items the
 widget also uses 6 radio buttons to select one of 6 choices.  It functions
 as it should.
 
 Here is the problem:  I would like one of the buttons to be the default and
 to be switched on when the widget is created so that the user will have some
 guidance.  (Currently all 6 buttons are blank until one is selected.)  I
 can't handle the job.  I have Welch and Jones _Practical Programming in Tcl
 and Tk_ but would appreciate any help from fellow R users.

 library(tcltk)
 demo(tkdensity)
 # possibly:
 # options(pager=tkpager)
 file.show(system.file(demo/tkdensity.R,package=tcltk))



-- 
   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
~~ - ([EMAIL PROTECTED])  FAX: (+45) 35327907

__
R-help@stat.math.ethz.ch 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.


Re: [R] tcltk difficulties

2006-11-04 Thread Charles Annis, P.E.
Thank you, Peter.  The code provides a great example of packing the widget
nicely too.

Charles Annis, P.E.

[EMAIL PROTECTED]
phone: 561-352-9699
eFax:  614-455-3265
http://www.StatisticalEngineering.com
 

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Peter
Dalgaard
Sent: Saturday, November 04, 2006 8:12 AM
To: [EMAIL PROTECTED]
Cc: r-help@stat.math.ethz.ch
Subject: Re: [R] tcltk difficulties

Charles Annis, P.E. [EMAIL PROTECTED] writes:

 Friends:
 
 I have a tcltk widget for inputting constants and other values that are
 needed by subsequent R functions.  My widget works well.  I have an OnOK
 function that does what I had hoped it would.  Among other input items the
 widget also uses 6 radio buttons to select one of 6 choices.  It functions
 as it should.
 
 Here is the problem:  I would like one of the buttons to be the default
and
 to be switched on when the widget is created so that the user will have
some
 guidance.  (Currently all 6 buttons are blank until one is selected.)  I
 can't handle the job.  I have Welch and Jones _Practical Programming in
Tcl
 and Tk_ but would appreciate any help from fellow R users.

 library(tcltk)
 demo(tkdensity)
 # possibly:
 # options(pager=tkpager)
 file.show(system.file(demo/tkdensity.R,package=tcltk))



-- 
   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
~~ - ([EMAIL PROTECTED])  FAX: (+45) 35327907

__
R-help@stat.math.ethz.ch 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.


Re: [R] multiple plots in the same graph

2006-11-04 Thread Jeff Miller
Li,

What type of plot?

A profile plot would be interaction.plot(factor1,factor2,y)

Jeff


-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Li Zhang
Sent: Friday, November 03, 2006 9:55 PM
To: R-help@stat.math.ethz.ch
Subject: [R] multiple plots in the same graph

I'd like to plot y vs x according to the third
variable group which has three levels. I am
wondering how can I put the three plots in one graph?

Thank you 


 



(http://groups.yahoo.com)

__
R-help@stat.math.ethz.ch 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.

__
R-help@stat.math.ethz.ch 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.


Re: [R] Install RMySQL with R 2.4.0

2006-11-04 Thread Joe W. Byers
I am having trouble as well with the new version of R 2.4.  I downloaded 
the gz file from the cran website,  followed the instructions in the 
README.win file and installed RMySQL.  I have mysql installed under 
c:\mysql not the program files directory which is the only difference.

I get the following error when I attempt to connect to the MySQL Db
  ## open a connection to a MySQL database
  con - dbConnect(dbDriver(MySQL),host='localhost',
+ username='',dbname = 'StorageSims');
Error in function (classes, fdef, mtable)  :
 unable to find an inherited method for function dbConnect, 
for signature MySQLDriver
 

Any help will be appreciated.  I would like to note that there are no 
problems with RMySQL on my linux system, only on XP's.

Thank you
Joe


Frank McCown wrote:
 I just installed RMySQL 0.5-9 with R 2.4.0 on Windows XP and got the 
 following error message when trying to run a script with RMySQL:
 
 Error in library(RMySQL) : 'RMySQL' is not a valid package -- installed 
  2.0.0?
 
 Any ideas?
 
 Thanks,
 Frank
 
 __
 R-help@stat.math.ethz.ch 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.


__
R-help@stat.math.ethz.ch 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.


[R] Equivalent to Stata command

2006-11-04 Thread Jon Minton
Hi:

 

Do any of you know if there's an equivalent function to the Stata command:

 

Use v1 v3 v5 v2 v7 using file.dat

 

In R? (i.e. something that just selectively loads certain variables from a
file and not others)?

 

Thanks

 

Jon Minton

 

 


[[alternative HTML version deleted]]

__
R-help@stat.math.ethz.ch 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.


Re: [R] Equivalent to Stata command

2006-11-04 Thread Marc Schwartz
On Sat, 2006-11-04 at 15:57 +, Jon Minton wrote:
 Hi:

 Do any of you know if there's an equivalent function to the Stata command:

 Use v1 v3 v5 v2 v7 using file.dat

 In R? (i.e. something that just selectively loads certain variables from a
 file and not others)?

See ?read.table and note the 'colClasses' argument, which allows you to
set a NULL value to columns that should be skipped.

Alternatively, you can do a post import column selection using ?subset.

The appropriate solution may be dependent upon whether you are RAM
constrained and/or whether the columns to be skipped are easier to
define than the columns to be selected.

HTH,

Marc Schwartz

__
R-help@stat.math.ethz.ch 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.


Re: [R] Equivalent to Stata command

2006-11-04 Thread Michael Kubovy
On Nov 4, 2006, at 10:57 AM, Jon Minton wrote:

 Do any of you know if there's an equivalent function to the Stata  
 command:

 Use v1 v3 v5 v2 v7 using file.dat

 In R? (i.e. something that just selectively loads certain variables  
 from a
 file and not others)?

How about (assuming that columns in 'file.dat' are separated by white  
space)
data - read.table(file.dat, header = T, sep =  ) # reads in the  
whole file
data - data[, c(1, 3, 5, 2, 7)] # keeps the columns you need

For more, see http://finzi.psych.upenn.edu/R/doc/manual/R-data.html
_
Professor Michael Kubovy
University of Virginia
Department of Psychology
USPS: P.O.Box 400400Charlottesville, VA 22904-4400
Parcels:Room 102Gilmer Hall
 McCormick RoadCharlottesville, VA 22903
Office:B011+1-434-982-4729
Lab:B019+1-434-982-4751
Fax:+1-434-982-4766
WWW:http://www.people.virginia.edu/~mk9y/

__
R-help@stat.math.ethz.ch 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.


Re: [R] Error when using cobs library

2006-11-04 Thread Martin Maechler
 Martin == Martin Maechler [EMAIL PROTECTED]
 on Sat, 4 Nov 2006 10:59:16 +0100 writes:

 jacinthe == jacinthe  [EMAIL PROTECTED]
 on Sat, 04 Nov 2006 10:06:10 +0100 writes:

jacinthe Dear R-Users, I have problems with the cobs
jacinthe library.
Martin ^^^
Martin It's package!
Martin It's package!
Martin .
Martin [say it load five times, so you re-train your brain ]

to which Peter Dalgaard  appropriately responded

  PD   It's loud!
  PD   It's loud!
  PD   ...
  PD 
  PD;-)


jacinthe When doing the cobs example, I get the
jacinthe folling error message:

[]

Martin Of course, the above works typically, since otherwise the
Martin package would not be on CRAN.

jacinthe Any suggestions how to fix this problem?

Martin It's not easy to help you, since you didn't give any details
Martin about your setup.
Martin Please do so, e.g. by showing the result of sessionInfo().

In the mean time jacinthe sent me

Jaci sessionInfo()
Jaci Version 2.3.1 (2006-06-01) 
Jaci i386-pc-mingw32 

Jaci attached base packages:
Jaci [1] splines   methods   stats graphics  grDevices 
utils datasets  base 

Jaci other attached packages:
Jaci cobs   quantreg SparseM   fMultivar  fSeries  .
Jaci 1.1-3.54.01  0.68 221.10065 221.10065 ..


which I think explains things:

Your version of SparseM is probably too old and or may not have
been for R 2.3.1.

Do the following

1) Get R 2.4.0 (or even R-2.4.0-patched)

2) upgrade.packages()

   where you should get newer versions of SparseM (and quantreg)

[you can also try to do 2) alone; and that will be much quicker;
 but note that S4 class/methods handling has been wastly
 improved for R 2.4.0 and later, and SparseM does use them]



Martin I guess a mismatch of versions of the packages involved,
Martin notably your version of SparseM maybe outdated.

jacinthe Thank you for your help.

Martin you're welcome.
Martin Martin Maechler, ETH Zurich

__
R-help@stat.math.ethz.ch 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.


Re: [R] Equivalent to Stata command

2006-11-04 Thread Jon Minton
Thanks, that's the kind of hint I was looking for: the types of data I'm
using (survey responses) generally contain hundreds of variables, of which
I'm typically only looking to extract about 5 or so (hence the 'load
everything then subset' approach being less than ideal...)

Jon

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Marc Schwartz
Sent: 04 November 2006 16:22
To: Jon Minton
Cc: R-help@stat.math.ethz.ch
Subject: Re: [R] Equivalent to Stata command

On Sat, 2006-11-04 at 15:57 +, Jon Minton wrote:
 Hi:

 Do any of you know if there's an equivalent function to the Stata command:

 Use v1 v3 v5 v2 v7 using file.dat

 In R? (i.e. something that just selectively loads certain variables from a
 file and not others)?

See ?read.table and note the 'colClasses' argument, which allows you to
set a NULL value to columns that should be skipped.

Alternatively, you can do a post import column selection using ?subset.

The appropriate solution may be dependent upon whether you are RAM
constrained and/or whether the columns to be skipped are easier to
define than the columns to be selected.

HTH,

Marc Schwartz

__
R-help@stat.math.ethz.ch 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.

__
R-help@stat.math.ethz.ch 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.


Re: [R] Error when using cobs library

2006-11-04 Thread Tamas K Papp
On Sat, Nov 04, 2006 at 05:29:00PM +0100, Martin Maechler wrote:

 Your version of SparseM is probably too old and or may not have
 been for R 2.3.1.
 
 Do the following
 
 1) Get R 2.4.0 (or even R-2.4.0-patched)
 
 2) upgrade.packages()
 ^^^

perhaps you meant update.packages()?

Tamas

__
R-help@stat.math.ethz.ch 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.


Re: [R] Error when using cobs library

2006-11-04 Thread Uwe Ligges


Martin Maechler wrote:
 Martin == Martin Maechler [EMAIL PROTECTED]
 on Sat, 4 Nov 2006 10:59:16 +0100 writes:
 
 jacinthe == jacinthe  [EMAIL PROTECTED]
 on Sat, 04 Nov 2006 10:06:10 +0100 writes:
 
 jacinthe Dear R-Users, I have problems with the cobs
 jacinthe library.
 Martin ^^^
 Martin It's package!
 Martin It's package!
 Martin .
 Martin [say it load five times, so you re-train your brain ]
   
 to which Peter Dalgaard  appropriately responded
 
   PD   It's loud!
   PD   It's loud!
   PD   ...
   PD 
   PD;-)
 
 
 jacinthe When doing the cobs example, I get the
 jacinthe folling error message:
 
 []
 
 Martin Of course, the above works typically, since otherwise the
 Martin package would not be on CRAN.
 
 jacinthe Any suggestions how to fix this problem?
 
 Martin It's not easy to help you, since you didn't give any details
 Martin about your setup.
 Martin Please do so, e.g. by showing the result of sessionInfo().
 
 In the mean time jacinthe sent me
 
 Jaci sessionInfo()
 Jaci Version 2.3.1 (2006-06-01) 
 Jaci i386-pc-mingw32 
 
 Jaci attached base packages:
 Jaci [1] splines   methods   stats graphics  grDevices 
 utils datasets  base 
 
 Jaci other attached packages:
 Jaci cobs   quantreg SparseM   fMultivar  fSeries  .
 Jaci 1.1-3.54.01  0.68 221.10065 221.10065 ..
 
 
 which I think explains things:
 
 Your version of SparseM is probably too old and or may not have
 been for R 2.3.1.
 
 Do the following
 
 1) Get R 2.4.0 (or even R-2.4.0-patched)
 
 2) upgrade.packages()


Let me jump in:

It's update.packages()!
It's update.packages()!
...

(and use argument checkBuilt = TRUE) ;-)



where you should get newer versions of SparseM (and quantreg)
 
 [you can also try to do 2) alone; and that will be much quicker;
  but note that S4 class/methods handling has been wastly
  improved for R 2.4.0 and later, and SparseM does use them]
 
 
 
 Martin I guess a mismatch of versions of the packages involved,
 Martin notably your version of SparseM maybe outdated.
 
 jacinthe Thank you for your help.
 
 Martin you're welcome.
 Martin Martin Maechler, ETH Zurich
 
 __
 R-help@stat.math.ethz.ch 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.

__
R-help@stat.math.ethz.ch 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.


[R] can update.packages Debian package files?

2006-11-04 Thread Tamas K Papp
Hi,

I have searched the archive for the solution of this question, but
couldn't find anything, so I thought I would ask here.

I am using R on a Debian (testing) system.  Many of the R packages I
use are installed as .deb packages, those which are not available in
this format I install using install.packages.

When calling update.packages, sometimes the R repository version is
more recent than the Debian package, and update.packages offers to
update it which I don't want because the new debianized version will
be out soon.  Is it possible to have update.packages recognize that
these are systemwide packages and ignore them when updating?  Or is
manual selection of what to update the only option?

Thanks,

Tamas

__
R-help@stat.math.ethz.ch 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.


Re: [R] Error when using cobs library

2006-11-04 Thread Peter Dalgaard
Uwe Ligges [EMAIL PROTECTED] writes:

 Martin Maechler wrote:
  Martin == Martin Maechler [EMAIL PROTECTED]
  on Sat, 4 Nov 2006 10:59:16 +0100 writes:
  
  jacinthe == jacinthe  [EMAIL PROTECTED]
  on Sat, 04 Nov 2006 10:06:10 +0100 writes:
  
  jacinthe Dear R-Users, I have problems with the cobs
  jacinthe library.
  Martin ^^^
  Martin It's package!
  Martin It's package!
  Martin .
  Martin [say it load five times, so you re-train your brain ]
  
  to which Peter Dalgaard  appropriately responded
  
PD   It's loud!
PD   It's loud!
PD   ...
PD 
PD;-)

  2) upgrade.packages()
 
 
 Let me jump in:
 
 It's update.packages()!
 It's update.packages()!
 ...
 
 (and use argument checkBuilt = TRUE) ;-)


Before anyone else joins the fun, I actually should have said aloud...

-- 
   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
~~ - ([EMAIL PROTECTED])  FAX: (+45) 35327907

__
R-help@stat.math.ethz.ch 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.


Re: [R] Install RMySQL with R 2.4.0

2006-11-04 Thread Seth Falcon
Joe W. Byers [EMAIL PROTECTED] writes:

 I am having trouble as well with the new version of R 2.4.  I downloaded 
 the gz file from the cran website,  followed the instructions in the 
 README.win file and installed RMySQL.  I have mysql installed under 
 c:\mysql not the program files directory which is the only difference.

 I get the following error when I attempt to connect to the MySQL Db
   ## open a connection to a MySQL database
   con - dbConnect(dbDriver(MySQL),host='localhost',
 + username='',dbname = 'StorageSims');
 Error in function (classes, fdef, mtable)  :
  unable to find an inherited method for function dbConnect, 
 for signature MySQLDriver
  

 Any help will be appreciated.  I would like to note that there are no 
 problems with RMySQL on my linux system, only on XP's.

Just to make sure:

Before trying the code you posted, you did library(RMySQL), right?

Also, what versions of DBI and RMySQL are you using?

__
R-help@stat.math.ethz.ch 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.


Re: [R] Measurements of 3000 criminals

2006-11-04 Thread Ted Harding
On 31-Oct-06 Martin Maechler wrote:
 Jean == Jean lobry [EMAIL PROTECTED]
 on Sat, 28 Oct 2006 13:07:04 +0200 writes:
  Hallo everyone,
  
  excuse me if this is not a genuine R question but I do
  not know where to ask else.
  
  Referring to e.g.
  
  https://stat.ethz.ch/pipermail/r-help/2004-December/062114.html
  
  I wonder if these measurements of 3000 criminals (raw
  data) are available anywhere.
  [...]
 
 Jean Dietrich,
 
 Jean I'm not sure, but this is perhaps what you want:
 
 Jean crim -
 Jean
 read.table(http://pbil.univ-lyon1.fr/R/donnees/criminals1902.txt;)
 Jean [...]
 
 Jean, this is really very nice, and given the historic
 importance of the data, I'd like to add this to the official
 R 'datasets'  (the standard data set package), with tribute to
 you and Anne-Béatrice, and the references.
 [...]

A further historical note. No doubt many R-helpreaders will
have recently received (e.g. via allstat) the announcement:

  RSS Highlands local group meeting, December 5:
  100 years of statistics in Aberdeen

  Dear all!

  This is a first announcement for a special meeting of the
  Highlands local group of the RSS celebrating the centenary
  of the first lecturer in Statistics at the University of
  Aberdeen (Dr William Robert Macdonell), one of the first
  in the UK.

The same W. R. Macdonell as published the data in question.

Being a centenary takes it back to 1906. Such biographic
information as I have been able to find says:

W. R. MACDONELL. Born October 16, 1852. Died May 15, 1916
  KER Biometrika.1917; 11: 281-283

So he was well into his 50s when so honoured, and had only
few years to go.

Somewhat to my surpise, the excellent Index of Biographies
of mathematicians and statisticians at the University of
St Andrews:

http://www-groups.dcs.st-and.ac.uk/~history/BiogIndex.html

has nothing for him, despite his being a First for Scotland!

Best wishes to all,
Ted.


E-Mail: (Ted Harding) [EMAIL PROTECTED]
Fax-to-email: +44 (0)870 094 0861
Date: 04-Nov-06   Time: 19:32:50
-- XFMail --

__
R-help@stat.math.ethz.ch 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.


[R] Placing of legends

2006-11-04 Thread Thevini Christian Lerch
Hello,

placings of legends is sometimes tricky.
For placing outside the plot region I found locator to be useful. 
Unfortunately, the click defines the upper left corner.

Is there a way to change this corner (say lower right corner)?

Thanks,

Christian

__
R-help@stat.math.ethz.ch 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.


Re: [R] can update.packages Debian package files?

2006-11-04 Thread Dirk Eddelbuettel

Tamas,

Great question. 

On 4 November 2006 at 11:55, Tamas K Papp wrote:
| I have searched the archive for the solution of this question, but
| couldn't find anything, so I thought I would ask here.

It has been discussed not that long ago on r-sig-debian, feel free to
subscribe there as you may find the list useful for all matters Debian and R.

| I am using R on a Debian (testing) system.  Many of the R packages I
| use are installed as .deb packages, those which are not available in
| this format I install using install.packages.
| 
| When calling update.packages, sometimes the R repository version is
| more recent than the Debian package, and update.packages offers to
| update it which I don't want because the new debianized version will
| be out soon.  Is it possible to have update.packages recognize that
| these are systemwide packages and ignore them when updating?  Or is
| manual selection of what to update the only option?

Let's recall that we have three locations for R packages under Debian (and
hence also Ubuntu et al):

i)   /usr/lib/R/library
used *exclusively* by r-base-core (and e.g. not even by
r-recommended such as r-cran-vr, r-cran-boot, ...)

ii)  /usr/lib/R/site-library
used *exclusively* by Debian (or Ubuntu) supplied packages
that you can updated with apt-get et al (provided the
maintainer stays current)

iii) /usr/local/lib/R/site-library
used for the rest

The key is that these are non-overlapping which you can employ with
update.packages() provided you tell update.packages() to limit itself to
the directory in iii).  Which is as simple as saying

 update.packages(lib.loc=/usr/local/lib/R/site-library)

Now, for added bonus, the script 'update.r' in the littler package (version
0.0.8 or later) does all that for you. So after an initial

$ sudo apt-get install littler 

all you need is

$ sudo /usr/share/doc/littler/examples/update.r

Cheers, Dirk



-- 
Hell, there are no rules here - we're trying to accomplish something. 
  -- Thomas A. Edison

__
R-help@stat.math.ethz.ch 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.


Re: [R] Placing of legends

2006-11-04 Thread Stephen D. Weigand

On Nov 4, 2006, at 1:47 PM, Thevini  Christian Lerch wrote:

 Hello,

 placings of legends is sometimes tricky.
 For placing outside the plot region I found locator to be useful.
 Unfortunately, the click defines the upper left corner.

 Is there a way to change this corner (say lower right corner)?

 Thanks,

 Christian


You could take advantage of the fact that legend() returns the height 
and width of the legend box and calculate where the top left should be 
given the bottom right. Here's something maybe you can build off of:

mylegend - function(x.right, y.bottom = NULL, ...) {
 ## allowance for input from locator() or
xy - xy.coords(x = x.right, y = y.bottom)
x.right - xy$x
y.bottom - xy$y

L - legend(x = topleft, plot = FALSE, ...)
x - x.right - L$rect$w  # shift left by width of box
y - y.bottom + L$rect$h # shift up by height of box
legend(x = x, y = y, ...)
}

plot(1:10)

### given separate 'x' and 'y'
mylegend(x.right = 10, y.bottom = 2,
legend = c(Alpha, Beta), pch = 1:2, lty = 1:2)

### given locator()-like input
mylegend(list(x=6,y=8), legend = c(Alpha, Beta), pch = 1:2)


Hope this helps,

Stephen
Rochester, Minnesota, USA

__
R-help@stat.math.ethz.ch 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.


[R] struggling to plot subgroups

2006-11-04 Thread Sumitrajit Dhar
Hi Folks,

I have data that looks like this:

freqgender  xBar
1000m   2.32
1000f   3.22
2000m   4.32
2000f   4.53
3000m   3.21
3000f   3.44
4000m   4.11
4000f   3.99

I want to plot two lines (with symbols) for the two groups m and  
f. I have tried the following:

plot(xBar[gender==m]~freq[gender==f]) followed by

lines(xBar[gender==m]~freq[gender==f])

with different symbols and lines colors (which I know how to do).

However, these initial plots are not giving me the right output. The  
initial plot command generates the following error.
Error in plot.window(xlim, ylim, log, asp, ...) :
need finite 'xlim' values
In addition: Warning messages:
1: no non-missing arguments to min; returning Inf
2: no non-missing arguments to max; returning -Inf
3: no non-missing arguments to min; returning Inf
4: no non-missing arguments to max; returning -Inf

A second issue, I would also like to offset the second set of points  
along the x-axis so that the error bars will be visible.

Any help is appreciated.

Regards,
Sumit

__
R-help@stat.math.ethz.ch 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.


Re: [R] Measuring the effects of history on event probabilities

2006-11-04 Thread Spencer Graves
  I haven't seen other replies, so I'll offer a feeble comment:  
It's not clear to me the events for which you want to estimate 
probabilities.  If you would still like help from this listserve, I 
suggest you send us a toy example with typical (possibly made up) data 
consisting of 5-10 observations on 2-4 individuals.  Then tell us what 
you'd like to do in terms of this toy example, possibly including things 
you've tried and why they didn't seem to give you what you wanted. 

  Hope this helps. 
  Spencer Graves

Jon Minton wrote:
 This is probably very simple but my brain has frozen over. (I'm trying to
 warm it with coffee)

  

 I have observations of around 22000 individuals over 13 successive years:
 they were either 'interviewed' at time t or 'not interviewed'.

 What's the most appropriate function/approach to use to find out the extent
 to which individuals' event outcomes are temporally correlated?

  

 Thanks,

  

  

 Jon Minton

  

  


   [[alternative HTML version deleted]]

 __
 R-help@stat.math.ethz.ch 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.


__
R-help@stat.math.ethz.ch 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.


Re: [R] struggling to plot subgroups

2006-11-04 Thread hadley wickham
On 11/4/06, Sumitrajit Dhar [EMAIL PROTECTED] wrote:
 Hi Folks,

 I have data that looks like this:

 freqgender  xBar
 1000m   2.32
 1000f   3.22
 2000m   4.32
 2000f   4.53
 3000m   3.21
 3000f   3.44
 4000m   4.11
 4000f   3.99

 I want to plot two lines (with symbols) for the two groups m and
 f. I have tried the following:

This is pretty easy with ggplot.  Something like:

install.packages(ggplot)
library(ggplot)
qplot(freq, xBar, data=my.data.frame, colour=gender, id=gender,
type=c(point,line))

should do what you want.

Hadley

__
R-help@stat.math.ethz.ch 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.


[R] Date, date, POSIX question

2006-11-04 Thread Joe W. Byers
I have been working with R extensively for several months.  I switched 
from SAS and Matlab to R.  My question is

Can anyone explain the benefits and detractions of the 'Date' package 
verses the 'date' package and verses 'POSIX' dates.

I have noticed several other packages use one or the other.  Rmetrics 
seems to standardize on POSIX.  I can only see differences in default 
formats, and the starting counting number be it 1 1 1900 or something else.

I am trying to standardize code that I write for research and to provide 
to my students on one date schema.  The documentation is very good on 
using a specific package, but I can not tell the which one provides the 
broadest coverage across R packages or is just the better one to use.

I know all of you have more experience with some of these and I am just 
soliciting your opinions and comments.

Thank you
Joe

__
R-help@stat.math.ethz.ch 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.


Re: [R] Install RMySQL with R 2.4.0

2006-11-04 Thread Joe W. Byers
Seth Falcon wrote:
 Joe W. Byers [EMAIL PROTECTED] writes:
 
 I am having trouble as well with the new version of R 2.4.  I downloaded 
 the gz file from the cran website,  followed the instructions in the 
 README.win file and installed RMySQL.  I have mysql installed under 
 c:\mysql not the program files directory which is the only difference.

 I get the following error when I attempt to connect to the MySQL Db
   ## open a connection to a MySQL database
   con - dbConnect(dbDriver(MySQL),host='localhost',
 + username='',dbname = 'StorageSims');
 Error in function (classes, fdef, mtable)  :
  unable to find an inherited method for function dbConnect, 
 for signature MySQLDriver
  

 Any help will be appreciated.  I would like to note that there are no 
 problems with RMySQL on my linux system, only on XP's.
 
 Just to make sure:
 
 Before trying the code you posted, you did library(RMySQL), right?
YES
 
 Also, what versions of DBI and RMySQL are you using?
RMySQL from http://cran.r-project.org/src/contrib/Descriptions/RMySQL.html
DBI Version 0.1-10 according to the NEWS file in ../R/library
 
 __
 R-help@stat.math.ethz.ch 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.


__
R-help@stat.math.ethz.ch 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.