[R] Assistance with data import from Statistica

2004-02-01 Thread Steve Burgess
I am a new R user attempting to convert files from Statistica to R.  I
can export from Statistica to SPSS .por format, but not to the SPSS .sav
format.  Is there a procedure for easily accomplishing this, which will
allow me to keep variable short and long labels (big surveys LOTS of
time to replace all this work).
 
Many thanks for sharing your time and knowledge.
 
steve
 
Dr Steven M Burgess
Associate Director (Research)
Professor of Business Administration in Marketing
Graduate School of Business
University of Cape Town
Breakwater Campus, Portswood Road
Greenpoint, Cape Town 8001
South Africa 

Office:  Tel +27-21-406-1416, fax +27-21-406-1412
Mobile:  Tel +27-83-226-2811
Home:Tel +27-21-791-3423, fax +27-21-791-3425

Confidentiality: This e-mail message is for the sole use of the
intended recipient(s) and may contain confidential and privileged
information. Any unauthorised review, use, disclosure or distribution is
prohibited. If you are not the intended recipient, please contact the
sender by reply e-mail and destroy all copies of the original message. I
do not represent, warrant and/or guarantee that the integrity of this
communication has been maintained nor that the communication is free of
virus, interception or interference or errors caused by virus,
interception or interference.


[[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] Assistance with data import from Statistica

2004-02-01 Thread Christian Schulz
I'm never work with Stats but 
IMHO you find in library(foreign)  all what you need.

cheers,christian

Am Sonntag, 1. Februar 2004 09:39 schrieb Steve Burgess:
 I am a new R user attempting to convert files from Statistica to R.  I
 can export from Statistica to SPSS .por format, but not to the SPSS .sav
 format.  Is there a procedure for easily accomplishing this, which will
 allow me to keep variable short and long labels (big surveys LOTS of
 time to replace all this work).

 Many thanks for sharing your time and knowledge.

 steve

 Dr Steven M Burgess
 Associate Director (Research)
 Professor of Business Administration in Marketing
 Graduate School of Business
 University of Cape Town
 Breakwater Campus, Portswood Road
 Greenpoint, Cape Town 8001
 South Africa

 Office:  Tel +27-21-406-1416, fax +27-21-406-1412
 Mobile:  Tel +27-83-226-2811
 Home:Tel +27-21-791-3423, fax +27-21-791-3425

 Confidentiality: This e-mail message is for the sole use of the
 intended recipient(s) and may contain confidential and privileged
 information. Any unauthorised review, use, disclosure or distribution is
 prohibited. If you are not the intended recipient, please contact the
 sender by reply e-mail and destroy all copies of the original message. I
 do not represent, warrant and/or guarantee that the integrity of this
 communication has been maintained nor that the communication is free of
 virus, interception or interference or errors caused by virus,
 interception or interference.


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

__
[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] I can't make .C(...) web-page example.

2004-02-01 Thread Ricardo Zorzetto Nicoliello Vencio

Hi everyone!

I'm trying to lear how to call external C code in R but even the R help
web-page example is drive me crazy.

I copy-paste the example at:

http://stat.ethz.ch/R-manual/R-patched/doc/manual/R-exts.html#Interface%20functions%20.C%20and%20.Fortran

here is the example:

void convolve(double *a, int *na, double *b, int *nb, double *ab)
{
  int i, j, nab = *na + *nb - 1;

  for(i = 0; i  nab; i++)
ab[i] = 0.0;
  for(i = 0; i  *na; i++)
for(j = 0; j  *nb; j++)
  ab[i + j] += a[i] * b[j];
}

called from R by

conv - function(a, b)
  .C(convolve,
 as.double(a),
 as.integer(length(a)),
 as.double(b),
 as.integer(length(b)),
 ab = double(length(a) + length(b) - 1))$ab


but using the conv function in simple examples give me trouble:

 conv(1:10,2:11)
Error in conv(1:10, 2:11) : pairlist object cannot be coerced to double

 conv( rnorm(10,10,1) , rnorm(10,11,1) )
Segmentation fault

 conv( c(10.53, 8.456, 6.6) , c(10.53, 8.456, 6.6) )
Error in conv(c(10.53, 8.456, 6.6), c(10.53, 8.456, 6.6)) :
cannot allocate vector of length 1717986918

 a = c(1.46756, 5.56456, 2.3646)
 b = a + 5.4
 conv(a,b)
Error in conv(a, b) : cannot coerce type promise to double vector


and so on.

These results appear if I have only the .c file or if I use gcc -c conv.c
to create .o file. I cannot create executable because there is no
main(...) in .c file but just the copy-pasted example.


Someone knows what is happening to me ?

__
[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] coxph in R

2004-02-01 Thread Jim Clark
Where are the estimates of the baseline hazard in the output of coxph?

Thanks,
Jim
James S. Clark
H.L. Blomquist Professor
Department of Biology and Nicholas School of the Environment
Duke University
Durham, NC 27708
Biology: http://www.biology.duke.edu/research_by_area/eeob/clark.html
Center on Global Change: http://www.env.duke.edu/cgc/
Ecology Program: http://www.ecology.duke.edu/
__
[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] I can't make .C(...) web-page example.

2004-02-01 Thread Prof Brian Ripley
Change the name.  There is a convolve C function in R 1.8.x (but not
R-devel) that is being found rather than yours.


On Sun, 1 Feb 2004, Ricardo Zorzetto Nicoliello Vencio wrote:

 
 Hi everyone!
 
 I'm trying to lear how to call external C code in R but even the R help
 web-page example is drive me crazy.
 
 I copy-paste the example at:
 
 http://stat.ethz.ch/R-manual/R-patched/doc/manual/R-exts.html#Interface%20functions%20.C%20and%20.Fortran
 
 here is the example:
 
 void convolve(double *a, int *na, double *b, int *nb, double *ab)
 {
   int i, j, nab = *na + *nb - 1;
 
   for(i = 0; i  nab; i++)
 ab[i] = 0.0;
   for(i = 0; i  *na; i++)
 for(j = 0; j  *nb; j++)
   ab[i + j] += a[i] * b[j];
 }
 
 called from R by
 
 conv - function(a, b)
   .C(convolve,
  as.double(a),
  as.integer(length(a)),
  as.double(b),
  as.integer(length(b)),
  ab = double(length(a) + length(b) - 1))$ab
 
 
 but using the conv function in simple examples give me trouble:
 
  conv(1:10,2:11)
 Error in conv(1:10, 2:11) : pairlist object cannot be coerced to double
 
  conv( rnorm(10,10,1) , rnorm(10,11,1) )
 Segmentation fault
 
  conv( c(10.53, 8.456, 6.6) , c(10.53, 8.456, 6.6) )
 Error in conv(c(10.53, 8.456, 6.6), c(10.53, 8.456, 6.6)) :
 cannot allocate vector of length 1717986918
 
  a = c(1.46756, 5.56456, 2.3646)
  b = a + 5.4
  conv(a,b)
 Error in conv(a, b) : cannot coerce type promise to double vector
 
 
 and so on.
 
 These results appear if I have only the .c file or if I use gcc -c conv.c
 to create .o file. I cannot create executable because there is no
 main(...) in .c file but just the copy-pasted example.
 
 
 Someone knows what is happening to me ?
 
 __
 [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


[R] coxph

2004-02-01 Thread Jim Clark
Where are the estimates of the baseline hazard for coxph?

Thanks,
Jim
James S. Clark
H.L. Blomquist Professor
Department of Biology and Nicholas School of the Environment
Duke University
Durham, NC 27708
Biology: http://www.biology.duke.edu/research_by_area/eeob/clark.html
Center on Global Change: http://www.env.duke.edu/cgc/
Ecology Program: http://www.ecology.duke.edu/
__
[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] I can't make .C(...) web-page example.

2004-02-01 Thread Rau, Roland
Hi!

I am by no means an R-expert nor a C-expert but the document An
Introduction to .C Interface to R by Roger D. Peng and  Jan de Leeuw helped
me a lot to find out how it works in principle to use the .C function call.
You can find it on the homepage of Roger D. Peng
(http://www.biostat.jhsph.edu/~rpeng/ ) at the following URL:
http://www.biostat.jhsph.edu/~rpeng/docs/interface.pdf


Hope this is what you were looking for.

Best,
Roland


 -Original Message-
 From: Ricardo Zorzetto Nicoliello Vencio [SMTP:[EMAIL PROTECTED]
 Sent: Sunday, February 01, 2004 3:56 PM
 To:   [EMAIL PROTECTED]
 Subject:  [R] I can't make .C(...) web-page example.
 
 
 Hi everyone!
 
 I'm trying to lear how to call external C code in R but even the R help
 web-page example is drive me crazy.
 
 I copy-paste the example at:
 
 http://stat.ethz.ch/R-manual/R-patched/doc/manual/R-exts.html#Interface%20
 functions%20.C%20and%20.Fortran
 
 here is the example:
 
 void convolve(double *a, int *na, double *b, int *nb, double *ab)
 {
   int i, j, nab = *na + *nb - 1;
 
   for(i = 0; i  nab; i++)
 ab[i] = 0.0;
   for(i = 0; i  *na; i++)
 for(j = 0; j  *nb; j++)
   ab[i + j] += a[i] * b[j];
 }
 
 called from R by
 
 conv - function(a, b)
   .C(convolve,
  as.double(a),
  as.integer(length(a)),
  as.double(b),
  as.integer(length(b)),
  ab = double(length(a) + length(b) - 1))$ab
 
 
 but using the conv function in simple examples give me trouble:
 
  conv(1:10,2:11)
 Error in conv(1:10, 2:11) : pairlist object cannot be coerced to double
 
  conv( rnorm(10,10,1) , rnorm(10,11,1) )
 Segmentation fault
 
  conv( c(10.53, 8.456, 6.6) , c(10.53, 8.456, 6.6) )
 Error in conv(c(10.53, 8.456, 6.6), c(10.53, 8.456, 6.6)) :
 cannot allocate vector of length 1717986918
 
  a = c(1.46756, 5.56456, 2.3646)
  b = a + 5.4
  conv(a,b)
 Error in conv(a, b) : cannot coerce type promise to double vector
 
 
 and so on.
 
 These results appear if I have only the .c file or if I use gcc -c conv.c
 to create .o file. I cannot create executable because there is no
 main(...) in .c file but just the copy-pasted example.
 
 
 Someone knows what is happening to me ?
 
 __
 [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


+
This mail has been sent through the MPI for Demographic Research.  Should you receive 
a mail that is apparently from a MPI user without this text displayed, then the 
address has most likely been faked.   If you are uncertain about the validity of this 
message, please check the mail header or ask your system administrator for assistance.

__
[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] I can't make .C(...) web-page example.

2004-02-01 Thread Uwe Ligges
Ricardo Zorzetto Nicoliello Vencio wrote:

Hi everyone!

I'm trying to lear how to call external C code in R but even the R help
web-page example is drive me crazy.
I copy-paste the example at:

http://stat.ethz.ch/R-manual/R-patched/doc/manual/R-exts.html#Interface%20functions%20.C%20and%20.Fortran

here is the example:

void convolve(double *a, int *na, double *b, int *nb, double *ab)
{
  int i, j, nab = *na + *nb - 1;
  for(i = 0; i  nab; i++)
ab[i] = 0.0;
  for(i = 0; i  *na; i++)
for(j = 0; j  *nb; j++)
  ab[i + j] += a[i] * b[j];
}
called from R by

conv - function(a, b)
  .C(convolve,
 as.double(a),
 as.integer(length(a)),
 as.double(b),
 as.integer(length(b)),
 ab = double(length(a) + length(b) - 1))$ab
but using the conv function in simple examples give me trouble:

conv(1:10,2:11)

Error in conv(1:10, 2:11) : pairlist object cannot be coerced to double


conv( rnorm(10,10,1) , rnorm(10,11,1) )
Segmentation fault


conv( c(10.53, 8.456, 6.6) , c(10.53, 8.456, 6.6) )
Error in conv(c(10.53, 8.456, 6.6), c(10.53, 8.456, 6.6)) :
cannot allocate vector of length 1717986918

a = c(1.46756, 5.56456, 2.3646)
b = a + 5.4
conv(a,b)
Error in conv(a, b) : cannot coerce type promise to double vector

and so on.

These results appear if I have only the .c file or if I use gcc -c conv.c
to create .o file. I cannot create executable because there is no
main(...) in .c file but just the copy-pasted example.
Most easily, use the R wrapper to compile and link files as in:

R CMD SHLIB convolve.c
which produces an .so file you can dyn.load().
(If you are on Windows: Rcmd SHLIB makes a dll.)
Uwe Ligges


Someone knows what is happening to me ?

__
[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] CART: rapart vs bagging

2004-02-01 Thread Qin Liu
Hi, 

Is here anyone knows the difference between rapart and bagging when grow a
CART tree? 

Thanks

Qin

__
[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] 3 little questions

2004-02-01 Thread Siegfried.Macho
Dear R-helpers,

3 questions:
1. Is there a package that contains a routine for computing Kendall's W 
(coefficient of concordance), with and without ties ?
2. Is there a package that contains a routine for computing Goodman' s Gamma.
3. I there a simple method for computing the number of ties as well as 
their lengths within a vector fo ranks,
e.g.
r1 - rank(c(1, 3, 2, 3, 3, 2, 4))

gives:

[1] 1.0 5.0 2.5 5.0 5.0 2.5 7.0

which contains 2 ties with length 2 and 3.

Thanks in advance,
S.M
==
Dr. Siegfried Macho
Department of Psychology
University of Fribourg
Rue de Faucigny 2
CH-1700 Fribourg
Tel.: +41-26-3007635
Fax.: +41-26-3009712
http://www.unifr.ch/psycho/general/macho.htm
__
[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] I can't make .C(...) web-page example.

2004-02-01 Thread Peter Dalgaard
Ricardo Zorzetto Nicoliello Vencio [EMAIL PROTECTED] writes:

 Hi everyone!
 
 I'm trying to lear how to call external C code in R but even the R help
 web-page example is drive me crazy.
 
 I copy-paste the example at:
 
 http://stat.ethz.ch/R-manual/R-patched/doc/manual/R-exts.html#Interface%20functions%20.C%20and%20.Fortran
 
 here is the example:
 
 void convolve(double *a, int *na, double *b, int *nb, double *ab)
 {
   int i, j, nab = *na + *nb - 1;
 
   for(i = 0; i  nab; i++)
 ab[i] = 0.0;
   for(i = 0; i  *na; i++)
 for(j = 0; j  *nb; j++)
   ab[i + j] += a[i] * b[j];
 }
 
 called from R by
 
 conv - function(a, b)
   .C(convolve,
  as.double(a),
  as.integer(length(a)),
  as.double(b),
  as.integer(length(b)),
  ab = double(length(a) + length(b) - 1))$ab
 
 
 but using the conv function in simple examples give me trouble:
 
  conv(1:10,2:11)
 Error in conv(1:10, 2:11) : pairlist object cannot be coerced to double
 
  conv( rnorm(10,10,1) , rnorm(10,11,1) )
 Segmentation fault
 
  conv( c(10.53, 8.456, 6.6) , c(10.53, 8.456, 6.6) )
 Error in conv(c(10.53, 8.456, 6.6), c(10.53, 8.456, 6.6)) :
 cannot allocate vector of length 1717986918
 
  a = c(1.46756, 5.56456, 2.3646)
  b = a + 5.4
  conv(a,b)
 Error in conv(a, b) : cannot coerce type promise to double vector
 
 
 and so on.
 
 These results appear if I have only the .c file or if I use gcc -c conv.c
 to create .o file. I cannot create executable because there is no
 main(...) in .c file but just the copy-pasted example.
 
 
 Someone knows what is happening to me ?

Looks like you haven't quite understood how to generate a shared
library (R CMD SHLIB) and load it dynamically (dyn.load), and then
somehow pick up a different convolve entry point (doesn't seem
possible with Linux, but you're not tellig us what your system is...).
Either that or you managed to confuse R badly through some earlier
attempts to load the module.

-- 
   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] coxph in R

2004-02-01 Thread Prof Brian Ripley
Nowhere.  They are not in Cox's (1972) paper either!  (One place is in the 
discussion of that paper, but the point is that they are an orthogonal 
concept to partial likelihood estimation of the coefficients.)

You use survfit() on a coxph fit object to compute them.

On Sun, 1 Feb 2004, Jim Clark wrote:

 Where are the estimates of the baseline hazard in the output of coxph?
 
 Thanks,
 Jim
 
 
 James S. Clark
 H.L. Blomquist Professor
 Department of Biology and Nicholas School of the Environment
 Duke University
 Durham, NC 27708
 Biology: http://www.biology.duke.edu/research_by_area/eeob/clark.html
 Center on Global Change: http://www.env.duke.edu/cgc/
 Ecology Program: http://www.ecology.duke.edu/

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

2004-02-01 Thread Peter Dalgaard
Jim Clark [EMAIL PROTECTED] writes:

[twice...]
 Where are the estimates of the baseline hazard for coxph?

That's not an estimable quantity. However, estimates of the integrated
hazard or the survival function can be obtained with basehaz(fit)
resp. survfit(fit).
-- 
   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] I can't make .C(...) web-page example.

2004-02-01 Thread Prof Brian Ripley
On 1 Feb 2004, Peter Dalgaard wrote:

 Ricardo Zorzetto Nicoliello Vencio [EMAIL PROTECTED] writes:
 
  Hi everyone!
  
  I'm trying to lear how to call external C code in R but even the R help
  web-page example is drive me crazy.
  
  I copy-paste the example at:
  
  http://stat.ethz.ch/R-manual/R-patched/doc/manual/R-exts.html#Interface%20functions%20.C%20and%20.Fortran
  
  here is the example:
  
  void convolve(double *a, int *na, double *b, int *nb, double *ab)
  {
int i, j, nab = *na + *nb - 1;
  
for(i = 0; i  nab; i++)
  ab[i] = 0.0;
for(i = 0; i  *na; i++)
  for(j = 0; j  *nb; j++)
ab[i + j] += a[i] * b[j];
  }
  
  called from R by
  
  conv - function(a, b)
.C(convolve,
   as.double(a),
   as.integer(length(a)),
   as.double(b),
   as.integer(length(b)),
   ab = double(length(a) + length(b) - 1))$ab
  
  
  but using the conv function in simple examples give me trouble:
  
   conv(1:10,2:11)
  Error in conv(1:10, 2:11) : pairlist object cannot be coerced to double
  
   conv( rnorm(10,10,1) , rnorm(10,11,1) )
  Segmentation fault
  
   conv( c(10.53, 8.456, 6.6) , c(10.53, 8.456, 6.6) )
  Error in conv(c(10.53, 8.456, 6.6), c(10.53, 8.456, 6.6)) :
  cannot allocate vector of length 1717986918
  
   a = c(1.46756, 5.56456, 2.3646)
   b = a + 5.4
   conv(a,b)
  Error in conv(a, b) : cannot coerce type promise to double vector
  
  
  and so on.
  
  These results appear if I have only the .c file or if I use gcc -c conv.c
  to create .o file. I cannot create executable because there is no
  main(...) in .c file but just the copy-pasted example.
  
  
  Someone knows what is happening to me ?
 
 Looks like you haven't quite understood how to generate a shared
 library (R CMD SHLIB) and load it dynamically (dyn.load), and then
 somehow pick up a different convolve entry point (doesn't seem
 possible with Linux, but you're not tellig us what your system is...).
 Either that or you managed to confuse R badly through some earlier
 attempts to load the module.

There is an entry point convolve in package ts which is nowadays loaded by
default.  A week or so ago that one was being found under Windows even
after dynamically loading convolve.dll, so I renamed it in R-devel.  I got
the first error message listed above with that example.

If you try another name (convolve1, for example) it should either work or 
report that the symbol cannot be found, hence my suggestion to use another 
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

__
[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] coxph

2004-02-01 Thread Prof Brian Ripley
On 1 Feb 2004, Peter Dalgaard wrote:

 Jim Clark [EMAIL PROTECTED] writes:
 
 [twice...]
  Where are the estimates of the baseline hazard for coxph?
 
 That's not an estimable quantity. However, estimates of the integrated
 hazard or the survival function can be obtained with basehaz(fit)
 resp. survfit(fit).

Not estimable?  Well, neither is the cumulative hazard/survival fnction 
then, as you only get estimates at the event times.

In both cases you need further assumptions on the hazard, which can be
smoothness or sum of delta functions or   

-- 
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] CART: rapart vs bagging

2004-02-01 Thread Prof Brian Ripley
On Sun, 1 Feb 2004, Qin Liu wrote:

 Is here anyone knows the difference between rapart and bagging when grow a
 CART tree? 

Short answer: `Yes'.

Slightly longer answer: `rapart classification tree' is not something
Google knows about, and bagging is not to do with `grow a tree'.

More informative answer:

Bagging is a method to combine ensembles of classification trees, and
*rpart* is a package in R which does grow and prune classification trees.

CART is the trademark of a commercial program to grow and prune
classification trees.

Put `bagging Breiman' into Google to help you with the concept of bagging,
and then look at package ipred.

-- 
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] interactive 2-D plot interrogation

2004-02-01 Thread Charles Annis, P.E.
Greetings Friends:

I am trying to find a widget or some other method to let me interrogate a 
2-D image using the mouse.  I have a data.frame that I can visualize using
image() in R.  I would like to point to a pixel and have its coordinates
displayed.

I've read Peter Dalgaard's primer on R-Tcl/Tk, R-News, 1(3):27-31, and his
update R-News2(3):25-27, but am still struggling. 

Can anyone suggest a method for interactively interrogating of a 2-D image?

Many thanks.

Charles Annis, P.E.
 
[EMAIL PROTECTED]
phone: 561-352-9699
eFax:  503-217-4849
http://www.StatisticalEngineering.com

__
[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] Stepwise Regression and PLS

2004-02-01 Thread Jinsong Zhao
Dear all,

I am a newcomer to R. I intend to using R to do
stepwise regression and PLS with a data set (a 55x20
matrix, with one dependent and 19 independent
variable). Based on the same data set, I have done the
same work using SPSS and SAS. However, there is much
difference between the results obtained by R and SPSS
or SAS.

In the case of stepwise, SPSS gave out a model with 4
independent variable, but with step(), R gave out a
model with 10 and much higher R2. Furthermore,
regsubsets() also indicate the 10 variable is one of
the best regression subset. How to explain this
difference? And in the case of my data set, how many
variables that enter the model would be reasonable?

In the case of PLS, the results of mvr function of
pls.pcr package is also different with that of SAS.
Although the number of optimum latent variables is
same, the difference between R2 is much large. Why?

Any comment and suggestion is very appreciated. Thanks
in advance!

Best wishes,

Jinsong Zhao


=
(Mr.) Jinsong Zhao
Ph.D. Candidate
School of the Environment
Nanjing University
22 Hankou Road, Nanjing 210093
P.R. China
E-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] Stepwise Regression and PLS

2004-02-01 Thread Frank E Harrell Jr
On Sun, 1 Feb 2004 11:09:28 -0800 (PST)
Jinsong Zhao [EMAIL PROTECTED] wrote:

 Dear all,
 
 I am a newcomer to R. I intend to using R to do
 stepwise regression and PLS with a data set (a 55x20
 matrix, with one dependent and 19 independent
 variable). Based on the same data set, I have done the
 same work using SPSS and SAS. However, there is much
 difference between the results obtained by R and SPSS
 or SAS.
 
 In the case of stepwise, SPSS gave out a model with 4
 independent variable, but with step(), R gave out a
 model with 10 and much higher R2. Furthermore,
 regsubsets() also indicate the 10 variable is one of
 the best regression subset. How to explain this
 difference? And in the case of my data set, how many
 variables that enter the model would be reasonable?
 
 In the case of PLS, the results of mvr function of
 pls.pcr package is also different with that of SAS.
 Although the number of optimum latent variables is
 same, the difference between R2 is much large. Why?
 
 Any comment and suggestion is very appreciated. Thanks
 in advance!
 
 Best wishes,
 
 Jinsong Zhao
 

In your case SPSS, SAS, R, S-Plus, Stata, Systat, Statistica, and every
other package will agree in one sense, because results from all of them
will be virtually meaningless.  Simulate some data from a known model and
you'll quickly find out why stepwise variable selection is often a train
wreck.

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


Re: [R] coxph

2004-02-01 Thread Peter Dalgaard
Prof Brian Ripley [EMAIL PROTECTED] writes:

 On 1 Feb 2004, Peter Dalgaard wrote:
 
  Jim Clark [EMAIL PROTECTED] writes:
  
  [twice...]
   Where are the estimates of the baseline hazard for coxph?
  
  That's not an estimable quantity. However, estimates of the integrated
  hazard or the survival function can be obtained with basehaz(fit)
  resp. survfit(fit).
 
 Not estimable?  Well, neither is the cumulative hazard/survival fnction 
 then, as you only get estimates at the event times.
 
 In both cases you need further assumptions on the hazard, which can be
 smoothness or sum of delta functions or   

Well This *is* quibbling you know. 

The relation is basically the same as with densities and distribution
functions. 

You can of course, if you want to, define the estimated hazard as a
sum of delta functions. However, it won't converge to the true hazard
function in any of the standard senses as n increases (although it
will in the distribution sense, but that is basically the point of
saying that its indefinite integral is estimable).

In contrast, you can define the integrated hazard function by
extending the value at event times as a right-continuous step function
and it will converge pointwise under relatively mild conditions (the
censoring mechanism cannot be too harsh and the regressors should
behave sensibly).

-- 
   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] lines in 3d-cloud plot (lattice)

2004-02-01 Thread Paul Murrell
Hi

Staying with Trellis graphics, and depending on what sort of lines you 
want to add, you could do something similar to persp() example # 2 using 
cloud() by writing your own panel.3d.cloud() function, which calls 
panel.3dscatter() and then does some further drawing.  This is an 
analogue to the sequence plot(), followed by points() or
lines() in the base plotting functions, all done within a lattice panel 
function.  From a quick look at help(panel.cloud) it looks like the 
required transformation information is available via something like 
ltransform3dto3d().

Paul

Tom Blackwell wrote:
Pascal  -

Getting away from Trellis graphics, you might consider using
persp() with regular graphics.  Look at example # 2 under
help(persp).
-  tom blackwell  -  u michigan medical school  -  ann arbor  -

On Fri, 30 Jan 2004, Deepayan Sarkar wrote:


On Friday 30 January 2004 06:13, Pascal A. Niklaus wrote:

Hi all,

I'd like to plot a set of data (x,y,z) as 3D-cloud, and add several line
plots to the same 3D graph:
Two questions:

1) How do I connect points to get a line?


cloud(z~x*y,data=d,zlim=c(0,1))# works
cloud(z~x*predict(l),data=d,zlim=c(0,1),type=l)   # type=l doesn't
Warning message:
type = l not implemented, consider using 'panel.3d.cloud =
panel.3dscatter.old' in: panel.3d.cloud(x = x, y = y, z = z, rot.mat =
rot.mat, za = za,
Well, have you considered taking the hint and try

cloud(z~x*predict(l),data=d,zlim=c(0,1),type=l,
 panel.3d.cloud = panel.3dscatter.old)
?


help.search(panel.3d.cloud) also didn't report any hits.
panel.3d.cloud is the name of an argument to the panel.cloud function.
See ?panel.cloud for details. (Unfortunately, the docs are a bit outdated).
Briefly, panel.3dscatter.old is a very simple function, that calculates the 2D
projections of the given 3D points and then calls panel.xyplot with those.
Any 'type' argument which works with panel.xyplot would also work here,
including 'p' and 'l'. But no consideration is made of the fact that these
are 3D data. For instance, type = 'h' would not give you what you would
expect.
panel.3dscatter (the newer version) is a bit more sophisticated. For type =
'p', it draws the points in order of increasing depth, so that closer points
overwrite distant ones. Unfortunately, a collection of line segments is not
well ordered, and I haven't decided yet what to do in that case (which is why
the older version is still retained).


2) How do I superimpose a second data set onto the same graph?

(something equivalent to the sequence plot(), followed by points() or
lines() in the base plotting functions)


I'm not sure what you mean. Trellis plots are not supposed to be used for two
unrelated data sets, they are typically very much dependent on the structure
of the data set. Maybe we could help if you give more details of what exactly
you want to do, but before that you should read the ?panel.cloud help page
carefully, since anything 'special' would almost invariably involve playing
with things documented there.
Hth,

Deepayan

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


--
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] interactive 2-D plot interrogation

2004-02-01 Thread Paul Murrell
Hi

Depending on how you want the coordinates displayed, the locator() 
function may help you, or perhaps a simple function written around 
locator() to process its result into something more meaningful for your 
siutation.

Paul

Dirk Eddelbuettel wrote:
On Sun, Feb 01, 2004 at 01:53:14PM -0500, Charles Annis, P.E. wrote:

Greetings Friends:

I am trying to find a widget or some other method to let me interrogate a 
2-D image using the mouse.  I have a data.frame that I can visualize using
image() in R.  I would like to point to a pixel and have its coordinates
displayed.

I've read Peter Dalgaard's primer on R-Tcl/Tk, R-News, 1(3):27-31, and his
update R-News2(3):25-27, but am still struggling. 

Can anyone suggest a method for interactively interrogating of a 2-D image?


Look at the InteractiveTkrPlot example on James Wettenhall's site:
http://bioinf.wehi.edu.au/~wettenhall/RTclTkExamples/InteractiveTkrPlot.html
His example is over discrete set of points, which you can adapt to find the
location with respect to curves or lines (which I did at work, where I can't
get to right now).
The key is that the 'widget' you bind to an event (like left-Mouse in his
example) get (x,y) pixel coordinates from the system which given appropriate
information from par() can be translated into your data coordinates in just
a few steps.
James' site is a treasure chest for R and tcltk. Highly recommended.

Hope this helps, Dirk



--
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] How to plot a small figure in a bigger one???

2004-02-01 Thread Paul Murrell
Hi

jzhang10 wrote:
Hi,
I want to insert a small figure into a bigger plot. I saw people are doing 
this all the time, but I just could not figure out how to do it in R.
Thanks for your help!
Jinfeng Zhang


There are a number of ways to do this in R;  some pointers to get you 
started ...

(i)  par(new=TRUE) allows you to overlay several plots on the same page
(ii) par(fig) and par(plt) provide fine control over where a plot 
appears on a page
(iii) accurately locating subplots within a bigger plot may require some 
conversions between coordinate systems;  par(usr), par(plt), ... can 
be used to obtain information on current coordinate systems
(iv) you can have all the transformations done for you, by using the 
grid package to create viewports and the gridBase package to align them 
with a bigger plot - see the recent R News article Integrating grid 
Graphics Output with Base Graphics Output 
(http://cran.stat.auckland.ac.nz/doc/Rnews/Rnews_2003-2.pdf)

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] Virus vers expéditeur

2004-02-01 Thread server
Votre message : hi destiné à [EMAIL PROTECTED]
 contenait un virus.

__
[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] print comment lines on `sink'ed files?

2004-02-01 Thread SI
Hi,
(B
(BI am using many comment lines like this
(B#   a comment line
(Bin a script.  Is there any way to print
(Bcomment lines when I use sink() function?
(BOr, are there any plans to include as
(Ban option to sink() function in the near
(Bfuture?  I would not want to use cat() 
(Bfunction as it will look messy in the 
(Boriginal script file.
(B
(BThanks!
(B
(BSI
(B
(B__
(BDo You Yahoo!?
(BYahoo! BB is Broadband by Yahoo!
(Bhttp://bb.yahoo.co.jp/
(B
(B__
(B[EMAIL PROTECTED] mailing list
(Bhttps://www.stat.math.ethz.ch/mailman/listinfo/r-help
(BPLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

RE: [R] 3 little questions

2004-02-01 Thread Gabor Grothendieck


See ?cor.test
Also, 

  rowSums(outer(unique(r1),r1,==))

gives the number of occurrences of the elements of unique(r1)

---
Date:   Sun, 01 Feb 2004 16:53:21 -0800 
From:   Siegfried.Macho [EMAIL PROTECTED]
To:   [EMAIL PROTECTED] 
Subject:   [R] 3 little questions 

 
Dear R-helpers,

3 questions:
1. Is there a package that contains a routine for computing Kendall's W 
(coefficient of concordance), with and without ties ?
2. Is there a package that contains a routine for computing Goodman' s Gamma.
3. I there a simple method for computing the number of ties as well as 
their lengths within a vector fo ranks,
e.g.
r1 - rank(c(1, 3, 2, 3, 3, 2, 4))

gives:

[1] 1.0 5.0 2.5 5.0 5.0 2.5 7.0

which contains 2 ties with length 2 and 3.

Thanks in advance,
S.M


==
Dr. Siegfried Macho
Department of Psychology
University of Fribourg
Rue de Faucigny 2
CH-1700 Fribourg

__
[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] Stepwise Regression and PLS

2004-02-01 Thread Jinsong Zhao

--- Frank E Harrell Jr [EMAIL PROTECTED] wrote:
 On Sun, 1 Feb 2004 11:09:28 -0800 (PST)
 Jinsong Zhao [EMAIL PROTECTED] wrote:
 
  Dear all,
  
  I am a newcomer to R. I intend to using R to do
  stepwise regression and PLS with a data set (a
 55x20
  matrix, with one dependent and 19 independent
  variable). Based on the same data set, I have done
 the
  same work using SPSS and SAS. However, there is
 much
  difference between the results obtained by R and
 SPSS
  or SAS.
  
  In the case of stepwise, SPSS gave out a model
 with 4
  independent variable, but with step(), R gave out
 a
  model with 10 and much higher R2. Furthermore,
  regsubsets() also indicate the 10 variable is one
 of
  the best regression subset. How to explain this
  difference? And in the case of my data set, how
 many
  variables that enter the model would be
 reasonable?
  
  In the case of PLS, the results of mvr function of
  pls.pcr package is also different with that of
 SAS.
  Although the number of optimum latent variables is
  same, the difference between R2 is much large.
 Why?
  
  Any comment and suggestion is very appreciated.
 Thanks
  in advance!
  
  Best wishes,
  
  Jinsong Zhao
  
 
 In your case SPSS, SAS, R, S-Plus, Stata, Systat,
 Statistica, and every
 other package will agree in one sense, because
 results from all of them
 will be virtually meaningless.  Simulate some data
 from a known model and
 you'll quickly find out why stepwise variable
 selection is often a train
 wreck.
 
 ---
 Frank E Harrell Jr   Professor and Chair  
 School of Medicine
  Department of Biostatistics  
 Vanderbilt University

For the case of stepwise regression, I have found that
the subsets I got using regsubsets() are collinear.
However, the variables in SPSS's result are not
collinear. I wonder what I should do to get a same or
better linear model.

Thanks!

__
[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] Stepwise Regression and PLS

2004-02-01 Thread Jinsong Zhao

--- Frank E Harrell Jr [EMAIL PROTECTED] wrote:
  
  For the case of stepwise regression, I have found
 that
  the subsets I got using regsubsets() are
 collinear.
  However, the variables in SPSS's result are not
  collinear. I wonder what I should do to get a same
 or
  better linear model.
 
 I think you missed the point.  None of the variable
 selection procedures
 will provide results that have a fair probability of
 replicating in
 another sample.
 
 FH
 ---
 Frank E Harrell Jr   Professor and Chair  
 School of Medicine
  Department of Biostatistics  
 Vanderbilt University

Do you mean different procedures will provide
different results? Maybe I don't understand your email
correctly. Now, I just hope I could get a reasonable
linear model using stepwise method in R, but I don't
know how to deal with collinear problem.

=
(Mr.) Jinsong Zhao
Ph.D. Candidate
School of the Environment
Nanjing University
22 Hankou Road, Nanjing 210093
P.R. China
E-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] print comment lines on `sink'ed files?

2004-02-01 Thread Philippe Glaziou
SI [EMAIL PROTECTED] wrote:
 I am using many comment lines like this
   #   a comment line
 in a script.  Is there any way to print
 comment lines when I use sink() function?
 Or, are there any plans to include as
 an option to sink() function in the near
 future?  I would not want to use cat() 
 function as it will look messy in the 
 original script file.



Since you are using script files, you may not need to use R 
in an interactive session. One suggestion under unix would be:


cunegonde:~ R --no-save --quiet  test  saved
cunegonde:~ cat saved
 # a comment line
 i-1:10
 outer(i,i,*)
  [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]12345678910
 [2,]2468   10   12   14   16   1820
 [3,]369   12   15   18   21   24   2730
 [4,]48   12   16   20   24   28   32   3640
 [5,]5   10   15   20   25   30   35   40   4550
 [6,]6   12   18   24   30   36   42   48   5460
 [7,]7   14   21   28   35   42   49   56   6370
 [8,]8   16   24   32   40   48   56   64   7280
 [9,]9   18   27   36   45   54   63   72   8190
[10,]   10   20   30   40   50   60   70   80   90   100
 # the end


All commands including comments appear in the saved output.

HTH,

-- 
Philippe Glaziou
Epidemiologist

__
[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] Stepwise Regression and PLS

2004-02-01 Thread Chris Lawrence
Jinsong Zhao wrote:

Do you mean different procedures will provide different results? Maybe 
I don't understand your email correctly. Now, I just hope I could get 
a reasonable linear model using stepwise method in R, but I don't know 
how to deal with collinear problem.
What Dr. Harrell means (in part) is that stepwise regression leads to 
models that often overfit the observed data pattern--i.e. models that 
are not generalizable.  More elaboration can be found here (including 
comments from Dr. Harrell):

http://www.gseis.ucla.edu/courses/ed230bc1/notes4/swprobs.html

Key quote: Personally, I would no more let an automatic routine select 
my model than I would let some best-fit procedure pack my suitcase.  
The bottom line advice here would be: don't use stepwise regression.

Peter Kennedy, in A Guide to Econometrics (pp. 187-89) suggests the 
following options for dealing with collinearity:

1. Do nothing.  The main problem in OLS when variables are collinear 
is that the estimated variances of the parameters are often inflated.
2. Obtain more data.
3. Formalize relationships among regressors (for example, in a 
simultaneous equation model).
4. Specify a relationship among the *parameters*.
5. Drop one or more variables.  (In essence, a subset of #4 where 
coefficients are set to zero.)
6. Incorporate estimates from other studies.  (A Bayesian might consider 
using a strong prior.)
7. Form a principal component from the variables, and use that instead.
8. Shrink the OLS estimates using the ridge or Stein estimators.

Hope this helps.

Chris

--
Dr. Chris Lawrence [EMAIL PROTECTED] - http://blog.lordsutch.com/
__
[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] 3 little questions

2004-02-01 Thread Liaw, Andy
 From: Siegfried.Macho
 
 Dear R-helpers,
 
 3 questions:
 1. Is there a package that contains a routine for computing 
 Kendall's W 
 (coefficient of concordance), with and without ties ?

Is that the same as Kendall's tau, as in cor(..., method=kendall)?

 2. Is there a package that contains a routine for computing 
 Goodman' s Gamma.

Don't know, if you can find out by search on CRAN.

 3. I there a simple method for computing the number of ties 
 as well as their lengths within a vector fo ranks,
 e.g.
  r1 - rank(c(1, 3, 2, 3, 3, 2, 4))
 
 gives:
 
 [1] 1.0 5.0 2.5 5.0 5.0 2.5 7.0
 
 which contains 2 ties with length 2 and 3.

Try table(), which gives you frequencies.

HTH,
Andy
 
 Thanks in advance,
 S.M
 
 
 ==
 Dr. Siegfried Macho
 Department of Psychology
 University of Fribourg
 Rue de Faucigny 2
 CH-1700 Fribourg
 
 Tel.: +41-26-3007635
 Fax.: +41-26-3009712
 http://www.unifr.ch/psycho/general/macho.htm
 
 __
 [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
 
 


--
Notice:  This e-mail message, together with any attachments,...{{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


Re: [R] print comment lines on `sink'ed files?

2004-02-01 Thread SI
Thanks for your help, Phillipe.  You're right; I don't
(Bneed to use sink() function. I was using R for windows in
(Ban interactive mode and have totally forgotten about batch
(Bmode.
(B
(BFor others' reference I opened up a command prompt and
(Btyped in:
(B
(B  Rterm --no-save --quiet test.R test.log
(B
(Band created test.log gave me the results I wanted.
(B
(B
(BCheers, 
(B
(BSI
(B-
(BSI [EMAIL PROTECTED] wrote:
(B I am using many comment lines like this
(B   #   a comment line
(B in a script.  Is there any way to print
(B comment lines when I use sink() function?
(B Or, are there any plans to include as
(B an option to sink() function in the near
(B future?  I would not want to use cat() 
(B function as it will look messy in the 
(B original script file.
(B
(B
(B
(BSince you are using script files, you may not need to use
(BR 
(Bin an interactive session. One suggestion under unix would
(Bbe:
(B
(B
(Bcunegonde:~ R --no-save --quiet  test  saved
(Bcunegonde:~ cat saved
(B # a comment line
(B i-1:10
(B outer(i,i,"*")
(B  [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
(B [1,]12345678910
(B [2,]2468   10   12   14   16   1820
(B [3,]369   12   15   18   21   24   2730
(B [4,]48   12   16   20   24   28   32   3640
(B [5,]5   10   15   20   25   30   35   40   4550
(B [6,]6   12   18   24   30   36   42   48   5460
(B [7,]7   14   21   28   35   42   49   56   6370
(B [8,]8   16   24   32   40   48   56   64   7280
(B [9,]9   18   27   36   45   54   63   72   8190
(B[10,]   10   20   30   40   50   60   70   80   90   100
(B # the end
(B
(B
(BAll commands including comments appear in the saved
(Boutput.
(B
(BHTH,
(B
(B-- 
(BPhilippe Glaziou
(BEpidemiologist
(B--
(B
(B__
(BDo You Yahoo!?
(BYahoo! BB is Broadband by Yahoo!
(Bhttp://bb.yahoo.co.jp/
(B
(B__
(B[EMAIL PROTECTED] mailing list
(Bhttps://www.stat.math.ethz.ch/mailman/listinfo/r-help
(BPLEASE do read the posting guide! http://www.R-project.org/posting-guide.html