Re: [R] socket clusters on snow dies easily

2004-04-09 Thread Rong-En Fan
On Thu, Apr 08, 2004 at 11:18:43AM -0500, Luke Tierney wrote:
 If you absolutely have to use the socket approach you will probably
 have to track down the particular reason for this failure in your
 environment by looking at what is going on under the hood and checking
 the pieces.  The master sets up a server socket, the slave noted
 connect to that socket, and for some reason the first read on that
 connection seems to be failing.  It could be a timing issues--you may
 need to adjust socket timeouts, it could be a permission or firewall
 issue; hard to tell without experimenting.
 
 You are probably better off using the PVM version if at all possible.
 Overall it more solid than the socket version and likely to have fewer
 issues.

er, due to some historical reason, we want to use socket instead of
MPI or PVM. My friend and I will trace the socket code and see how
to solve this problem. If there is anything new, i'll post here.

Regards,
Rong-En Fan

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] bootstrap function coefficients

2004-04-09 Thread Michaël Coeurdassier
Dear R community,

Please, can you help me with a problem concerning bootstrap. The data table 
called «RMika», contained times (Tps) and corresponding concentration of a 
chemical in a soil (SolA). I would like to get, by bootstraping, 10 
estimations of the parameters C0 and k from the function: SolA = 
C0*exp(-k*Tps).

# First, I fit the data and all is OK

  tabMika-read.delim(RMika.txt)
  library(nls)
  attach(tabMika)
  Expon-function(Tps,parm){
+ C0-parm[1]
+ k-parm[2]
+ }
  DegSA.nls-nls(SolA~C0*exp(-k*Tps),start=c(C0=35, k=1),tabMika)
  summary(DegSA.nls)

Formula: SolA ~ C0 * exp(-k * Tps)

Parameters:
 Estimate Std. Error t value Pr(|t|)
C0 25.682104   1.092113   23.52   2e-16 ***
k   0.087356   0.007582   11.52 6.36e-13 ***
---
Signif. codes:  0 `***' 0.001 `**' 0.01 `*' 0.05 `.' 0.1 ` ' 1

Residual standard error: 2.584 on 32 degrees of freedom

Correlation of Parameter Estimates:
   C0
k 0.7101


# Second, I try to use bootstrap to get the 10 estimates of k and C0


  library(bootstrap)
  theta-function(tabMika){coef(eval(DegSA.nls$call))}
  bootSolA.nls-bootstrap(tabMika,10,theta)

Warning message:
multi-argument returns are deprecated in: return(thetastar, func.thetastar, 
jack.boot.val, jack.boot.se,

  bootSolA.nls
$thetastar
   [,1][,2][,3][,4][,5][,6]
C0 25.68210358 25.68210358 25.68210358 25.68210358 25.68210358 25.68210358
k   0.08735615  0.08735615  0.08735615  0.08735615  0.08735615  0.08735615
   [,7][,8][,9]   [,10]
C0 25.68210358 25.68210358 25.68210358 25.68210358
k   0.08735615  0.08735615  0.08735615  0.08735615

# As you can notify, the 10 estimations have the same values for C0 and k. 
Moreover, this correspond to the values of k and C0 determined by fitting 
all the data without bootstrap!!!???
I cannot find what is wrong. Please, if you find a solution, thank you to 
send it to me.

Sincerely

Michael Coeurdassier


Michaël COEURDASSIER, PhD
Department of Environmental Biology
UC INRA EA3184MRT
Institute for Environmental Sciences and Technology

University of Franche-Comte
Place Leclerc
25030 Besançon cedex
FRANCE
Tel : +33 (0)381 665 741
Fax : +33 (0)381 665 797

[EMAIL PROTECTED]: [EMAIL PROTECTED]
http://lbe.univ-fcomte.fr/

[[alternative HTML version deleted]]

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] generating 00Index.html

2004-04-09 Thread Nolwenn Le Meur
Hi,
I've started to create the documentation of my package.
I've generate a pdf and the different html files from .Rd files.
However I don't know how to automatically generate the 00Index.html. Do I
have to write one in latex style and convert it or can I use  the CONTENTS,
INDEX, or Rd files.

Thanks

Nolwenn


Nolwenn Le Meur
INSERM U533
Faculté de médecine
1, rue Gaston Veil
44035 Nantes Cedex 1
France

Tel: (+33)-2-40-41-29-86 (office)
 (+33)-2-40-41-28-44 (secretary)
Fax: (+33)-2-40-41-29-50
mail: [EMAIL PROTECTED]

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] bootstrap function coefficients

2004-04-09 Thread Prof Brian Ripley
Package bootstrap is ORPHANED (that is, unsupported by anyone).  Do try 
package boot instead.

10 is a very small number of bootstrap replications: I do suggest you try 
100 or more.

On Fri, 9 Apr 2004, Michaël  Coeurdassier wrote:

 Dear R community,
 
 Please, can you help me with a problem concerning bootstrap. The data table 
 called «RMika», contained times (Tps) and corresponding concentration of a 
 chemical in a soil (SolA). I would like to get, by bootstraping, 10 
 estimations of the parameters C0 and k from the function: SolA = 
 C0*exp(-k*Tps).
 
 # First, I fit the data and all is OK
 
   tabMika-read.delim(RMika.txt)
   library(nls)
   attach(tabMika)
   Expon-function(Tps,parm){
 + C0-parm[1]
 + k-parm[2]
 + }
   DegSA.nls-nls(SolA~C0*exp(-k*Tps),start=c(C0=35, k=1),tabMika)
   summary(DegSA.nls)
 
 Formula: SolA ~ C0 * exp(-k * Tps)
 
 Parameters:
  Estimate Std. Error t value Pr(|t|)
 C0 25.682104   1.092113   23.52   2e-16 ***
 k   0.087356   0.007582   11.52 6.36e-13 ***
 ---
 Signif. codes:  0 `***' 0.001 `**' 0.01 `*' 0.05 `.' 0.1 ` ' 1
 
 Residual standard error: 2.584 on 32 degrees of freedom
 
 Correlation of Parameter Estimates:
C0
 k 0.7101
 
 
 # Second, I try to use bootstrap to get the 10 estimates of k and C0
 
 
   library(bootstrap)
   theta-function(tabMika){coef(eval(DegSA.nls$call))}
   bootSolA.nls-bootstrap(tabMika,10,theta)
 
 Warning message:
 multi-argument returns are deprecated in: return(thetastar, func.thetastar, 
 jack.boot.val, jack.boot.se,
 
   bootSolA.nls
 $thetastar
[,1][,2][,3][,4][,5][,6]
 C0 25.68210358 25.68210358 25.68210358 25.68210358 25.68210358 25.68210358
 k   0.08735615  0.08735615  0.08735615  0.08735615  0.08735615  0.08735615
[,7][,8][,9]   [,10]
 C0 25.68210358 25.68210358 25.68210358 25.68210358
 k   0.08735615  0.08735615  0.08735615  0.08735615
 
 # As you can notify, the 10 estimations have the same values for C0 and k. 
 Moreover, this correspond to the values of k and C0 determined by fitting 
 all the data without bootstrap!!!???
 I cannot find what is wrong. Please, if you find a solution, thank you to 
 send it to me.
 
 Sincerely
 
 Michael Coeurdassier


-- 
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

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] generating 00Index.html

2004-04-09 Thread Prof Brian Ripley
It happens automatically when you INSTALL the package sources ... sounds 
as if you are not actually doing that.

On Fri, 9 Apr 2004, Nolwenn Le Meur wrote:

 I've started to create the documentation of my package.
 I've generate a pdf and the different html files from .Rd files.
 However I don't know how to automatically generate the 00Index.html. Do I
 have to write one in latex style and convert it or can I use  the CONTENTS,
 INDEX, or Rd files.


-- 
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

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] nlme on Windows 2000 (v1.8.1)

2004-04-09 Thread Prof Brian Ripley
See the rw-FAQ, specifically Q2.19.  It is very likely some piece of
rogue software on your machines.

On Thu, 8 Apr 2004, Kent Holsinger wrote:

 I have a problem with nlme on Windows 2000, and I'm having a devil of a 
 time determining whether the problem is with my computer or with 
 something in R. I'm running v1.8.1 on a Dell Pentium III with 512MB of 
 RAM and all of the recommended Windows 2000 updates applied.
 
 If I use Rterm, I can run analyses with NLME to my heart's content. But 
 when I run Rgui, I encounter a floating point exception. To be concrete if I
 
   library(nlme)
 Loading required package: lattice
   data(Rail)
   lme(travel ~ 1, data = Rail, random = ~ 1 | Rail)
 
 (the first example in Pinheiro and Bates), R churns for a while and a 
 window pops up informing me of an application error. Specifically, The 
 exception Floating-point division by zero. (0xc08e) occurred in the 
 application at location 0x639b50ff. There error occurs every time. The 
 same analysis runs flawlessly in Rterm.
 
 To make it even stranger, I get the same error on a Toshiba Pentium 
 laptop (also with 512MB of memory, although I haven't tried the analyses 
 in Rterm on that machine). On that machine, I get a blue screen after 
 acknowledging the error. The laptop is a dual boot on which I run Linux 
 (Fedora Core 1). R works perfectly on it under Linux.
 
 I've downloaded and re-installed the binaries on both machines several 
 times, so I don't think I have a corrupted download. Any ideas on how to 
 diagnose (and solve) this problem would be greatly appreciated.
 
 Kent
 
 

-- 
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

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] nlme on Windows 2000 (v1.8.1)

2004-04-09 Thread Duncan Murdoch
On Thu, 08 Apr 2004 08:03:56 -0400, you wrote:

If I use Rterm, I can run analyses with NLME to my heart's content. But 
when I run Rgui, I encounter a floating point exception.

I agree with Prof Ripley: I'd suspect video (or other) drivers messing
up the floating point control word. 

Identifying the exact cause is quite hard, but you can probably
confirm this by rebooting in safe mode (i.e. with minimal drivers
loaded).  You do this by hitting F8 during the boot sequence.  R can
run fine in safe mode; if you don't get the error, then it's pretty
clearly one of the drivers that you usually load that is causing the
trouble.  Figuring out which one won't be easy...

Duncan Murdoch

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] %+=% and eval.parent()

2004-04-09 Thread Prof Brian Ripley
On 7 Apr 2004, Peter Dalgaard wrote:

 Robin Hankin [EMAIL PROTECTED] writes:
 
  Hi again everybody.
  
  Yesterday I had a problem with c-style += functions.  One suggestion
  was to define
  
  R plus- - function(x,value){x+value}
  
  Then
  
  R a - matrix(1:9,3,3)
  R plus(a[a%%2==1]) - 1000
  
  works as desired.
  
  
  QUESTION: why does this behave differently:
  
  
  R plus- - function(x,y){x+y}
  R a - matrix(1:9,3,3)
  
  R plus(a[a%%2==1]) - 1000
  Error in plus-(`*tmp*`, value = 1000) :
  unused argument(s) (value ...)
  R
  
  The only change seems to be changing the second argument from value
  to y.  Why does this affect anything?  Where do I look for
  documentation on things like plus-  ?
 
 These assignment functions work basically by
 
  plus(x) - foo 
 
 getting internally transcribed as
 
  x - plus-(x, value=foo)
 
 (actually, there's an intermediate alias for the target to avoid
 multiple evaluation; this is what shows up as *tmp*, but you're not
 supposed to know that...)
 
 The use of the keyword matching form was prompted by some problems
 with indexing functions that take a variable number of indices in
 addition to x. (Think [-(x,i,value) vs. [-(x,i,j,value) and the
 hoops you have to jump through when the value gets passed in the j
 argument.) However, keyword matching of course implies that you need
 to use the matching keyword in the function definition.
 
 This *should* be somewhere in the R Language Definition, although I'm
 not sure it is actually there. Or the blue book, although I suspect
 that S v.3 actually used positional matching (and jumped through
 hoops).

It did.  This is in the FAQ, 3.2.3:

   * In R, the argument of a replacement function which corresponds to the
 right hand side must be named `value'.  E.g., `f(a) - b' is evaluated
 as `a - f-(a, value = b)'.  S always takes the last argument,
 irrespective of its name.

I seem to recall I discovered the discrepancy in ca 1998.

R-lang is minimalist about what it calls `assignment functions', most of 
the time.


-- 
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

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] Question

2004-04-09 Thread Ivan Yegorov
Could you please help me. How can I get indexes of matrix elements equal to the 
specified value. Thanks in advance.

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] looking for a tutorial on exception handling

2004-04-09 Thread Tamas Papp
Hi,

I would like to learn how to do exception handling in R.  I had a look
at the help page for tryCatch and I am trying to understand it (I am
sure it is well-written, but I have not used exception handling before
in any language, so I have no experience in that area).

Is there a tutorial or an introduction into exception handling in R
with tryCatch  friends?  Preferably with lots of examples.  It would
be nice if there was one online, but references to books would also be
appreciated.

Thanks,

Tamas

-- 
Tamás K. Papp
E-mail: [EMAIL PROTECTED]
Please try to send only (latin-2) plain text, not HTML or other garbage.

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] R-estimators

2004-04-09 Thread Paolo Radaelli
Dear all,
could you please suggest me the package I have to install in order to use ranks 
statistics in regression models (R-Estimators, wilcoxon scores ...)
Thanks and Happy Easter

Paolo Radaelli
[[alternative HTML version deleted]]

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] RODBC on FreeBSD 4.9

2004-04-09 Thread Charles and Kimberly Maner

Hello.  I have found a number of posts/threads on this subject and
remain unsuccessful to determine the solution.  In brief, my situation
is:

1.  Running FreeBSD 4.9 Stable in x86
2.  Installed, and running, R 1.8.1
3.  Installed, and running, postgreSQL 7.4.2
4.  Installed, and running, unixODBC 2.2.8
5.  Failed, repeatedly, to install RODBC.  The
following is my error log:

tsunami# R CMD INSTALL RODBC
* Installing *source* package 'RODBC' ...
checking for gcc... gcc
checking for C compiler default output... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler...
yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ANSI C... none
needed
checking for library containing SQLTables... no
configure: error: no ODBC driver manager found
ERROR: configuration failed for package 'RODBC'
** Removing '/usr/local/lib/R/library/RODBC'

I have set up the DSN/databases using ODBCConfig, viewed/confirmed
through DataManager and have even used isql to further confirm that all
is set up correctly.  I have read, numerous times, the README within
RODBC.  Unfortunately, I am out of ideas.  Therefore, I am asking for
ideas of others.

Also, I found, and employed, the results from a previous post,
https://stat.ethz.ch/pipermail/r-help/2001-October/014693.html, and
reset my LIBS and LD_LIBRARY_PATH to those suggested by the author.
Again, no joy.

So, any thoughts, with successful ones perhaps resulting in an
FAQ/how-to, would be most appreciated.

(Also, please let me know what more info you may need to help and I will
gladly provide it.)


Charles

[[alternative HTML version deleted]]

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] %+=% and eval.parent()

2004-04-09 Thread Peter Dalgaard
Prof Brian Ripley [EMAIL PROTECTED] writes:

  This *should* be somewhere in the R Language Definition, although I'm
  not sure it is actually there. Or the blue book, although I suspect
  that S v.3 actually used positional matching (and jumped through
  hoops).
 
 It did.  This is in the FAQ, 3.2.3:
 
* In R, the argument of a replacement function which corresponds to the
  right hand side must be named `value'.  E.g., `f(a) - b' is evaluated
  as `a - f-(a, value = b)'.  S always takes the last argument,
  irrespective of its name.
 
 I seem to recall I discovered the discrepancy in ca 1998.

I seem to recall when we introduced it, and that it was deliberate.
What I can't remember is what the occasion was.
 
 R-lang is minimalist about what it calls `assignment functions', most of 
 the time.

`replacement functions' would be correct terminology, right? - and
- are the assignment functions.

-- 
   O__   Peter Dalgaard Blegdamsvej 3  
  c/ /'_ --- Dept. of Biostatistics 2200 Cph. N   
 (*) \(*) -- University of Copenhagen   Denmark  Ph: (+45) 35327918
~~ - ([EMAIL PROTECTED]) FAX: (+45) 35327907

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] nlme on Windows 2000 (v1.8.1)

2004-04-09 Thread Kent Holsinger
Duncan Murdoch wrote:

On Thu, 08 Apr 2004 08:03:56 -0400, you wrote:


If I use Rterm, I can run analyses with NLME to my heart's content. But 
when I run Rgui, I encounter a floating point exception.

You do this by hitting F8 during the boot sequence.  R can
run fine in safe mode; if you don't get the error, then it's pretty
clearly one of the drivers that you usually load that is causing the
trouble.  Figuring out which one won't be easy...
It *is* one of my drivers. NLME works fine in safe mode. If/when I 
manage to find the offending driver I'll report it to the list. Thanks 
to you and Dr. Ripley for the advice. (As I suspected, the fault lies in 
my computers, not R.)

Kent

--
Kent E. Holsinger[EMAIL PROTECTED]
 http://darwin.eeb.uconn.edu
-- Department of Ecology  Evolutionary Biology
-- University of Connecticut, U-3043
-- Storrs, CT   06269-3043
__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] Cross-compiling packages for (ARM) Zaurus ideas and tips?

2004-04-09 Thread Simon Pickering
Hello All,

A bit of a long one (background mainly), this is really just a request
for some ideas.

I ported R 1.7.x for use on the Sharp Zaurus ( iPAQ, simpad, yopy,
etc.) some time ago and have just ported 1.8.1 but had never quite
realised that you actually need to install some packages to make the
system useful (I don't use R, I did it as a favour and of course for the
fun of it).

I use a GCC3.x cross compiler running on an x86 Linux box to do the
compilation. Packaging programs after they have been cross-compiled is a
pain in general (unfortunately you can't just run 'make install') but
normally it only has to be done once. However for the packages it's a
different matter, especially as I don't have enough space to host
compiled packages for everyone to access and in any case there'll always
be one that I've missed, etc. 

I'm thinking about creating a small native GCC for the Z (there are
already some out there, but they need to be GCC 3.x and need g77 neither
of which they currently have). My biggest concern here is that it'll use
quite a lot of space just to be able to create R packages occasionally.

The other method is for people to use a desktop cross compiler to
compile and package the resulting libraries. To this end I've been
looking at the INSTALL script in the hope of modifying it so that it
will compile and then create a .ipk package file (subset of debian .deb
file) which is the standard for the Zaurus. 

I've modified the INSTALL script quite heavily - to try and remove
extraneous env vars and reduce the number of external scripts which are
called, and to create the directory structure in a temp directory so I
can package it up. After battling with sed (steep learning curve there)
I temporarily gave up this morning trying to work out why shlib.mk can't
be found (despite, probably because of, my alterations). What do people
think, is this the best way to go about doing this? Would I be better
starting from scratch? Has anyone tried making a cross-compiler package
handling script before?

I actually thought that the INSTALL script would be fairly simple
(having seen the output when I INSTALLed a package on my desktop box)
but it doesn't seem quite so simple while I'm wading through it. My gut
feeling is that it probably is quite simple to do what I want (which is
only a very small subset of what the INSTALL script can do) and it's
just that there's so much extra in there. I was really just after a
quick (and dirty?) script to get up and running as soon as possible. I
presume the INSTALL script has developed from a more simple one? If so
are there any old (simple) copies lying about anywhere or has the
process changed?

Sorry for the rambling,

Cheers,


Simon


Simon Pickering MEng
Research Officer
Dept. of Engineering and Applied Science
University of Bath
Bath, BA2 7AY, UK

Tel: +44 (0)1225 383314
Fax: +44 (0)1225 386928

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


RE: [R] Question (on matrix indexes)

2004-04-09 Thread BXC (Bendix Carstensen)
I am not sure what you mean but you might be interested in the functions
row() and col().

Bendix Carstensen

--
Bendix Carstensen
Senior Statistician
Steno Diabetes Center
Niels Steensens Vej 2
DK-2820 Gentofte
Denmark
tel: +45 44 43 87 38
mob: +45 30 75 87 38
fax: +45 44 43 07 06
[EMAIL PROTECTED]
www.biostat.ku.dk/~bxc
--





 -Original Message-
 From: [EMAIL PROTECTED] 
 [mailto:[EMAIL PROTECTED] On Behalf Of Ivan Yegorov 
 Sent: Friday, April 09, 2004 1:56 PM
 To: [EMAIL PROTECTED]
 Subject: [R] Question
 
 
 Could you please help me. How can I get indexes of matrix 
 elements equal to the specified value. Thanks in advance.
 
 __
 [EMAIL PROTECTED] mailing list 
 https://www.stat.math.ethz.ch/mailman/listinfo/r-help
 PLEASE 
 do read the posting guide! http://www.R-project.org/posting-guide.html


__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] loess' robustness weights in loess

2004-04-09 Thread Rafael A. Irizarry
hi!

i want to change the robustness weights used by loess. these 
are described on page 316 of chambers and hastie's statistical models in S 
book as

r_i = B(e_i,6m)

where B is tukey's biweight function, e_i are the residulas, and m is the 
median average distance from 0 of the residuals. i want to 
change 6m to, say, 3m. 

is there a way to do this? i cant figure it out from the help files.

thanks,
rafael

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] loess' robustness weights in loess

2004-04-09 Thread Prof Brian Ripley
On Fri, 9 Apr 2004, Rafael A. Irizarry wrote:

 hi!
 
 i want to change the robustness weights used by loess. these 
 are described on page 316 of chambers and hastie's statistical models in S 
 book as
 
 r_i = B(e_i,6m)
 
 where B is tukey's biweight function, e_i are the residulas, and m is the 
 median average distance from 0 of the residuals. i want to 
 change 6m to, say, 3m. 
 
 is there a way to do this? i cant figure it out from the help files.

Well, they say loess in R is an interface to C/Fortran code, and not the
same code as the S code described in Chambers  Hastie.  I translated the 
C driver routines to R for some added flexibility.

At a quick look, in function simpleLoess() you will find the weights in
object `robust', calculated by Fortran function lowesw.  You could replace
that by a call to an R-level alternative, or play with the Fortran source
code.  You'll have to do what I did way back, and read the source code to
see how it works in detail.

-- 
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

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] question regarding vector ops

2004-04-09 Thread Rajarshi Guha
Hi,
  I was playing with some code and came upon this situation.

 x - c(1, rep(0,9))
 x
 [1] 1 0 0 0 0 0 0 0 0 0
 idx - 1:10
 x[idx] - x[idx] + 1
 x
 [1] 2 1 1 1 1 1 1 1 1 1

This is expected. But if I do:

 x - c(1, rep(0,9))
 x
 [1] 1 0 0 0 0 0 0 0 0 0
 idx - rep(0,10)
 idx
 [1] 0 0 0 0 0 0 0 0 0 0
 x[idx] - x[idx] +1
 x
 [1] 1 0 0 0 0 0 0 0 0 0

I was expoecting that when all the elements of idx are set to 0,
x[0] would become 11.

Could somebody explain why this behavior occurs?

Thanks,


---
Rajarshi Guha [EMAIL PROTECTED] http://jijo.cjb.net
GPG Fingerprint: 0CCA 8EE2 2EEB 25E2 AB04 06F7 1BB9 E634 9B87 56EE
---
A computer lets you make more mistakes faster than any other invention,
with the possible exceptions of handguns and Tequilla.
-- Mitch Ratcliffe

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] question regarding vector ops

2004-04-09 Thread Uwe Ligges
Rajarshi Guha wrote:

Hi,
  I was playing with some code and came upon this situation.

x - c(1, rep(0,9))
x
 [1] 1 0 0 0 0 0 0 0 0 0

idx - 1:10
x[idx] - x[idx] + 1
x
 [1] 2 1 1 1 1 1 1 1 1 1

This is expected. But if I do:


x - c(1, rep(0,9))
x
 [1] 1 0 0 0 0 0 0 0 0 0

idx - rep(0,10)
idx
 [1] 0 0 0 0 0 0 0 0 0 0

x[idx] - x[idx] +1
x
 [1] 1 0 0 0 0 0 0 0 0 0

I was expoecting that when all the elements of idx are set to 0,
x[0] would become 11.
Could somebody explain why this behavior occurs?


Why do you expect anything to become 11? And what is x[0] in your 
expectation?

x[0] is empty (indexing is starting from 1 in R) and returns 
numeric(0), hence
   x[0] - anything
consequently does nothing ... (alternatively, one might expect an error 
message).

Uwe Ligges




Thanks,

---
Rajarshi Guha [EMAIL PROTECTED] http://jijo.cjb.net
GPG Fingerprint: 0CCA 8EE2 2EEB 25E2 AB04 06F7 1BB9 E634 9B87 56EE
---
A computer lets you make more mistakes faster than any other invention,
with the possible exceptions of handguns and Tequilla.
-- Mitch Ratcliffe
__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] question regarding vector ops

2004-04-09 Thread Rajarshi Guha
On Fri, 2004-04-09 at 12:03, Rajarshi Guha wrote:
 Hi,
   I was playing with some code and came upon this situation.
 
  x - c(1, rep(0,9))
  x
  [1] 1 0 0 0 0 0 0 0 0 0
  idx - 1:10
  x[idx] - x[idx] + 1
  x
  [1] 2 1 1 1 1 1 1 1 1 1
 
 This is expected. But if I do:
 
  x - c(1, rep(0,9))
  x
  [1] 1 0 0 0 0 0 0 0 0 0
  idx - rep(0,10)
  idx
  [1] 0 0 0 0 0 0 0 0 0 0
  x[idx] - x[idx] +1
  x
  [1] 1 0 0 0 0 0 0 0 0 0

Aah, I realize that the second code snippet is not supposed to work.
What I meant was:

 x - c(1, rep(0,9))
 x
 [1] 1 0 0 0 0 0 0 0 0 0
 idx - rep(1,10)
idx
 [1] 1 1 1 1 1 1 1 1 1 1
 x[idx] - x[idx] + 1
 [1] 2 0 0 0 0 0 0 0 0 0

I expected that x would be

[1] 11 0 0 0 0 0 0 0 0 0

Or am I thinking about it wrong?

Thanks,

---
Rajarshi Guha [EMAIL PROTECTED] http://jijo.cjb.net
GPG Fingerprint: 0CCA 8EE2 2EEB 25E2 AB04 06F7 1BB9 E634 9B87 56EE
---
Disembowelling takes guts.

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] question regarding vector ops

2004-04-09 Thread Uwe Ligges
Rajarshi Guha wrote:
On Fri, 2004-04-09 at 12:03, Rajarshi Guha wrote:

Hi,
 I was playing with some code and came upon this situation.

x - c(1, rep(0,9))
x
[1] 1 0 0 0 0 0 0 0 0 0

idx - 1:10
x[idx] - x[idx] + 1
x
[1] 2 1 1 1 1 1 1 1 1 1

This is expected. But if I do:


x - c(1, rep(0,9))
x
[1] 1 0 0 0 0 0 0 0 0 0

idx - rep(0,10)
idx
[1] 0 0 0 0 0 0 0 0 0 0

x[idx] - x[idx] +1
x
[1] 1 0 0 0 0 0 0 0 0 0


Aah, I realize that the second code snippet is not supposed to work.
What I meant was:

x - c(1, rep(0,9))
x
 [1] 1 0 0 0 0 0 0 0 0 0

idx - rep(1,10)
idx
 [1] 1 1 1 1 1 1 1 1 1 1

x[idx] - x[idx] + 1
 [1] 2 0 0 0 0 0 0 0 0 0

I expected that x would be

[1] 11 0 0 0 0 0 0 0 0 0

Or am I thinking about it wrong?
Yes, you are wrong: You are indexing 10 times the first value. Writing 
10 times the same value 10 times into the same location does not sum it up.

Consider
 x[idx] - 1:10
Then you are writing 1 into x[1], 2 into x[1], 3 into x[1], ... and 
finally 10 into x[1], hence at the end x[1] is 10.

Uwe Ligges





Thanks,

---
Rajarshi Guha [EMAIL PROTECTED] http://jijo.cjb.net
GPG Fingerprint: 0CCA 8EE2 2EEB 25E2 AB04 06F7 1BB9 E634 9B87 56EE
---
Disembowelling takes guts.
__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] missing values for mda package

2004-04-09 Thread zhu wang
Thanks. I was able to use na.omit to remove NAs. But it seems to me this
kills one of the advantages of the original algorithm for handling
missing values.

On Tue, 2004-04-06 at 11:54, Uwe Ligges wrote:
 zhu wang wrote:
  
  Dear helpers,
  
  I am trying to use the mda package downloaded from the R website, but
  the data set has missing values so I got an error message. Should I
  manually handle these missing values? I was trying to read the documents
  to specify any option related to missing values, but I did not find it.
  Please forgive me if I ignore something obvious.
 
 If it is not documented (hence probably not available) and you don't
 know how to tell the functions to handle missing values, try to do it
 yourself. ?NA suggests:
 See Also: [...] 'na.action', 'na.omit', 'na.fail' on how methods can be
 tuned to deal with missing values.
 
 Uwe Ligges
 
 
 
  Thanks,
  
  Zhu Wang
  
  Statistical Science Department
  Southern Methodist University
  Dallas, TX 75275-0332
  Phone: (214)768-2453
  Fax: (214)768-4035
  Email: [EMAIL PROTECTED]
  
  __
  [EMAIL PROTECTED] mailing list
  https://www.stat.math.ethz.ch/mailman/listinfo/r-help
  PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
-- 
Zhu Wang

Statistical Science Department
Southern Methodist University
Dallas, TX 75275-0332
Phone: (214)768-2453
Fax: (214)768-4035
Email: [EMAIL PROTECTED]

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] rectangles without borders

2004-04-09 Thread Tamas Papp
Hi,

I want to draw rectangles with rect without borders, but with
shading (ie setting density).  ?rect says

 lty: line type for borders; defaults to 'solid'.

but if I set it to 0, the border disappears, but the shading also
vanishes!  But the above says that lty is the line type for BORDERS,
and does not mention density at all -- how do I get around this?

Thanks,

Tamas

-- 
Tamás K. Papp
E-mail: [EMAIL PROTECTED]
Please try to send only (latin-2) plain text, not HTML or other garbage.

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] missing values for mda package

2004-04-09 Thread Prof Brian Ripley
Package mda covers many things, including bruto, mars, polyreg and mda
itself.  Which `the original algorithm' for which option did you have in
mind?  More concretely, what where you trying to do with the package?

Given that the package is the original authors' own code, it seems
unlikely that they `killed one of the advantages' of their methodology, so 
elucidation is sorely needed.

On 9 Apr 2004, zhu wang wrote:

 Thanks. I was able to use na.omit to remove NAs. But it seems to me this
 kills one of the advantages of the original algorithm for handling
 missing values.
 
 On Tue, 2004-04-06 at 11:54, Uwe Ligges wrote:
  zhu wang wrote:
   
   Dear helpers,
   
   I am trying to use the mda package downloaded from the R website, but
   the data set has missing values so I got an error message. Should I
   manually handle these missing values? I was trying to read the documents
   to specify any option related to missing values, but I did not find it.
   Please forgive me if I ignore something obvious.
  
  If it is not documented (hence probably not available) and you don't
  know how to tell the functions to handle missing values, try to do it
  yourself. ?NA suggests:
  See Also: [...] 'na.action', 'na.omit', 'na.fail' on how methods can be
  tuned to deal with missing values.
  
  Uwe Ligges
  
  
  
   Thanks,
   
   Zhu Wang
   
   Statistical Science Department
   Southern Methodist University
   Dallas, TX 75275-0332
   Phone: (214)768-2453
   Fax: (214)768-4035
   Email: [EMAIL PROTECTED]
   
   __
   [EMAIL PROTECTED] mailing list
   https://www.stat.math.ethz.ch/mailman/listinfo/r-help
   PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
 

-- 
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

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] rectangles without borders

2004-04-09 Thread Prof Brian Ripley
The person who added shading did not update the help page for rect 

Try border=FALSE (and look at ?polygon for more details as to why).


On Fri, 9 Apr 2004, Tamas Papp wrote:

 Hi,
 
 I want to draw rectangles with rect without borders, but with
 shading (ie setting density).  ?rect says
 
  lty: line type for borders; defaults to 'solid'.
 
 but if I set it to 0, the border disappears, but the shading also
 vanishes!  But the above says that lty is the line type for BORDERS,
 and does not mention density at all -- how do I get around this?
 
 Thanks,
 
 Tamas
 
 

-- 
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

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


RE: [R] missing values for mda package

2004-04-09 Thread Wang, Zhu
I basically wanted to use MARS to reproduce results using the dataset Marketing in 
the following book 

http://www-stat-class.stanford.edu/~tibs/ElemStatLearn/

The authors actually provided S-Plus functions for mars, bruto ,etc. I used all 
default options of mars in R but there was an error due to NAs and I could not find 
any option to handle missing values. 

Zhu Wang 

-Original Message-
From:   Prof Brian Ripley [mailto:[EMAIL PROTECTED]
Sent:   Fri 4/9/2004 12:53 PM
To: Wang, Zhu
Cc: Uwe Ligges; [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject:Re: [R] missing values for mda package
Package mda covers many things, including bruto, mars, polyreg and mda
itself.  Which `the original algorithm' for which option did you have in
mind?  More concretely, what where you trying to do with the package?

Given that the package is the original authors' own code, it seems
unlikely that they `killed one of the advantages' of their methodology, so 
elucidation is sorely needed.

On 9 Apr 2004, zhu wang wrote:

 Thanks. I was able to use na.omit to remove NAs. But it seems to me this
 kills one of the advantages of the original algorithm for handling
 missing values.
 
 On Tue, 2004-04-06 at 11:54, Uwe Ligges wrote:
  zhu wang wrote:
   
   Dear helpers,
   
   I am trying to use the mda package downloaded from the R website, but
   the data set has missing values so I got an error message. Should I
   manually handle these missing values? I was trying to read the documents
   to specify any option related to missing values, but I did not find it.
   Please forgive me if I ignore something obvious.
  
  If it is not documented (hence probably not available) and you don't
  know how to tell the functions to handle missing values, try to do it
  yourself. ?NA suggests:
  See Also: [...] 'na.action', 'na.omit', 'na.fail' on how methods can be
  tuned to deal with missing values.
  
  Uwe Ligges
  
  
  
   Thanks,
   
   Zhu Wang
   
   Statistical Science Department
   Southern Methodist University
   Dallas, TX 75275-0332
   Phone: (214)768-2453
   Fax: (214)768-4035
   Email: [EMAIL PROTECTED]
   
   __
   [EMAIL PROTECTED] mailing list
   https://www.stat.math.ethz.ch/mailman/listinfo/r-help
   PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
 

-- 
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

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


RE: [R] missing values for MARS (was mda package)

2004-04-09 Thread Prof Brian Ripley
On Fri, 9 Apr 2004, Wang, Zhu wrote:

 I basically wanted to use MARS to reproduce results using the dataset
 Marketing in the following book
 
 http://www-stat-class.stanford.edu/~tibs/ElemStatLearn/
 
 The authors actually provided S-Plus functions for mars, bruto ,etc. I
 used all default options of mars in R but there was an error due to NAs
 and I could not find any option to handle missing values.

Friedman originated MARS and has code for it.  The code in mda by 
Hastie/Tibshirani is different, and the code on that website is a direct 
ancestor of the mda package for R.  I see no option in the code for mars 
there to handle missing values, so you would do better to ask the authors 
how they did it (if you really believe they have such an option).

And PLEASE read the posting guide and try to learn to ask precise
questions with enough background information!

-- 
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

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] Pfizer - Open position for Statistician - emphasis computational statistics

2004-04-09 Thread Romansky, Peg J
All:

The Nonclinical Statistics Group at Pfizer Inc., New London, CT, is
currently seeking a Statistician with an interest and experience in 
computational statistics.

Please use the following link for more information and application
information: 
If Interested please apply on-line at www.pfizer.com/are/careers/index.html
http://www.pfizer.com/are/careers/index.html and search for Job#
29Mar0428519.




Peg Romansky
PGRD
Staffing - Development
A2148 - NL
860-732-9675





LEGAL NOTICE\ Unless expressly stated otherwise, this messag...{{dropped}}

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] Regression models w/ splines

2004-04-09 Thread John Fieberg
Hi - I am fitting various Cox PH models with spline predictors.  After
fitting the model, I would like to use termplot() to examine the
functional form of the fitted model (e.g., to obtain a plot of the
relative risk (or log r.r.) versus the predictors). 

When there is only 1 predictor in the model, termplot returns a ?. 
In this case, I have not been able to figure out how to create the
desired plot.  Otherwise,termplot is easy to use. 

Example:
library(survival)
library(splines)

data(pbc)

fit1-coxph(Surv(time,status)~ns(bili,4)+ns(age,4), data=pbc)
fit2-coxph(Surv(time,status)~ns(bili,4), data=pbc)

par(mfrow=c(2,2))
termplot(fit1) # returns two plots (one for bili and one for age)
termplot(fit2) # returns a ? prompt

Does anyone have any suggestions for obtaining a plot of the log
relative risk as a function of bili in the second example (or for this
type of model in general)?

On a similar note, I would like to be able to obtain predicted values
for new subjects.  I tried using:

temp-data.frame(bili=0.8)
predict(fit2,newdata=temp, safe=T)

This gives the following error message:
Error in qr(t(const)) : NA/NaN/Inf in foreign function call (arg 1)

Is there a simple method available for obtaining predicted values for
new subjects when using these types of models?

I have encountered similar problems when trying to use smoothing
splines w/ the above examples (i.e., 'pspline' in the survival package).
 I am currently using R version 1.8.1 for windows. Any help would be
greatly appreciated!

John

John Fieberg, Ph.D.
Wildlife Biometrician, MN DNR
5463-C W. Broadway
Forest Lake, MN 55434
Phone: (651) 296-2704

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] Regression models w/ splines

2004-04-09 Thread Peter Dalgaard
John Fieberg [EMAIL PROTECTED] writes:

 Hi - I am fitting various Cox PH models with spline predictors.  After
 fitting the model, I would like to use termplot() to examine the
 functional form of the fitted model (e.g., to obtain a plot of the
 relative risk (or log r.r.) versus the predictors). 
 
 When there is only 1 predictor in the model, termplot returns a ?. 
 In this case, I have not been able to figure out how to create the
 desired plot.  Otherwise,termplot is easy to use. 

Kasper Hansen and Per Jensen from my department reported this
recently, AFAIR with a suggested fix. You might want to go over the
archives for the last month or so.

-- 
   O__   Peter Dalgaard Blegdamsvej 3  
  c/ /'_ --- Dept. of Biostatistics 2200 Cph. N   
 (*) \(*) -- University of Copenhagen   Denmark  Ph: (+45) 35327918
~~ - ([EMAIL PROTECTED]) FAX: (+45) 35327907

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] von Mises

2004-04-09 Thread MKG
Dear All,

I am trying to plot von Mises density on
the circle. One can use dvm function from the
CircStats package, by giving a set of angles,
mu and kappa to plot the circular density
on the line. Does any one have a macro that
does it on the circle? These plots are displayed
in Nick Fisher's book.
Any help will be appreciated.

Thanks,

G. Subramaniam

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] Regression models w/ splines

2004-04-09 Thread Frank E Harrell Jr
On Fri, 09 Apr 2004 15:16:34 -0500
John Fieberg [EMAIL PROTECTED] wrote:

 Hi - I am fitting various Cox PH models with spline predictors.  After
 fitting the model, I would like to use termplot() to examine the
 functional form of the fitted model (e.g., to obtain a plot of the
 relative risk (or log r.r.) versus the predictors). 

This kind of application is why the Design package was created.  It is
very easy to obtain such plots:

library(Design)
dd - datadist(mydata); options(datadist='dd')
f - cph(Surv(y,d) ~ sex*rcs(age,4)+rcs(bp,5))
plot(f, age=NA, sex='female')

---
Frank E Harrell Jr   Professor and Chair   School of Medicine
 Department of Biostatistics   Vanderbilt University

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] adding text in (pair) panels (splom)

2004-04-09 Thread Patrick Giraudoux
Hi,

I would like to add text in each panel got from the following:

splom(~Cs5bis,
panel=function(x,y,...){
panel.xyplot(x,y,...)
panel.abline(lm(y~x),...)
})

This could be a correlation coefficient or the statistical significance of the 
correlation or both, or a star if p  0.05, etc...
The function text() is useless (probably because I cannot pass appropriates 
coordinates in each panel). Googling the R-archives, I
have found only one hint of Andy Liaw relating a rather complex (to me) script within 
a home-made panel.myfitline() function.

Is there a simple way to add text in panels created eg with:

panel=function(x,y,...){
panel.xyplot(x,y,...)
panel.abline(lm(y~x),...)
})

?

Any hint appreciated,

Patrick Giraudoux

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] adding text in (pair) panels (splom)

2004-04-09 Thread Paul Murrell
Hi

Patrick Giraudoux wrote:
Hi,

I would like to add text in each panel got from the following:

splom(~Cs5bis,
panel=function(x,y,...){
panel.xyplot(x,y,...)
panel.abline(lm(y~x),...)
})
This could be a correlation coefficient or the statistical significance of the 
correlation or both, or a star if p  0.05, etc...
The function text() is useless (probably because I cannot pass appropriates 
coordinates in each panel). Googling the R-archives, I
have found only one hint of Andy Liaw relating a rather complex (to me) script within 
a home-made panel.myfitline() function.
Is there a simple way to add text in panels created eg with:

panel=function(x,y,...){
panel.xyplot(x,y,...)
panel.abline(lm(y~x),...)
})


text() is useless because splom is a lattice function and lattice is 
based on grid.  To add text in a panel you could use lattice's ltext(), 
but I think the best way would be to use grid.text() as below.  This 
example draws the correlation coefficient 1mm in from the top-left 
corner of the panel.

panel=function(x,y,...){
  panel.xyplot(x,y,...)
  panel.abline(lm(y~x),...)
  grid.text(round(cor(x, y), 2),
x=unit(1, mm), y=unit(1, npc) - unit(1, mm),
just=c(left, top))
})
Does that do what you want?

Paul
--
Dr Paul Murrell
Department of Statistics
The University of Auckland
Private Bag 92019
Auckland
New Zealand
64 9 3737599 x85392
[EMAIL PROTECTED]
http://www.stat.auckland.ac.nz/~paul/
__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] adding text in (pair) panels (splom)

2004-04-09 Thread Patrick Giraudoux
OK Paul and Kjetil

I understand that grid.text is part of the library grid. I have tried with Paul's 
arguments. It works perfectly well.

Thanks a lot both,

Patrick


- Original Message - 
From: Paul Murrell [EMAIL PROTECTED]
To: Patrick Giraudoux [EMAIL PROTECTED]
Cc: r-help [EMAIL PROTECTED]
Sent: Saturday, April 10, 2004 4:39 AM
Subject: Re: [R] adding text in (pair) panels (splom)


 Hi


 Patrick Giraudoux wrote:
  Hi,
 
  I would like to add text in each panel got from the following:
 
  splom(~Cs5bis,
  panel=function(x,y,...){
  panel.xyplot(x,y,...)
  panel.abline(lm(y~x),...)
  })
 
  This could be a correlation coefficient or the statistical significance of the 
  correlation or both, or a star if p  0.05,
etc...
  The function text() is useless (probably because I cannot pass appropriates 
  coordinates in each panel). Googling the R-archives,
I
  have found only one hint of Andy Liaw relating a rather complex (to me) script 
  within a home-made panel.myfitline() function.
 
  Is there a simple way to add text in panels created eg with:
 
  panel=function(x,y,...){
  panel.xyplot(x,y,...)
  panel.abline(lm(y~x),...)
  })


 text() is useless because splom is a lattice function and lattice is
 based on grid.  To add text in a panel you could use lattice's ltext(),
 but I think the best way would be to use grid.text() as below.  This
 example draws the correlation coefficient 1mm in from the top-left
 corner of the panel.


 panel=function(x,y,...){
   panel.xyplot(x,y,...)
   panel.abline(lm(y~x),...)
grid.text(round(cor(x, y), 2),
  x=unit(1, mm), y=unit(1, npc) - unit(1, mm),
  just=c(left, top))
 })

 Does that do what you want?

 Paul
 -- 
 Dr Paul Murrell
 Department of Statistics
 The University of Auckland
 Private Bag 92019
 Auckland
 New Zealand
 64 9 3737599 x85392
 [EMAIL PROTECTED]
 http://www.stat.auckland.ac.nz/~paul/

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] Density Estimation

2004-04-09 Thread Thami Rachidi
Dear Sir/Madam;
Would you please tell me what is the command that allows the estimation of the Kernel 
Density for some data.
Thanks,
Thami Rachidi
[[alternative HTML version deleted]]

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


RE: [R] Density Estimation

2004-04-09 Thread Ko-Kang Kevin Wang
 -Original Message-
 From: [EMAIL PROTECTED]

 Dear Sir/Madam;
 Would you please tell me what is the command that allows the
 estimation of the Kernel Density for some data.
 Thanks,

?density

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html