RE: [R] statistical significance test for cluster agreement

2004-03-24 Thread Alexander Sirotkin \[at Yahoo\]
Like you said, such kind of test will not give me
anything that Rand index does not, except for p-value.

The null hypothesis, in my case, is that clustering
results does not match a different clustering, that
someone alse did on the same data.

And I do believe that this hypothesis is valid.
Basicly, it's not that different from chi-squared
goodness of fit test which check whether or not my 
data comes from particular distribution. With an 
exception that I don't know how to do chi-squared test
in this case :)



--- Liaw, Andy [EMAIL PROTECTED] wrote:
 But what would such a test do that the rand index
 does not?  Would you
 interpret the p-value from such a test, if exists,
 to have the meaning that
 a real test of hypothesis has?  AFAIK you basically
 need to have the
 hypotheses pinned down even before you see any data,
 for the inference to be
 valid.  Is that possible with clustering?
 
 Just my $0.02...
 Andy
 
  From: Alexander Sirotkin [at Yahoo]
  
  I was wondering, whether there is a way to have
  statistical significance test for cluster
 agreement.
  
  I know that I can use classAgreement() function to
 get
  Rand index, which will give me some indication
 whether
  the clusters agree or not, but it would be
 interesting
  to have a formal test.
  
  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
  
  
 
 

--
 Notice:  This e-mail message, together with any
 attachments, contains
 information of Merck  Co., Inc. (One Merck Drive,
 Whitehouse Station, New
 Jersey, USA 08889), and/or its affiliates (which may
 be known outside the
 United States as Merck Frosst, Merck Sharp  Dohme
 or MSD and in Japan as
 Banyu) that may be confidential, proprietary
 copyrighted and/or legally
 privileged. It is intended solely for the use of the
 individual or entity
 named on this message.  If you are not the intended
 recipient, and have
 received this message in error, please notify us
 immediately by reply e-mail
 and then delete it from your system.


__
[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] Scaling of font sizes in layout()

2004-03-24 Thread Pisut Tempatarachoke
Hi all,

In the following example,

#--EXAMPLE--
test - function(subfigure)
{
plot(c(1:10),c(1:10),cex=4)
text(1,9,subfigure,cex=10)
}
m - matrix(c(1,2,5,5,3,4,5,5),4,2)
layout(m)
test(a)
test(b)
test(c)
test(d)
test(e)
#---
Is it possible to have the font (a,b,...,e) and pch sizes (including the 
axis-label, tick and tick-label sizes) scaled proportionally with the 
size of each plot when I put multiple plots on the same page?

Thanks in advance!!

Regards
Tempo
__
[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] Job Vacancy

2004-03-24 Thread Wayne Jones

www.kssg.com a pricing consulatancy based in Manchester (UK) are seeking an
experienced statistical analyst. 
Candidates must be eligible to work in the EU. If you are interested please
send an updated CV to [EMAIL PROTECTED] .


Company Overview

KSS is a leading provider of pricing and revenue management systems for the
Retail and Petroleum sectors. Our business applications help our clients get
more out of their existing pricing strategies, as well as improve the
efficiency and productivity of their pricing processes, enabling them to
achieve sustainable net profit improvements and increased market share. 

KSS' solutions are the result of many years of research into price
management and optimisation techniques, and can quantify the impact of
pricing and promotional activities on consumer demand, revenues and profit.
Using a deep understanding of consumer behaviour, clients can apply their
pricing policy and determine pricing and promotional campaigns that maximize
profit for given revenue goals - all within a carefully managed pricing
image. 

KSS' solutions have proven to deliver immediate and sustainable profit
improvements, and are implemented within a number of successful retail
companies throughout the world. 

With over 50% of the company engaged in research and development, we are
continually enhancing our products to meet the requirements of our
customers. Combined with our solid understanding of marketing and
merchandizing we deliver business solutions to enable our customers to meet
their strategic goals more profitably.

Job Description

We require an experienced statistician to join our existing research team of
statisticians and mathematical programmers.  

The work done by the research team is very varied and covers the entire
product life cycle from initial design through to deployment and customer
support. In addition to supporting product development we sometimes
undertake specific consultancy projects for retail clients. There is
considerable scope for tailoring the job description to suit a candidates
particular interests and preferences. It is likely to involve some or all of
the following: 

*   Mathematical modelling for product development team. This
involves enhancing current techniques or researching new ones for our
current or future business applications.

*   Provide statistical support to operations team during
product trials or deployment.  Typically work includes analysing pricing
data sets (price elasticity modelling) for retail and petroleum sectors.
Analyse feasibility and risks of applying particular techniques to a given
data set.

*   Lead, or assist with, statistical consultancy projects on
behalf of retail clients. Present results as a report or in person.



Desirable Skills and Experience

*   Good degree in Statistics or other maths related subject.
*   Postgraduate degree (MSc or PhD) would be an advantage.
*   Commercial experience within the pricing industry (although
not essential)
*   Previous experience within retail pricing would be very
valuable
*   At least two years experience in applying statistics to
'real' data. 
*   Strong analytical skills 
*   Team player
*   Experience in analysing and making inferences from complex
data sets.
*   Excellent communication and interpersonal skills.
*   Understanding of the issues involved in software
development.
*   Good presentation skills
*   Experience with SQL an advantage


Statistical Methods

The ideal candidate would have experience in the majority of the following
statistical methods: 

*   Statistical tools such as R, S-Plus or Matlab.
*   Forecasting techniques
*   Mixed effects models
*   Clustering techniques
*   Econometric models (price elasticity modelling)
*   Time series analysis
*   Regression analysis
*   Multivariate methods
*   Bayesian statistics/inference




Dr Wayne R. Jones
Senior Statistician / Research Analyst
KSS Limited
St James's Buildings
79 Oxford Street
Manchester M1 6SS
Tel: +44(0)161 609 4084
Mob: +44(0)7810 523 713




KSS Ltd
Seventh Floor  St James's Buildings  79 Oxford Street  Manchester  M1 6SS  England
Company Registration Number 2800886
Tel: +44 (0) 161 228 0040   Fax: +44 (0) 161 236 6305
mailto:[EMAIL PROTECTED]http://www.kssg.com


The information in this Internet email is confidential and m...{{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] GLMM

2004-03-24 Thread Simon Chamaillé
Dear all,
I'm working with count data following over-dispersed poisson distribution
and have to work with mixed-models on them (like proc GENMOD on SAS sys.).
I'm still not to sure about what function to use. It seems to me that a
glmmPQL will do the job I want, but I'll be glad if people who worked on
this type of data can share what they learned. Thanks for your time.
simon

[[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] Problems with postscript output

2004-03-24 Thread Frank Gerrit Zoellner
Hi all!

I have a little problem with saving plots to file.
I use the command postscript() followed by the plotting command and a dev.off().

When I then look at the resulting image saved to disk, some of the axis labels are 
missing (see attached image). Is there a way to fix this. 

Yours,
-- 
Frank G. Zoellner
AG Angewandte Informatik
Technische Fakultat
Universitat Bielefeld
phone: +49(0)521-106-2951
fax:   +49(0)521-106-2992
email: [EMAIL PROTECTED]


distclassreschi2.eps
Description: PostScript document
__
[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] significance testing under sampling from small finite populations

2004-03-24 Thread Jens Oehlschlägel

Dear All,

Are there recommended functions to test for (exact) significance when the
samples are drawn from small finite populations (which sometimes are not much
bigger than the sample)?

I am looking for 

- differences in central tendency
- differences of proportions
- difference in distributions

My current application would be on unpaired comparision of discrete
(6-valued) questionaire data, but I would also appreciate pointers to functions for
continuous data or paired comparisions.


Thanks for any help
Best regards


Jens Oehlschlägel

--

__
[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] colour scheme in: plot(survfit.model)

2004-03-24 Thread Federico Calboli
Dear All,

I would like to ask a question on the colour scheme I can specify for a 

plot(survfit.model).

I have four lines of Drosophila, kept at 3 different temperatures. About
100 individuals per line and temperature were scored, no censoring.

the data looks like:

linetempday status
line1   18  23  1
.



My model (quite trivial) is like:

surv.model-survfit(Surv(day, status)~line+temp, mydata)

My problem comes when I:

plot(surv.model,col=1:4)

The plot shows three main groupings, because temperature affects
longevity in drosophila. The problem is that the colour used for line1
at temperature 18C is not the same for line1 at temperature 28C,
which I find extremely confusing. 

How can I specify to keep the same colour for the same line across the
plot?

regards,

Federico Calboli
-- 



=

Federico C. F. Calboli

Dipartimento di Biologia
Via Selmi 3
40126 Bologna
Italy

tel (+39) 051 209 4187
fax (+39) 051 251 4286

f.calboli at ucl.ac.uk

__
[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] Problems with postscript output

2004-03-24 Thread Joris DeWolf
This is not a PS problem. The barplot you made has its horizontl axis 
suppressed by default. See argument axis.lty in ?barplot
Joris

Frank Gerrit Zoellner wrote:

Hi all!

I have a little problem with saving plots to file.
I use the command postscript() followed by the plotting command and a dev.off().
When I then look at the resulting image saved to disk, some of the axis labels are missing (see attached image). Is there a way to fix this. 

Yours,
 



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

== 
Joris De Wolf
CropDesign N.V. 
Plant Evaluation Group
Technologiepark 3 
B-9052 Zwijnaarde 
Belgium 
Tel. : +32 9 242 91 55
Fax  : +32 9 241 91 73
== 

confidentiality notice:
The information contained in this e-mail is confidential and...{{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] High/low level: Plot 2 time series with different axis (left and ri ght)

2004-03-24 Thread SÍ Björn Hauksson
Sun, 14 Mar 2004, Jan Verbesselt wrote:
 Dear R specialists,
 
 I have two time series in a data.frame and want to plot them in the same
 plot(), with the left axis scaled to time series 1 (-700,0) and the
 right axis scaled to time series 2 (-0.2, 0.4). 
 
 plot(timeserie1)
 lines(timeserie2, col=c(2)) = this one should be scaled differently
 with a new axis on the right handside.
 
 How can these be visualised such that the fit is optimal for
 visualisation of the two time series? Which commands can I use?

I have composed a simple R function to do this. See usage example in the function 
description.

##
## Description: A simple function which plots two time series on one plot where 
##the series can have different value intervals over the same time interval.
## Usage: ts.plot.2Axis(xleft, xright)
## Arguments: xleft is the time series for the left vertical axis and xright 
## is for the right axis. xleft and xright are defined as time series with 
## the 'ts' function in package ts.
## ts.plot function must be available, do library(ts) to ensure this if 
## necessary.
## In addition the usual 'ts.plot' and 'plot' parameters can be set
## directly (mar, main, xlab, ylab, lwd) or through gpars as in ts.plot. 
## Also parameter digits is the preferred number of decimal digits on right 
## axis and ticks is the preferred number of tick marks on right axis.
## Details: The time series for the right vertical axis is scaled with a simple 
## rule of thumb scaling.
## The ts.plot function is used to plot the series.
## Value: None. 
## Note: When scaling is not acceptable try switching the series parameters.
## If a ylabel is to be set it is here only possible for the left axis.
## See also: 'ts.plot', 'ts', 'legend'.
## Author and date: Hauksson, Bjorn Arnar. March 2004.
## Example:
## First paste this function into the R console or use 'source'.
#library(ts)
#data(UKLungDeaths)
#x - ldeaths
#y - fdeaths/mdeaths
#ts.plot.2Axis(x, y)
#legTxt - c(UK lung deaths, UK female/male deaths (rhs)) 
#legend(1976.5, 3950, legTxt, lty=c(1:2), col=c(1:2), lwd=2, bty=n)
##

ts.plot.2Axis - function(xleft, xright, digits=1, ticks=5, 
  mar=(c(4,4,4,4)+0.1), main=, 
  xlab=, ylab=, lwd=2, gpars=list()) {
# Settings for other parameters than those in the function parameter list
par(mar=mar)# Margins
  k - ncol(as.matrix(xleft)) # Number of time series on left vertical scale
lty - c(1:(k+1))   # Line types
col - c(1:(k+1))   # Line colors

# Scale time series on right vertical axis
scale - (max(xleft)-min(xleft))/(max(xright)-min(xright))
  xright2 - xright*scale
  meanScale - mean(xleft) - mean(xright2) 
xright2 - xright2 + meanScale

# Plot the series 
ts.plot(xleft, xright2, lty=lty, col=col, main=main, ylab=ylab, xlab=xlab, 
lwd=lwd, gpars=gpars)

# Add the right vertical axis labels
lab - seq(round(min(xright), digits), round(max(xright), digits), 
length=ticks)
labAt - seq(min(xright2), max(xright2), length=ticks)  
axis(side=4, labels=lab, at=labAt)
}

Comments and suggestions for this function would be helpful. A text file with the 
function is available at my website, 
http://www.bjornarnar.net/hugbunadur/R/ts.plot.2Axis.R

Best regards,
Bjorn Arnar Hauksson
bjorn.hauksson at sedlabanki.is
http://www.bjornarnar.net/english.php

__
[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] Problems with postscript output

2004-03-24 Thread Philipp Pagel
Hi!

 I have a little problem with saving plots to file.  I use the command
 postscript() followed by the plotting command and a dev.off().
 
 When I then look at the resulting image saved to disk, some of the
 axis labels are missing (see attached image). Is there a way to fix
 this. 

R is trying to be smart about labels getting too close/overlap. Specify the
graph to be a little wider and the labels will appear.

cu
Philipp

-- 
Dr. Philipp PagelTel.  +49-89-3187-3675
Institute for Bioinformatics / MIPS  Fax.  +49-89-3187-3585
GSF - National Research Center for Environment and Health
Ingolstaedter Landstrasse 1
85764 Neuherberg, Germany
http://mips.gsf.de/~pagel

__
[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] combined random effects

2004-03-24 Thread Joerg Schaber
Hi,

I have the following linear mixed model:

y(g,i,j,k,l)=u + L(g) + T(i) + D(j) + S(k) + (TS)(i,k) + error(g,i,j,k,l)

where S(k) and the combined effect (TS)(i,k) are random effects whereas 
the rest are fixed effects.

How do I specifiy the random part of the model formula in lme(), 
especially concerning the combined effect (TS)?

Moreover, when I run the model as a fixed effect model I get the 
following error:

 lm(logMed ~ lenAA + TREAT + DYE + SLIDE + SLIDE:DYE,data=MA)
Error in lm.fit(x, y, offset = offset, ...) :
   NA/NaN/Inf in foreign function call (arg 4)
However, when I run the model with a reduced data set it works.

In the first case I have 16512 data points whereas in the reduced case I 
use only have of it. Do I reach some internal threshold here?

Thanks for help,

joerg

__
[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] statistical significance test for cluster agreement

2004-03-24 Thread Liaw, Andy
[Apology to the list for the off-topic rant...]

As it turned out, I also have a problem with LOF/GOL/etc. tests:  I'd bet
most of the time when such a test is carried out, it is _not_ the only test
being done, but the p-values in the downstream analysis are almost never
adjusted for this.  How valid would the p-values be?

IMHO, it's bad enough that users of statistical methods do things like this,
but it's quite something else that statisticians do just the same, or even
promote such tests.  It's not a crime to do analysis like that, but to treat
the p-values as if they actually are meaningful probably ought to be
outlawed.

OK, I better run for cover now...

Andy

 From: Alexander Sirotkin [at Yahoo] [mailto:[EMAIL PROTECTED] 
 
 Like you said, such kind of test will not give me
 anything that Rand index does not, except for p-value.
 
 The null hypothesis, in my case, is that clustering
 results does not match a different clustering, that
 someone alse did on the same data.
 
 And I do believe that this hypothesis is valid.
 Basicly, it's not that different from chi-squared
 goodness of fit test which check whether or not my 
 data comes from particular distribution. With an 
 exception that I don't know how to do chi-squared test
 in this case :)
 
 
 
 --- Liaw, Andy [EMAIL PROTECTED] wrote:
  But what would such a test do that the rand index
  does not?  Would you
  interpret the p-value from such a test, if exists,
  to have the meaning that
  a real test of hypothesis has?  AFAIK you basically
  need to have the
  hypotheses pinned down even before you see any data,
  for the inference to be
  valid.  Is that possible with clustering?
  
  Just my $0.02...
  Andy
  
   From: Alexander Sirotkin [at Yahoo]
   
   I was wondering, whether there is a way to have
   statistical significance test for cluster
  agreement.
   
   I know that I can use classAgreement() function to
  get
   Rand index, which will give me some indication
  whether
   the clusters agree or not, but it would be
  interesting
   to have a formal test.
   
   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
   
   
  
  
 
 --
 
  Notice:  This e-mail message, together with any
  attachments, contains
  information of Merck  Co., Inc. (One Merck Drive,
  Whitehouse Station, New
  Jersey, USA 08889), and/or its affiliates (which may
  be known outside the
  United States as Merck Frosst, Merck Sharp  Dohme
  or MSD and in Japan as
  Banyu) that may be confidential, proprietary
  copyrighted and/or legally
  privileged. It is intended solely for the use of the
  individual or entity
  named on this message.  If you are not the intended
  recipient, and have
  received this message in error, please notify us
  immediately by reply e-mail
  and then delete it from your system.
 
 --
 
 
 
 __
 Do you Yahoo!?
 Yahoo! Finance Tax Center - File online. File on time.
 http://taxes.yahoo.com/filing.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] string problems ( grep and regepxr)

2004-03-24 Thread MMarques Power

Recently working with strings and data
I have found a small problem.

Windows XP
R 1.8.1

Reading data from a txt file with readLine.
finding a specific line with grep command, all OK.
but here comes the problem...
After finding the correct line(s) i need to find a substring
inside each string.
In this case tabs I think it represented by \t in the grep command
trying to use grep in each string it only returns 1 ...
Afterwards I tried regexpr command it returns the correct position of the
substring that I am looking for but it only reports the first one.
does regexpr only returns the first one ?


Partial example:

d5 = load0004   node00140.050.01458
 load0005   node00170.050.01458
 load0006   node00190.050.01458

 
grep(\t,d5[1])
[1] 1
regexpr(\t,d5[1]
[1] 9
attr(,match.length)
[1] 1

any idea how to make regexpr return the several substrings ?
or the grep and
Am I missing anything obvious ?

THanks in advance
Marco Marques

__
[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] wolfinger microarray normalization

2004-03-24 Thread Joerg Schaber
Hi,

concerning my earlier mail, maybe someone has noted from the variable names
that I try to analyse mircoarrary experiments.
Does anybody know of a R-implementation of the two-step mixed-model 
normalization procedure proposed by

Wolfinger et al. (2001) J. Comput. Biol. 8:625-637?

That would be great,

best,

joerg

__
[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] string problems ( grep and regepxr)

2004-03-24 Thread Prof Brian Ripley
On Wed, 24 Mar 2004, MMarques Power wrote:

 
 Recently working with strings and data
 I have found a small problem.
 
 Windows XP
 R 1.8.1
 
 Reading data from a txt file with readLine.
 finding a specific line with grep command, all OK.
 but here comes the problem...
 After finding the correct line(s) i need to find a substring
 inside each string.
 In this case tabs I think it represented by \t in the grep command
 trying to use grep in each string it only returns 1 ...

That says it is present in character element one.  Do read the help page

Value:

 For 'grep' a vector giving either the indices of the elements of
 'x' that yielded a match or, if 'value' is 'TRUE', the matched
 elements.


 Afterwards I tried regexpr command it returns the correct position of the
 substring that I am looking for but it only reports the first one.
 does regexpr only returns the first one ?

Yes.

 Partial example:
 
 d5 = load0004   node00140.050.01458
  load0005   node00170.050.01458
  load0006   node00190.050.01458
 
  
 grep(\t,d5[1])
 [1] 1
 regexpr(\t,d5[1]
 [1] 9
 attr(,match.length)
 [1] 1
 
 any idea how to make regexpr return the several substrings ?
 or the grep and
 Am I missing anything obvious ?

Telling us what you actually want to do!  Would

sapply(strsplit(d5, \t), length)

be closer to what you have in mind?

-- 
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] loess parameters

2004-03-24 Thread Thomas Jagoe
Hi,
I have been successfully using the loess function for normalisation of a 2D
array set.
We have recently improved the quality criteria for the data and the numbers
of data points has been reduced to around from around 1000 to 700.
Previously the following would return the loess normalised values for
array$logratio but I am now getting an error:

 array - read.table(A1.txt, header=T, sep=\t)
 array$logratio-array$logs555-array$logs647
 array$logav-(array$logs555+array$logs647)/2
 library(modreg)
 loess2d-loess(logratio~x+y,data=array)
 array$logratio2DLoeNorm -array$logratio - predict(loess2d, array)
Error in vector(double, length) : negative length vectors are not allowed

I am assuming that this is due to a problem fitting the data at some
locations and I have tried altering span without much success.  Can anyone
please advise ?

With thanks

Thomas

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

2004-03-24 Thread Prof Brian Ripley
You are probably running out of memory address space.  Can you 

1) Try this in 1.9.0 beta which gives a more informative error message, 
and

2) Use traceback() and the debugging tools to locate the error more 
exactly.

3) Consider using the options to loess to reduce the load.  Loess is not 
designed for smoothing a 2D grid and you appear only to want the fitted 
values at your grid.  If so, try the fitted() extractor function.
(Or the residual()  extractor function if all you want are residuals.)


On Wed, 24 Mar 2004, Thomas Jagoe wrote:

 Hi,
 I have been successfully using the loess function for normalisation of a 2D
 array set.
 We have recently improved the quality criteria for the data and the numbers
 of data points has been reduced to around from around 1000 to 700.
 Previously the following would return the loess normalised values for
 array$logratio but I am now getting an error:
 
  array - read.table(A1.txt, header=T, sep=\t)
  array$logratio-array$logs555-array$logs647
  array$logav-(array$logs555+array$logs647)/2
  library(modreg)
  loess2d-loess(logratio~x+y,data=array)
  array$logratio2DLoeNorm -array$logratio - predict(loess2d, array)
 Error in vector(double, length) : negative length vectors are not allowed
 
 I am assuming that this is due to a problem fitting the data at some
 locations and I have tried altering span without much success.  Can anyone
 please advise ?
 
 With thanks
 
 Thomas
 
 __
 [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] combined random effects

2004-03-24 Thread Douglas Bates
Joerg Schaber [EMAIL PROTECTED] writes:

 Hi,
 
 I have the following linear mixed model:
 
 y(g,i,j,k,l)=u + L(g) + T(i) + D(j) + S(k) + (TS)(i,k) + error(g,i,j,k,l)
 
 where S(k) and the combined effect (TS)(i,k) are random effects
 whereas the rest are fixed effects.


 How do I specifiy the random part of the model formula in lme(),
 especially concerning the combined effect (TS)?

I think you should be able to specify this as
random = ~ 1 | SLIDE/TREAT

 Moreover, when I run the model as a fixed effect model I get the
 following error:
 
 
   lm(logMed ~ lenAA + TREAT + DYE + SLIDE + SLIDE:DYE,data=MA)
 Error in lm.fit(x, y, offset = offset, ...) :
 NA/NaN/Inf in foreign function call (arg 4)
 
 However, when I run the model with a reduced data set it works.
 
 In the first case I have 16512 data points whereas in the reduced case
 I use only half of it. Do I reach some internal threshold here?

You should get a different error message if you did reach a threshold.

I'd offer to look at the problem in more detail except that I just
learned that one of the main servers in the r-project.org domain (the
one that serves as cran.us.r-project.org, among other things) has
crashed and I need to get in to the office to check on it.

-- 
Douglas Bates[EMAIL PROTECTED]
Statistics Department608/262-2598
University of Wisconsin - Madisonhttp://www.stat.wisc.edu/~bates/

__
[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] Rmpi and PBS

2004-03-24 Thread Sam.Yang
Please remove me from the mailing list

-Original Message-
From: [EMAIL PROTECTED]
To: Shengqiao Li
Cc: r-help
Sent: 24/03/2004 10:10 AM
Subject: Re: [R] Rmpi and PBS

On Tue, 2003-12-30 at 08:39, Shengqiao Li wrote:
 Hello:
 
 Anybody knows how to run Rmpi through PBS (Portable Batch System) on a
 cluster computer. I'm using a supercomputer which require to submit
jobs
 to PBS queue for dispatching. I tried use mpirun in my PBS script. But
all
 my Rslaves are spawned to the same node. This is not desired.
 
 Any suggestions are welcome!
 
 Thanks in advance.
This is a late reply, but perhaps still of interest to some.  It looks
as if this problem has been solved, though only integrated into LAM with
release 7: http://www.lam-mpi.org/papers/hpcs2003/tm-implementation.pdf

__
[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][S] library question

2004-03-24 Thread Erin Hodgess
Dear R and S+ People:

Is it possible to take one of the R libraries and put it
into S+ please?

R Windows XP 1.8.1
S+ Version 6.2

Thanks in advance!

Sincerely,
Erin Hodgess
Associate Professor
Department of Computer and Mathematical Sciences
University of Houston - Downtown
mailto: [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][S] library question

2004-03-24 Thread Prof Brian D Ripley
In some cases it is possible to port an R *package* to S-PLUS: people have
done both that and the reverse.

If you have some specific examples in mind we may be able to help you
further.  Since you are on Windows, it may not be easy unless you have the
requisite tools (e.g. Visuall C++ and Fortran).


On Wed, 24 Mar 2004, Erin Hodgess wrote:

 Is it possible to take one of the R libraries and put it
 into S+ please?

 R Windows XP 1.8.1
 S+ Version 6.2


-- 
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 272860 (secr)
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][S] library question

2004-03-24 Thread Martin Maechler
 Erin == Erin Hodgess [EMAIL PROTECTED]
 on Wed, 24 Mar 2004 08:13:01 -0600 writes:

Erin Dear R and S+ People: Is it possible to take one of
Erin the R libraries and put it into S+ please?

libraries (i.e. a collection of compiled code): definitely not
as is.

However, I presume you mean packages.
There, it depends if the package only consists of S code (in the
R dialect).  If yes, you often can use most, if not all of the
code in S+. 
But do read the FAQ about S and R differences
and consider the fact that for graphics,
the step from R to S-plus is quite a bit of a downgrade,
and code usually will only work if it was written with back
portability in mind  (back : to S+).

{read all of the above with a bit of humour ..}

Note that R is fully open source, so you can always port R
packages that contain compiled code and data sets, and doing so
can be easy -- but may be not at all: 
The C API of R being quite rich nowadays,
you may have to work quite a bit on the source before you can
link the compiled code into S-Plus.

Regards,
Martin

Erin R Windows XP 1.8.1 S+ Version 6.2

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

2004-03-24 Thread Henric Nilsson
At 11:17 2004-03-24, you wrote:

I'm working with count data following over-dispersed poisson distribution
and have to work with mixed-models on them (like proc GENMOD on SAS sys.).
I'm still not to sure about what function to use.
This is confusing: Proc GENMOD fits generalized linear models (GLM) and 
handles modelling of overdispersed Poisson data using quasi-likelihood 
(e.g. SCALE=P) or the negative binomial distribution (DIST=NEGBIN), but not 
generalized linear mixed models (GLMM).

In R a GLM is fitted using the glm function, and specifying 
family=quasipoisson is the equivalent of SCALE=P in SAS. The negative 
binomial case is handled either by the negative.binomial family function 
(when the shape parameter is known) or the glm.nb function (if you want to 
estimate the shape by ML). Both negative.binomial and glm.nb are found in 
Venables and Ripley's MASS package.

It seems to me that a glmmPQL will do the job I want,
If GLMM is what you want, the functions glmmPQL (from MASS) or GLMM (from 
lme4, by Bates and co-workers) will most likely handle your needs.

but I'll be glad if people who worked on this type of data can share what 
they learned. Thanks for your time.
If you describe your data and what you'd like to do, someone may be able to 
help you.

The MASS functions, and much more, are described in Venables and Ripley 
Modern Applied Statistics with S. GLMMs are described in e.g. Brown and 
Prescott Applied Mixed Models in Medicine, but it's very SAS oriented.

//Henric

__
[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] colors, lines, characters .... documentation

2004-03-24 Thread Monica Palaseanu-Lovejoy
Hi,

Very so often when i am plotting something, doing a histogram, or 
whatever i am struggling to find out which are the numbers for 
different colors, palette names, types of lines, symbols, etc. Is 
there any documentation on line with all these numbers / names 
and the associated symbol / color???

For example if i am using the command image it uses a palette 
from red to yellow, with red the lowest value, and yellow the highest 
value. What if i want a reverse palette, with green the lowest value 
and yellow middle values and red highest value??? Or much more 
simple, just yellow lowest value and red highest value???

Thank you for assistance,

Monica

__
[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] LM omitted variables test

2004-03-24 Thread Millo Giovanni
Dear all,

Does anybody know whether the (general) Lagrange Multiplier testing
framework for restrictions on linear models has been implemented in some
package?

My goal is to test for omitted variables, i.e. restrictions of the kind
beta_i=0, in the specification of an econometric model.

There are some particular implementations in this fashion in the lmtest
package (e,g, the bgtest() function, where the lagged residuals are
taken as the omitted variable); before trying to adapt that code, I
would like to check out if there are ready-to-use solutions available. 

Thanks in advance
Giovanni

Giovanni Millo
Research Dept.
Assicurazioni Generali SpA

Ai sensi del D.Lgs.196/2003 si precisa che le informazioni contenute in questo 
messaggio sono riservate ed a uso esclusivo del destinatario. Qualora il messaggio in 
parola Le fosse pervenuto per errore, La invitiamo ad eliminarlo senza copiarlo e a 
non inoltrarlo a terzi, dandocene gentilmente comunicazione. Grazie.BRBRPursuant 
to Legislative Decree No. 196/2003, you are hereby informed that this message contains 
confidential information intended only for the use of the addressee. If you are not 
the addressee, and have received this message by mistake, please delete it and 
immediately notify us. You may not copy or disseminate this message to anyone. Thank 
you.
[[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] colors, lines, characters .... documentation

2004-03-24 Thread Henrik Bengtsson
Hi, many questions at once there, but here some help regarding
*symbols*. 

I've pasted a function plotSymbols() that shows all symbols available.
Note that the the symbols pch = 128 are system dependent so you
should not expect them to look the same on Windows, Mac and Unix. Try
also plotSymbols(TRUE). To turn of the click-bell do
'options(locatorBell=FALSE)' (see ?locator).

Cheers

Henrik


BEGIN code

plotSymbols - function(interactive=FALSE) {
  ASCII - c(\000, sapply(1:255, function(i)
parse(text=paste(\\\,
structure(i,class=octmode), \,
sep=))[[1]]));

  intToChar - function(i) {
ASCII[i %% 256 + 1];
  }

  interactive - interactive  interactive();

  i - 0:255;
  ncol -16;
  
  top - 3 + 2*interactive;
  opar - par(cex.axis=0.7, mar=c(3,3,top,3)+0.1)
  on.exit(par(opar))

  plot(i%%ncol,1+i%/%ncol, pch=i, xlim=c(0,ncol-1), xlab=, ylab=, 
 
axes=FALSE);
  axis(1, at=0:15)
  axis(2, at=1:16, labels=0:15*16, las=2)
  axis(3, at=0:15)
  axis(4, at=1:16, labels=0:15*16+15, las=2)
  if (interactive) {
title(main=Click on a symbol to add it to the data frame. Click
in margin to quit!, cex.main=0.8, line=3.5);
  }

  if (interactive) {
df - list();
usr - par(usr);
ready - FALSE;
while (!ready) {
  click - locator(n=1);
  x - click$x;
  y - click$y - 1;
  ready - !(x  0.5  x  15.5  y  0.5  y  15.5);
  if (!ready) {
x - round(x);
y - round(y);
z - 16*y + x;
ch  - intToChar(z);
dec - as.character(z); 
hex - intToHex(z);
oct - intToOct(z);
spc - paste(rep(0, 2-nchar(hex)), collapse=);
hex - paste(spc, hex, sep=);
spc - paste(rep(0, 3-nchar(oct)), collapse=);
oct - paste(spc, oct, sep=);
df$ch  - c(df$ch , ch );
df$dec - c(df$dec, dec);
df$hex - c(df$hex, hex);
df$oct - c(df$oct, oct);

if (nchar(ch) == 0) ch -  ;
spc - paste(rep( , 3-nchar(dec)), collapse=);
dec - paste(spc, dec, sep=);
cat(Selected ASCII character ', ch, ' , dec,  0x, hex, 
  \\, oct, \n,
sep=);
  }
}
return(df);
  }

  invisible()
} # plotSymbols()

END code


 -Original Message-
 From: [EMAIL PROTECTED] 
 [mailto:[EMAIL PROTECTED] On Behalf Of Monica 
 Palaseanu-Lovejoy
 Sent: den 24 mars 2004 16:06
 To: [EMAIL PROTECTED]
 Subject: [R] colors, lines, characters  documentation
 
 
 Hi,
 
 Very so often when i am plotting something, doing a histogram, or 
 whatever i am struggling to find out which are the numbers for 
 different colors, palette names, types of lines, symbols, etc. Is 
 there any documentation on line with all these numbers / names 
 and the associated symbol / color???
 
 For example if i am using the command image it uses a palette 
 from red to yellow, with red the lowest value, and yellow the
highest 
 value. What if i want a reverse palette, with green the lowest value

 and yellow middle values and red highest value??? Or much more 
 simple, just yellow lowest value and red highest value???
 
 Thank you for assistance,
 
 Monica
 
 __
 [EMAIL PROTECTED] mailing list 
 https://www.stat.math.ethz.ch/mailma n/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] hierarchical clustering: stopping rule

2004-03-24 Thread Felix Salfner
I'm using 'agnes' from the 'cluster' package to cluster my data 
hierarchically.

I need to find out the 'optimal' number of clusters.

In 'Finding Groups in Data: An Introduction to Cluster Analysis' Kaufman 
and Rousseeuw refer to a strategy proposed by R. Mojena ('Hierarchical 
grouping methods and stopping rules: An evaluation' (The Computer 
Journal, 20(4), 1977).

Mojena describes group weighted average hierarchical clustering methods 
with the following formula:

   n_p  n_q
d_is =  d_ps  +  d_qs
   n_i  n_i
where i is the index for the new group to be formed out of groups p and q
and s represents a third group
d is the distance measure.
In every clustering step   a_j = min_{im} (d_im)

My question now is:

are the values of agnes.object$heights identical to the a_j defined above? 
(Despite of the fact that the heights are permutated for drawing)

I also read the publication of Lance and Williams who originally introduced the above notation but it didn't help ...

Thanks for any hint ...

Felix Salfner

__
[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] line number of errors?

2004-03-24 Thread ivo welch
Is it possible to instruct R to output a line number when an error or 
warning is encountered in a source() file?

sincerely,  /iaw

__
[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] First Variable in lm

2004-03-24 Thread Christian Hoffmann
Hi all,

I just cannot think of how to do it:
I want to take the first variable (column) of a data frame and regress 
it against all other variables.

bla - function (dat) {
  reg - lm(whateverthefirstofthevariablenamesis ~., data=dat)
  return(reg)
}
What kind of function do I have to take instead of the 
whateverthefirstofthevariablenamesis,

eval(), substitute(), get(),  ...

to correctly compute this regression?

With   lm(get(names(dat)[1] ~., data=dat) there are no errors, but the 
first variable also shows up among the regressors.

Thanks for help.
Christian Hoffmann
--
Dr.sc.math.Christian W. Hoffmann, 
http://www.wsl.ch/staff/christian.hoffmann
Mathematics + Statistical Computing   e-mail: [EMAIL PROTECTED]
Swiss Federal Research Institute WSL  Tel: ++41-44-73922-   -77  (office)
CH-8903 Birmensdorf, Switzerland -11(exchange), -15  (fax)

__
[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] colors, lines, characters .... documentation

2004-03-24 Thread Rau, Roland
Hello,

 -Original Message-
 From: Monica Palaseanu-Lovejoy
 [SMTP:[EMAIL PROTECTED]
 Sent: Wednesday, March 24, 2004 4:06 PM
 To:   [EMAIL PROTECTED]
 Subject:  [R] colors, lines, characters  documentation
 
 Hi,
 
 Very so often when i am plotting something, doing a histogram, or 
 whatever i am struggling to find out which are the numbers for 
 different colors, palette names, types of lines, symbols, etc. Is 
 there any documentation on line with all these numbers / names 
 and the associated symbol / color???
 
what I found to be quite useful is found in the library Hmisc.
(Thanks, Frank Harrell!)

library(Hmisc)
show.col()
show.pch()

And if you look at the definitions of these functions, it might be
quite easy to modify them for your exact needs.

Hope this helps,
Roland



+
This mail has been sent through the MPI for Demographic Rese...{{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] snow documentation comments

2004-03-24 Thread Luke Tierney
On Tue, 23 Mar 2004, Ross Boylan wrote:

 There are a few points I found unclear or unmentioned in the snow
 documentation (mostly I looked at the cluster.html web page).  I thought
 I'd mention them here.
 
 What is the start up environment for the children?
 --
 My best guess at the answer is in parentheses
 Do they inherit shell variables? (no)
 Do they inherit variables set in R or other aspects of the R
 environment? (no)
 What directory does it start in? (the directory you are running in)
 What user are you? (same as original)
 
 I realize some of these answers might depend on the parallelization
 layer you are using, or whether you select the homogenous option.

They do

 Number of nodes or number of children?
 --
 I thought all the counts of nodes (e.g., in makeCluster(5)) were of the
 total nodes in the cluster, i.e., children + 1.  However, I did a
 makeCluster(2) and I got 2 additional R processes running.  Have I
 misunderstood the semantics, or is it essentially an implementation
 detail that the master node starts a new R process?

makeCluster(2) creates a cluster of two processes that the master
process uses.  So there are a total of three processes.

luke

-- 
Luke Tierney
University of Iowa  Phone: 319-335-3386
Department of Statistics andFax:   319-335-3017
   Actuarial Science
241 Schaeffer Hall  email:  [EMAIL PROTECTED]
Iowa City, IA 52242 WWW:  http://www.stat.uiowa.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] line number of errors?

2004-03-24 Thread Martin Maechler
 ivo == ivo welch [EMAIL PROTECTED]
 on Wed, 24 Mar 2004 10:49:55 -0500 writes:

ivo Is it possible to instruct R to output a line number
ivo Is it possible to instruct R to output a line number
ivo when an error or warning is encountered in a source()
ivo file?

yes, it is possible, since R is a complete programming language,
you can write a new version of source()...  ;-) 
:-)

Note that this feature is for free when using 
ESS (Emacs Speaks Statistics),
and it's C-c C-l (or [Load Source File] entry from the 'iESS'
  or [Load File] from the 'ESS' menu)

Regards,
Martin

__
[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] colors, lines, characters .... documentation

2004-03-24 Thread Gabor Grothendieck
Stephane DRAY dray at biomserv.univ-lyon1.fr writes:
 [...]
 the colors used when you use number are those in palette:
   palette()
 [1] black   red green3  bluecyanmagenta 
 yellow  gray
   plot(1:20,col=1:20)
 
 You can define your own palette with colors available in colors:
   palette(colors()[sample(1:657,20)])
   palette()
 [...]
plot(1:20,col=1:20)
 
 For the image function, you can enter your own vector of colors (by 
 default, col = heat.colors(12)) and one way to define your colors is to use 
 'rgb' function with values for Red - Green - Blue.

In conjunction with these sorts of manipulations you might also be
interested in the color name -- hex code conversion functions 
previously posted on r-help and found at:

   http://maths.newcastle.edu.au/~rking/R/help/03a/7417.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] colors, lines, characters .... documentation

2004-03-24 Thread Don MacQueen
Here is a little function that will show available colors in groups 
of 100 at a time.
I've only tested it in an X windows environment.

function (indx = 0:6)
{
for (ii in unique(indx)) {
is - 100 * ii + 1:100
if (min(is)  length(colors())) {
cat(Maximum value of arg is, floor(length(colors())/100),
\n)
return(NULL)
}
foo - matrix(colors()[is], nrow = 10)
par(mar = c(3, 3, 0.25, 0.25))
plot(1:10, 1:10, type = n, yaxt = n, xlab = , ylab = )
axis(2, at = 1:10, lab = 10:1)
for (j in 1:10) {
for (i in 1:10) {
points(j, 11 - i, col = foo[i, j], pch = 16,
  cex = 4)
text(j, 11 - i - 0.3, foo[i, j], cex = 0.8)
}
}
if (length(indx)  1  ii  max(indx))
readline(paste(Currently showing group, ii,   CR to continue ))
}
invisible(foo)
}
-Don

At 3:05 PM + 3/24/04, Monica Palaseanu-Lovejoy wrote:
Hi,

Very so often when i am plotting something, doing a histogram, or
whatever i am struggling to find out which are the numbers for
different colors, palette names, types of lines, symbols, etc. Is
there any documentation on line with all these numbers / names
and the associated symbol / color???
For example if i am using the command image it uses a palette
from red to yellow, with red the lowest value, and yellow the highest
value. What if i want a reverse palette, with green the lowest value
and yellow middle values and red highest value??? Or much more
simple, just yellow lowest value and red highest value???
Thank you for assistance,

Monica

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


--
--
Don MacQueen
Environmental Protection Department
Lawrence Livermore National Laboratory
Livermore, CA, USA
__
[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] First Variable in lm

2004-03-24 Thread Prof Brian Ripley
On Wed, 24 Mar 2004, Christian Hoffmann wrote:

 Hi all,
 
 I just cannot think of how to do it:
 I want to take the first variable (column) of a data frame and regress 
 it against all other variables.
 
 bla - function (dat) {
reg - lm(whateverthefirstofthevariablenamesis ~., data=dat)
return(reg)
 }
 
 What kind of function do I have to take instead of the 
 whateverthefirstofthevariablenamesis,
 
 eval(), substitute(), get(),  ...
 
 to correctly compute this regression?
 
 With   lm(get(names(dat)[1] ~., data=dat) there are no errors, but the 
 first variable also shows up among the regressors.

Andy Liaw has pointed out that lm(dat) happens to work.  But for a more 
generalizable solution try

bla - function (dat)
  eval(substitute(lm(foo ~., data=dat), list(foo=as.name(names(dat)[1]

which has the advantage of embedding a clean value of $call.

-- 
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] statistical significance test for cluster agreement

2004-03-24 Thread Christian Hennig
Dear Alexander,

On Wed, 24 Mar 2004, Alexander Sirotkin [at Yahoo] wrote:

 Like you said, such kind of test will not give me
 anything that Rand index does not, except for p-value.
 
 The null hypothesis, in my case, is that clustering
 results does not match a different clustering, that
 someone alse did on the same data.

Usually, probability distributions (which you need to formulate null
hypotheses) are over data, not over different
methods applied to the same data. If you see two clusterings on the same
data, they are identical, if they are 100% identical, and if not, then
not. That's not a question of significance.

What you seem to want is the assessment of stability of a clustering on
given data by applying different cluster analyses, but this kind of
problem is not treated in terms of
significance. Different cluster analyses do different things, and there
is no reason to expect that their results are the same apart from random
variation (the only exception is random variation in running the same
algorithm such as k-means from different random starting values - but
that's not a problem to investigate if you *know* the cluster
analysis method that produced your clustering).

Christian


***
Christian Hennig
Fachbereich Mathematik-SPST/ZMS, Universitaet Hamburg
[EMAIL PROTECTED], http://www.math.uni-hamburg.de/home/hennig/
###
ich empfehle www.boag-online.de

__
[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] First Variable in lm

2004-03-24 Thread Gabor Grothendieck
Christian Hoffmann christian.hoffmann at wsl.ch writes:

 
 Hi all,
 
 I just cannot think of how to do it:
 I want to take the first variable (column) of a data frame and regress 
 it against all other variables.
 
 bla - function (dat) {
reg - lm(whateverthefirstofthevariablenamesis ~., data=dat)
return(reg)
 }

Andy has already given a particularly concise solution but if your
variable is not in first position then you could rearrange the 
order of the variables to allow his solution or use this which works 
for any specified position of the dependent variable:

data(longley)
lm( longley[,7] ~. , data = longley[,-7] )

__
[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] how to customize .First.lib

2004-03-24 Thread Vadim Ogranovich
Hi,
 
I am looking for an elegant solution to the following problem. When I
load a package, let's say ROracle, I want some custom actions to be done
on top of what package's .First.lib does. In this specific example I
want to open a connection to the only database I have around.
And I don't see how this could be done: there seems to be no hooks in a
couple of .First.lib functions I checked out, and there is no
on.library.load() function to register a call-back too.
 
It's just a nice to have, but I am curious to hear what people might
suggest.
 
Thanks,
Vadim

[[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] Ordered logit/probit

2004-03-24 Thread Valentin Stanescu
Hello everyone
I am trying to fit an ordered probit/logit model for bank rating
prediction.
Besides polr() in MASS package which is not written especially for this as
far as I know, do you know how else I can do this?
I already found the modified polr () version on the


Valentin STANESCU

Enrst and Young
Tel. 402 4000
--
The information contained in this communication is intended solely for the use of the 
individual or entity to whom it is addressed and others authorized to receive it.   It 
may contain confidential or legally privileged information.   If you are not the 
intended recipient you are hereby notified that any disclosure, copying, distribution 
or taking any action in reliance on the contents of this information is strictly 
prohibited and may be unlawful. If you have received this communication in error, 
please notify us immediately by responding to this email and then delete it from your 
system. Ernst  Young is neither liable for the proper and complete transmission of 
the information contained in this communication nor for any delay in its receipt.

Note: If you have received a delivery failure report, it may be due to the change in 
the Ernst  Young e-mail domain from eyi.com to ey.com.  Could you please make the 
necessary amendment, if required, and resend the message.

[[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] First Variable in lm

2004-03-24 Thread Baskin, Robert
First: Thanks to everyone who develops R, maintains r-help, and participates
in the list :)  

This is a silly follow up question.

From Andy Liaw:
 dat - data.frame(y=rnorm(10), x1=rnorm(10), x2=rnorm(10))

(Silly question - if the answer is on the lm or formula help page I didn't
get it:)
Why does lm | formula treat dat[,1] slightly differently than dat$y?

I see what it is doing - I am curious as to why:)

 lm(dat$y ~ .,data = dat)

Call:
lm(formula = dat$y ~ ., data = dat)

Coefficients:
(Intercept)   x1   x2  
   -0.08754 -0.04456 -0.16905  

 lm(dat[,1] ~ .,data = dat)

Call:
lm(formula = dat[, 1] ~ ., data = dat)
Coefficients:
(Intercept)y   x1   x2  
 -5.266e-171.000e+004.121e-17   -3.274e-17  


As Gabor Grothendieck pointed out:
lm(formula = dat[, 1] ~ ., data = dat[,-1])
works like
lm(formula = dat$y ~ ., data = dat)

Curious Minds Want to Know
Bob


-Original Message-
From: Gabor Grothendieck [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, March 24, 2004 12:51 PM
To: [EMAIL PROTECTED]
Subject: Re: [R] First Variable in lm

Christian Hoffmann christian.hoffmann at wsl.ch writes:

 
 Hi all,
 
 I just cannot think of how to do it:
 I want to take the first variable (column) of a data frame and regress 
 it against all other variables.
 
 bla - function (dat) {
reg - lm(whateverthefirstofthevariablenamesis ~., data=dat)
return(reg)
 }

Andy has already given a particularly concise solution but if your
variable is not in first position then you could rearrange the 
order of the variables to allow his solution or use this which works 
for any specified position of the dependent variable:

data(longley)
lm( longley[,7] ~. , data = longley[,-7] )

__
[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] First Variable in lm

2004-03-24 Thread Prof Brian Ripley
It isn't lm but terms.formula.  Compare

terms(dat$y ~ .,data = dat)
terms(dat[, 1] ~ ., data = dat)

Now as to why, exactly, see the C code in src/main/model.c.
The short answer is that dat$y matches y, and dat[, 1] does not.
(I am not at all sure the first is intentional.)

On Wed, 24 Mar 2004, Baskin, Robert wrote:

 First: Thanks to everyone who develops R, maintains r-help, and participates
 in the list :)  
 
 This is a silly follow up question.
 
 From Andy Liaw:
  dat - data.frame(y=rnorm(10), x1=rnorm(10), x2=rnorm(10))
 
 (Silly question - if the answer is on the lm or formula help page I didn't
 get it:)
 Why does lm | formula treat dat[,1] slightly differently than dat$y?

-- 
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] binding vectors or matrix using their names

2004-03-24 Thread Stephane DRAY
Hello list,
I have two vectors x and x2:
x=runif(10)
x2=runif(10)
and one vectors with their names :

my.names=c(x,x2)

I would like to cbind these two vectors using their names contained in the 
vector my.names.
I can create a string with comma
ncomma=paste(my.names,collapse=,)

and now, I just need a function to transform this string into a adequate 
argument for cbind:

cbind(afunction(ncomma))

Is there in R a function that can do the job ? If not, how can I do it ??

Thanks in advance,
Sincerely.
Stéphane DRAY
-- 

Département des Sciences Biologiques
Université de Montréal, C.P. 6128, succursale centre-ville
Montréal, Québec H3C 3J7, Canada
Tel : 514 343 6111 poste 1233
E-mail : [EMAIL PROTECTED]
-- 

Web  http://www.steph280.freesurf.fr/

__
[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] binding vectors or matrix using their names

2004-03-24 Thread Vadim Ogranovich
?get to convert names into objects

 -Original Message-
 From: Stephane DRAY [mailto:[EMAIL PROTECTED] 
 Sent: Wednesday, March 24, 2004 11:41 AM
 To: [EMAIL PROTECTED]
 Subject: [R] binding vectors or matrix using their names
 
 
 Hello list,
 I have two vectors x and x2:
 
 x=runif(10)
 x2=runif(10)
 
 and one vectors with their names :
 
 my.names=c(x,x2)
 
 I would like to cbind these two vectors using their names 
 contained in the 
 vector my.names.
 I can create a string with comma
 ncomma=paste(my.names,collapse=,)
 
 and now, I just need a function to transform this string into 
 a adequate 
 argument for cbind:
 
 cbind(afunction(ncomma))
 
 Is there in R a function that can do the job ? If not, how 
 can I do it ??
 
 Thanks in advance,
 Sincerely.
 
 
 Stéphane DRAY
 --
  
 
 Département des Sciences Biologiques
 Université de Montréal, C.P. 6128, succursale centre-ville 
 Montréal, Québec H3C 3J7, Canada
 
 Tel : 514 343 6111 poste 1233
 E-mail : [EMAIL PROTECTED]
 --
  
 
 Web  
 http://www.steph280.freesurf.fr/
 
 
 __
 [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] binding vectors or matrix using their names

2004-03-24 Thread Tom Blackwell

I believe the syntax is

result - do.call(cbind, as.list(my.names))

Haven't checked this on your example, though.

-  tom blackwell  -  u michigan medical school  -  ann arbor  -

On Wed, 24 Mar 2004, Stephane DRAY wrote:

 Hello list,
 I have two vectors x and x2:

 x=runif(10)
 x2=runif(10)

 and one vectors with their names :

 my.names=c(x,x2)

 I would like to cbind these two vectors using their names contained in the
 vector my.names.
 I can create a string with comma
 ncomma=paste(my.names,collapse=,)

 and now, I just need a function to transform this string into a adequate
 argument for cbind:

 cbind(afunction(ncomma))

 Is there in R a function that can do the job ? If not, how can I do it ??

 Thanks in advance,
 Sincerely.


 Stéphane DRAY
 --

 Département des Sciences Biologiques
 Université de Montréal, C.P. 6128, succursale centre-ville
 Montréal, Québec H3C 3J7, Canada

 Tel : 514 343 6111 poste 1233
 E-mail : [EMAIL PROTECTED]
 --

 Web  http://www.steph280.freesurf.fr/

 __
 [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] binding vectors or matrix using their names

2004-03-24 Thread Stephane DRAY
Hi Tom,

Your approach did not work,

 do.call(cbind, as.list(my.names))
 [,1] [,2]
[1,] x  x2
but it helps me a lot to find the good one:

do.call(cbind, as.list(parse(text=my.names)))

Thanks,

At 14:56 24/03/2004, Tom Blackwell wrote:

I believe the syntax is

result - do.call(cbind, as.list(my.names))

Haven't checked this on your example, though.

-  tom blackwell  -  u michigan medical school  -  ann arbor  -

On Wed, 24 Mar 2004, Stephane DRAY wrote:

 Hello list,
 I have two vectors x and x2:

 x=runif(10)
 x2=runif(10)

 and one vectors with their names :

 my.names=c(x,x2)

 I would like to cbind these two vectors using their names contained in the
 vector my.names.
 I can create a string with comma
 ncomma=paste(my.names,collapse=,)

 and now, I just need a function to transform this string into a adequate
 argument for cbind:

 cbind(afunction(ncomma))

 Is there in R a function that can do the job ? If not, how can I do it ??

 Thanks in advance,
 Sincerely.


 Stéphane DRAY
 
--

 Département des Sciences Biologiques
 Université de Montréal, C.P. 6128, succursale centre-ville
 Montréal, Québec H3C 3J7, Canada

 Tel : 514 343 6111 poste 1233
 E-mail : [EMAIL PROTECTED]
 
--

 
Web  http://www.steph280.freesurf.fr/

 __
 [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
Stéphane DRAY
-- 

Département des Sciences Biologiques
Université de Montréal, C.P. 6128, succursale centre-ville
Montréal, Québec H3C 3J7, Canada
Tel : 514 343 6111 poste 1233
E-mail : [EMAIL PROTECTED]
-- 

Web  http://www.steph280.freesurf.fr/

__
[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] snow documentation comments

2004-03-24 Thread Ross Boylan
On Wed, 2004-03-24 at 08:03, Luke Tierney wrote:
 On Tue, 23 Mar 2004, Ross Boylan wrote:
 
  There are a few points I found unclear or unmentioned in the snow
  documentation (mostly I looked at the cluster.html web page).  I thought
  I'd mention them here.
  
  What is the start up environment for the children?
  --
  My best guess at the answer is in parentheses
  Do they inherit shell variables? (no)
  Do they inherit variables set in R or other aspects of the R
  environment? (no)
  What directory does it start in? (the directory you are running in)
  What user are you? (same as original)
  
  I realize some of these answers might depend on the parallelization
  layer you are using, or whether you select the homogenous option.
 
 They do
I've since realized they may also depend on the exact version of the
package used (e.g., newer lams apparently have the ability to export
environment variables) and the way it is invoked.

Personally, I'd even find a single sentence saying explicitly that it
depends clarifying.  It would probably also be good to discuss the
behavior of the socket-based communication, since that it supplied by
the snow package.  Information on the other interfaces would be nice
too, but probably hazardous to provide accurately.

I'll not for the record that my answers above are using Rmpi with
lam/mpi 6.5.8-2 on Debian, running just on my local computer.  And some
of the answers are speculative!
 
  Number of nodes or number of children?
  --
  I thought all the counts of nodes (e.g., in makeCluster(5)) were of the
  total nodes in the cluster, i.e., children + 1.  However, I did a
  makeCluster(2) and I got 2 additional R processes running.  Have I
  misunderstood the semantics, or is it essentially an implementation
  detail that the master node starts a new R process?
 
 makeCluster(2) creates a cluster of two processes that the master
 process uses.  So there are a total of three processes.
So work that is distributed via snow goes to the two processes only?

__
[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] binding vectors or matrix using their names

2004-03-24 Thread Liaw, Andy
Perhaps simler:

 x1 - 1:5
 x2 - 2:7
 xname - c(x1, x2)
 sapply(xname, get)
 x1 x2
[1,]  1  2
[2,]  2  3
[3,]  3  4
[4,]  4  5
[5,]  5  6

HTH,
Andy

 From: Stephane DRAY
 
 Hi Tom,
 
 Your approach did not work,
 
   do.call(cbind, as.list(my.names))
   [,1] [,2]
 [1,] x  x2
 
 but it helps me a lot to find the good one:
 
 do.call(cbind, as.list(parse(text=my.names)))
 
 Thanks,
 
 
 At 14:56 24/03/2004, Tom Blackwell wrote:
 
 I believe the syntax is
 
 result - do.call(cbind, as.list(my.names))
 
 Haven't checked this on your example, though.
 
 -  tom blackwell  -  u michigan medical school  -  ann arbor  -
 
 On Wed, 24 Mar 2004, Stephane DRAY wrote:
 
   Hello list,
   I have two vectors x and x2:
  
   x=runif(10)
   x2=runif(10)
  
   and one vectors with their names :
  
   my.names=c(x,x2)
  
   I would like to cbind these two vectors using their names 
 contained in the
   vector my.names.
   I can create a string with comma
   ncomma=paste(my.names,collapse=,)
  
   and now, I just need a function to transform this string 
 into a adequate
   argument for cbind:
  
   cbind(afunction(ncomma))
  
   Is there in R a function that can do the job ? If not, 
 how can I do it ??
  
   Thanks in advance,
   Sincerely.
  
  
   Stéphane DRAY
   
  
 --
 
  
   Département des Sciences Biologiques
   Université de Montréal, C.P. 6128, succursale centre-ville
   Montréal, Québec H3C 3J7, Canada
  
   Tel : 514 343 6111 poste 1233
   E-mail : [EMAIL PROTECTED]
   
  
 --
 
  
   
  Web  
 http://www.steph280.freesurf.fr/
  
   
 __
   [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
 
 Stéphane DRAY
 
 --
  
 
 Département des Sciences Biologiques
 Université de Montréal, C.P. 6128, succursale centre-ville
 Montréal, Québec H3C 3J7, Canada
 
 Tel : 514 343 6111 poste 1233
 E-mail : [EMAIL PROTECTED]
 --
  
 
 Web  
 http://www.steph280.freesurf.fr/
 
 
 __
 [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] binding vectors or matrix using their names

2004-03-24 Thread Patrick Burns
I think you are looking for the eval-parse-text idiom:

eval(parse(text=paste(cbind(, paste(my.names, collapse=, ), 

Patrick Burns

Burns Statistics
[EMAIL PROTECTED]
+44 (0)20 8525 0696
http://www.burns-stat.com
(home of S Poetry and A Guide for the Unwilling S User)
Stephane DRAY wrote:

Hi Tom,

Your approach did not work,

 do.call(cbind, as.list(my.names))
 [,1] [,2]
[1,] x  x2
but it helps me a lot to find the good one:

do.call(cbind, as.list(parse(text=my.names)))

Thanks,

At 14:56 24/03/2004, Tom Blackwell wrote:

I believe the syntax is

result - do.call(cbind, as.list(my.names))

Haven't checked this on your example, though.

-  tom blackwell  -  u michigan medical school  -  ann arbor  -

On Wed, 24 Mar 2004, Stephane DRAY wrote:

 Hello list,
 I have two vectors x and x2:

 x=runif(10)
 x2=runif(10)

 and one vectors with their names :

 my.names=c(x,x2)

 I would like to cbind these two vectors using their names contained 
in the
 vector my.names.
 I can create a string with comma
 ncomma=paste(my.names,collapse=,)

 and now, I just need a function to transform this string into a 
adequate
 argument for cbind:

 cbind(afunction(ncomma))

 Is there in R a function that can do the job ? If not, how can I do 
it ??

 Thanks in advance,
 Sincerely.


 Stéphane DRAY
 
-- 


 Département des Sciences Biologiques
 Université de Montréal, C.P. 6128, succursale centre-ville
 Montréal, Québec H3C 3J7, Canada

 Tel : 514 343 6111 poste 1233
 E-mail : [EMAIL PROTECTED]
 
-- 


 Web  
http://www.steph280.freesurf.fr/

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


Stéphane DRAY
-- 

Département des Sciences Biologiques
Université de Montréal, C.P. 6128, succursale centre-ville
Montréal, Québec H3C 3J7, Canada
Tel : 514 343 6111 poste 1233
E-mail : [EMAIL PROTECTED]
-- 

Web  
http://www.steph280.freesurf.fr/

__
[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] binding vectors or matrix using their names

2004-03-24 Thread Liaw, Andy
Gefore anyone jumps on me, I fibbed:

 From: Liaw, Andy
 
 Perhaps simler:
 
  x1 - 1:5
  x2 - 2:7

That should've been x2 - 2:6.  (I mistyped the first time, but
cut-and-pasted the wrong line...)

  xname - c(x1, x2)
  sapply(xname, get)
  x1 x2
 [1,]  1  2
 [2,]  2  3
 [3,]  3  4
 [4,]  4  5
 [5,]  5  6
 
 HTH,
 Andy
 
  From: Stephane DRAY
  
  Hi Tom,
  
  Your approach did not work,
  
do.call(cbind, as.list(my.names))
[,1] [,2]
  [1,] x  x2
  
  but it helps me a lot to find the good one:
  
  do.call(cbind, as.list(parse(text=my.names)))
  
  Thanks,
  
  
  At 14:56 24/03/2004, Tom Blackwell wrote:
  
  I believe the syntax is
  
  result - do.call(cbind, as.list(my.names))
  
  Haven't checked this on your example, though.
  
  -  tom blackwell  -  u michigan medical school  -  ann arbor  -
  
  On Wed, 24 Mar 2004, Stephane DRAY wrote:
  
Hello list,
I have two vectors x and x2:
   
x=runif(10)
x2=runif(10)
   
and one vectors with their names :
   
my.names=c(x,x2)
   
I would like to cbind these two vectors using their names 
  contained in the
vector my.names.
I can create a string with comma
ncomma=paste(my.names,collapse=,)
   
and now, I just need a function to transform this string 
  into a adequate
argument for cbind:
   
cbind(afunction(ncomma))
   
Is there in R a function that can do the job ? If not, 
  how can I do it ??
   
Thanks in advance,
Sincerely.
   
   
Stéphane DRAY

   
  --
  
   
Département des Sciences Biologiques
Université de Montréal, C.P. 6128, succursale centre-ville
Montréal, Québec H3C 3J7, Canada
   
Tel : 514 343 6111 poste 1233
E-mail : [EMAIL PROTECTED]

   
  --
  
   

   Web  
  http://www.steph280.freesurf.fr/
   

  __
[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
  
  Stéphane DRAY
  
  --
   
  
  Département des Sciences Biologiques
  Université de Montréal, C.P. 6128, succursale centre-ville
  Montréal, Québec H3C 3J7, Canada
  
  Tel : 514 343 6111 poste 1233
  E-mail : [EMAIL PROTECTED]
  --
   
  
  Web  
  http://www.steph280.freesurf.fr/
  
  
  __
  [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
 
 
 --
 
 Notice:  This e-mail message, together with any attachments, 
 contains information of Merck  Co., Inc. (One Merck Drive, 
 Whitehouse Station, New Jersey, USA 08889), and/or its 
 affiliates (which may be known outside the United States as 
 Merck Frosst, Merck Sharp  Dohme or MSD and in Japan, as 
 Banyu) that may be confidential, proprietary copyrighted 
 and/or legally privileged. It is intended solely for the use 
 of the individual or entity named on this message.  If you 
 are not the intended recipient, and have received this 
 message in error, please notify us immediately by reply 
 e-mail and then delete it from your system.
 --
 


__
[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] Problems with postscript output

2004-03-24 Thread Patrick Connolly
On Wed, 24-Mar-2004 at 12:23PM +0100, Philipp Pagel wrote:

|  Hi!
| 
|  I have a little problem with saving plots to file.  I use the command
|  postscript() followed by the plotting command and a dev.off().
|  
|  When I then look at the resulting image saved to disk, some of the
|  axis labels are missing (see attached image). Is there a way to fix
|  this. 
| 
| R is trying to be smart about labels getting too close/overlap. Specify the
| graph to be a little wider and the labels will appear.

Looks as though that one's already taking up a whole page.  Might be
simpler to reduce the axis.cex a tad (assuming the missing ones are
not more than 3 letters).

HTH

-- 
Patrick Connolly
HortResearch
Mt Albert
Auckland
New Zealand 
Ph: +64-9 815 4200 x 7188
~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~
I have the world`s largest collection of seashells. I keep it on all
the beaches of the world ... Perhaps you`ve seen it.  ---Steven Wright 
~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~

__
[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] Status of Rmpi--Good with tweaks

2004-03-24 Thread Ross Boylan
I have some more good news and some questions.

On Tue, 2004-03-23 at 20:50, Hao Yu wrote:
 Sorry. I have not been able to update Rmpi since the version
 0.4-4 on R site. 
I don't think any version of Rmpi is on the R site at the moment.

Minor aside: Also, it would be nice if the packages starting with R
were consistent about whether it's R or r.  Rmpi but rpvm is a
little dissonant.  Unfortunately, there seems to be no agreement.

 However, I have been using and testing Rmpi
 internally since 0.4-4. Now it is version 0.4-7. See the
 attached package. It requires R 1.8.1 (no more serialize
 package requirement) and works with the newest MPI-LAM
 versions 7. It will configure automatically if a rpm package
 from www.lam-mpi.org is used. I tested it on both Redhat 9
 and Debian. At least it passed the package check without any
 warning on Redhat 9. Now the problem is that it may have
 some problems with the default lam coming with Debian
 system. This is the reason why I hesitate to release it to
 R. 
I'm happy to report the Rmpi 0.4-7 installs and works without a problem
(or any necessary modification) on my Debian mostly testing system (it
does have some unstable stuff, but in particular it has the older
lam/mpi 6.5.8-2.  version 7 has been held in unstable for 60 days
because of some problems on alpha hardware).

Note this is not quite the lam in the current stable Debian distro,
which is at 6.5.6-6.
 
 I am also working on it to see if #ifdef can be used to work
 MPI 1.2 specs other than LAM-MPI. 
 Hopefully in a couple of months, I am able to submit a
 stable version to R.
Great.  Thanks.  I think it would be well worth making 0.4-7 available
at http://www.stats.uwo.ca/faculty/yu/Rmpi/.  I'll send you, off list,
the hacks I made to get the thing (starting with 0.4-6) to compile with
the MPI 1.2ish mpich.  It didn't run, but at least it did compile and
load at the end.

By the way, I'm in the dark about (r)sprng.  From some of the snow docs,
I thought that was really snow's business.  But your site notes that the
Rmpi packages are withough SPRNG support.  And Tony Rossini's pages (I
think) had a slightly cryptic remark that SPRNG under MPI was a bit
dicey.
 
 Regards,
 
 Hao 
 
 PS: Rmpi should still work without serializing as long as
 native MPI calls are used. The serializing is mainly used to
 help moving an arbitrarily R object around.
I don't completely follow that, since I don't control whether or not
native MPI calls are used, as far as I know.  Do you mean that Rmpi can
be used alone OK, but if you use snow (or, I guess Rmpi calls oriented
toward snow and the transmission of R objects) it will need the
serialize facility (prior to R 1.8)?

__
[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] Status of Rmpi--Good with tweaks

2004-03-24 Thread A.J. Rossini
Ross Boylan [EMAIL PROTECTED] writes:

 By the way, I'm in the dark about (r)sprng.  From some of the snow docs,
 I thought that was really snow's business.  But your site notes that the
 Rmpi packages are withough SPRNG support.  And Tony Rossini's pages (I
 think) had a slightly cryptic remark that SPRNG under MPI was a bit
 dicey.

SPRNG doesn't need to be invoked via MPI, but can be configured to use
it as the invocation/transport layer. 

It shouldn't matter to SNOW in the least, or rpvm.  I think it
shouldn't matter to Rmpi, but we won't have a cluster to play with for
a month or so.

Luke -- I've seen the gentle hints.

best,
-tony

-- 
[EMAIL PROTECTED]http://www.analytics.washington.edu/ 
Biomedical and Health Informatics   University of Washington
Biostatistics, SCHARP/HVTN  Fred Hutchinson Cancer Research Center
UW (Tu/Th/F): 206-616-7630 FAX=206-543-3461 | Voicemail is unreliable
FHCRC  (M/W): 206-667-7025 FAX=206-667-4812 | use Email

CONFIDENTIALITY NOTICE: This e-mail message and any attachme...{{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] debugging a code

2004-03-24 Thread Gabor Grothendieck
You also have carriage return as a debug command.  I think
you are looking for:

  ?recover

Fred J. phddas at yahoo.com writes:

: 
: Hello
: just learned HowTo but R, reminded me with the way
: Perl does it but with much less on-line commands, R
: AFAIK has n, c, Q and where and cann't debug outside
: the {}. 
: 
: 1) is there a more versatile/flexable debugging method
: for R?
: 
: I have saved 2 functions in an ASCII file digfun.
: getdata function calls squash function and both
: use loops. In another file.R I have
: 
: source(digfun)
: debug(getdata)
: data - getdata(c:/data/)
: 
: Browse[1] c
: Error in if (d[i, V3] == d[i + 1, V3]  d[i,
: V4] == d[i + 1, V4]   : 
:   missing value where TRUE/FALSE needed
: : traceback()
: 2: squash(dt1)
: 1: getdata(c:/data/)
: : 
: to dubug this I need to know the value of some
: variable at this particular loop/sub-fun loop case,
: and since the dubuger terminated by showing 
: prompt, how then I am going to debug this error?
: 
: thanks for helping
: 
: __
: R-help at stat.math.ethz.ch 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] Scaling of font sizes in layout()

2004-03-24 Thread Paul Murrell
Hi

Pisut Tempatarachoke wrote:
Hi all,

In the following example,

#--EXAMPLE--
test - function(subfigure)
{
plot(c(1:10),c(1:10),cex=4)
text(1,9,subfigure,cex=10)
}
m - matrix(c(1,2,5,5,3,4,5,5),4,2)
layout(m)
test(a)
test(b)
test(c)
test(d)
test(e)
#---
Is it possible to have the font (a,b,...,e) and pch sizes (including the 
axis-label, tick and tick-label sizes) scaled proportionally with the 
size of each plot when I put multiple plots on the same page?


When you have multiple figures, R tries to think for you and reduces the 
base size of text.  You can explicitly control this base size through 
par().  Does the following slight modification of your example do what 
you want?

test - function(subfigure)
{
plot(c(1:10),c(1:10),cex=4)
text(1,9,subfigure,cex=10)
}
m - matrix(c(1,2,5,5,3,4,5,5),4,2)
layout(m)
test(a)
test(b)
test(c)
test(d)
par(cex=1)
test(e)
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] http://cran.us.r-project.org/ inaccessible

2004-03-24 Thread Ross Boylan
For the last couple of days when I go to http://cran.us.r-project.org/ I
see only the left-hand margin logo and table of contents.  If I click on
one of the links there, I get a timeout.  Other sites (e.g.,
http://cran.stat.ucla.edu/) work fine for me.

Lacking complete confidence this is a bug*, as well as any better notion
of where to report this, I'm reporting it here.

*I have had problems accessing one other site,
http://www.oasis-open.org/, that is generally accessible.  It has been
suggested the problem is that oasis does not cope with congestion
notifications (ECN) properly, so it's not clear whether this is my
problem or the sites.

__
[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] if block and brackets

2004-03-24 Thread Fred J.
Hello
the maunal states When the if statement is not in a
block the else, if present, must appear on the same
line as statement1. Otherwise the new line at the end
of statement1 yields a syntactically complete
statement that is evaluated.
well, what is wrong with this if structure? I am
getting an error on the line where else is

thanks

  if (exists(f)){
dt - read.csv(file.path(d,f),header=F)#data frame
builddl(dt,f)
  else
for (i in dir(d)){
  dt -
read.csv(file.path(c:/data,i),header=F)#data frame
  an - sub(([^.]+)(\\..+),\\1, i))
builddl(dt,an)
  }
}

__
[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] statistical significance test for cluster agreement

2004-03-24 Thread Alexander Sirotkin \[at Yahoo\]
Christian,

I think I understand your point, but I do not
completely agree with you. I also did not describe 
my problem clear enough.

 If you see two
 clusterings on the same
 data, they are identical, if they are 100%
 identical, and if not, then
 not. 

What you are actually saying is that all values of 
Rand index for cluster agreement other then 1 
inidicate that clusters do not agree. I believe
that many people would disagree with this statement.

Let me explain my problem in a little bit more detail.

I have some classified data set. These classes were 
ontained using non-statistical methods. What I'm
trying
to do is run some clustering algorithm and compare
it's results to this known classification.

I think that this is not very different from
calculating mean and comparing it to some known value.

I think that is should be theoretically possible to
use
Rand index as a test statistic. 

Or maybe I'm missing something...

__
[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] http://cran.us.r-project.org/ inaccessible

2004-03-24 Thread Douglas Bates
Ross Boylan [EMAIL PROTECTED] writes:

 For the last couple of days when I go to http://cran.us.r-project.org/ I
 see only the left-hand margin logo and table of contents.  If I click on
 one of the links there, I get a timeout.  Other sites (e.g.,
 http://cran.stat.ucla.edu/) work fine for me.
 
 Lacking complete confidence this is a bug*, as well as any better notion
 of where to report this, I'm reporting it here.
 
 *I have had problems accessing one other site,
 http://www.oasis-open.org/, that is generally accessible.  It has been
 suggested the problem is that oasis does not cope with congestion
 notifications (ECN) properly, so it's not clear whether this is my
 problem or the sites.

cran.us.r-project.org is down temporarily.  We're not sure exactly
what happened but it looks like it was compromised.  Please use
another CRAN mirror for the next few days.

That machine is also rsync.r-project.org and cvs.r-project.org.  The
latter isn't very important to those not on the core development team
but it is very important to us and I have been working all afternoon
to bring the archive back up on another machine.  I think I have that
now.  Rsync and CRAN mirror will follow tomorrow.

-- 
Douglas Bates[EMAIL PROTECTED]
Statistics Department608/262-2598
University of Wisconsin - Madisonhttp://www.stat.wisc.edu/~bates/

__
[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] if block and brackets

2004-03-24 Thread Jason Turner
 what is wrong with this if structure? I am
 getting an error on the line where else is

 thanks

   if (exists(f)){
 dt - read.csv(file.path(d,f),header=F)#data frame
 builddl(dt,f)
   else

The block started by if(...){ isn't complete - it needs a matching }
before it is.  As such, the else is just hanging by itself.  An else
with no corresponding if is a syntax error.  This would be correct
(UNTESTED)

if (exists(f)){
  dt - read.csv(file.path(d,f),header=F)#data frame
  builddl(dt,f)
}
else

Cheers
Jason

__
[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] colors, lines, characters .... documentation

2004-03-24 Thread kjetil
On 24 Mar 2004 at 15:05, Monica Palaseanu-Lovejoy wrote:

 Hi,
 
 Very so often when i am plotting something, doing a histogram, or
 whatever i am struggling to find out which are the numbers for
 different colors, palette names, types of lines, symbols, etc. Is
 there any documentation on line with all these numbers / names and the
 associated symbol / color???
 

I do usually something like:

plot(1:20, rep(1,20), pch=1:20, col=1:20)
plot(1:20, 1:20, type=n)
for (i in 1:20) {
+lines( c(1,20), c(i,i), lty=i) }


 For example if i am using the command image it uses a palette 
 from red to yellow, with red the lowest value, and yellow the highest
 value. What if i want a reverse palette, with green the lowest value

:

palette(rev(palette()))
palette()
[1] grayyellow  magenta cyanbluegreen3  red
[8] black  


 and yellow middle values and red highest value??? Or much more simple,
 just yellow lowest value and red highest value???

See also the CRAN package RColorBrewer

Kjetil Halvorsen

 
 Thank you for assistance,
 
 Monica
 
 __
 [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] Ordered logit/probit

2004-03-24 Thread Leonard Assis
Anyone Knows how Shoud I Fit a Mixed Effects Ordered Logistic Model in
R? (lme?) 


[]s
Leonard Assis
Estatístico - CONFE 7439

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Valentin
Stanescu
Sent: quarta-feira, 24 de março de 2004 15:15
To: [EMAIL PROTECTED]
Subject: [R] Ordered logit/probit

Hello everyone
I am trying to fit an ordered probit/logit model for bank rating
prediction.
Besides polr() in MASS package which is not written especially for
this as far as I know, do you know how else I can do this?
I already found the modified polr () version on the


Valentin STANESCU

Enrst and Young
Tel. 402 4000
--
The information contained in this communication is intended solely for
the use of the individual or entity to whom it is addressed and others
authorized to receive it.   It may contain confidential or legally
privileged information.   If you are not the intended recipient you
are hereby notified that any disclosure, copying, distribution or
taking any action in reliance on the contents of this information is
strictly prohibited and may be unlawful. If you have received this
communication in error, please notify us immediately by responding to
this email and then delete it from your system. Ernst  Young is
neither liable for the proper and complete transmission of the
information contained in this communication nor for any delay in its
receipt.

Note: If you have received a delivery failure report, it may be due to
the change in the Ernst  Young e-mail domain from eyi.com to
ey.com.  Could you please make the necessary amendment, if required,
and resend the message.

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


Re: [R] Ordered logit/probit

2004-03-24 Thread kjetil
On 24 Mar 2004 at 20:14, Valentin Stanescu wrote:

 Hello everyone
 I am trying to fit an ordered probit/logit model for bank rating

The CRAN package MCMCpack has at least ordered probit. 

Kjetil Halvorsen

 prediction.
 Besides polr() in MASS package which is not written especially for
 this as far as I know, do you know how else I can do this? I already
 found the modified polr () version on the
 
 
 Valentin STANESCU
 
 Enrst and Young
 Tel. 402 4000
 --
 The information contained in this communication is intended solely for
 the use of the individual or entity to whom it is addressed and others
 authorized to receive it.   It may contain confidential or legally
 privileged information.   If you are not the intended recipient you
 are hereby notified that any disclosure, copying, distribution or
 taking any action in reliance on the contents of this information is
 strictly prohibited and may be unlawful. If you have received this
 communication in error, please notify us immediately by responding to
 this email and then delete it from your system. Ernst  Young is
 neither liable for the proper and complete transmission of the
 information contained in this communication nor for any delay in its
 receipt.
 
 Note: If you have received a delivery failure report, it may be due to
 the change in the Ernst  Young e-mail domain from eyi.com to
 ey.com.  Could you please make the necessary amendment, if required,
 and resend the message.
 
  [[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


RE: [R] binding vectors or matrix using their names

2004-03-24 Thread Bill.Venables
Goodness Patrick, this must surely qualify for the obfuscated R competition finals.  I 
love it!

There are two solutions I can think of with do.call and here they are:

 x - 1
 x2 - runif(10)
 x12 - c(x, x2)

 do.call(cbind, lapply(x12, as.name))
  x x2
 [1,] 1 0.99327265
 [2,] 1 0.63260097
 [3,] 1 0.17411170
 [4,] 1 0.54635634
 [5,] 1 0.75603670
 [6,] 1 0.27739270
 [7,] 1 0.32125068
 [8,] 1 0.01326344
 [9,] 1 0.37519602
[10,] 1 0.11133052

 do.call(cbind, lapply(x12, get))
  [,1]   [,2]
 [1,]1 0.99327265
 [2,]1 0.63260097
 [3,]1 0.17411170
 [4,]1 0.54635634
 [5,]1 0.75603670
 [6,]1 0.27739270
 [7,]1 0.32125068
 [8,]1 0.01326344
 [9,]1 0.37519602
[10,]1 0.11133052
 

I suspect the first offers a few advantages over the second, (which some other people 
have implicitly suggested).  The first preserves the names in the result.  Also, if 
the vectors are large, the second constructs a large language object and then 
evaluates it to get a large result.  The first uses the names rather than the objects 
themselves, so at least the language object is small, even if the result is not.

A more serious, philosophical word on Patrick's solution.  It is rarely necessary (in 
my limited experience, sure) to have to use parse() like this.  Where it provides a 
quick (kludgy?) solution I often find it a useful exercise to consider alternatives.  
They often come out simpler and you nearly always pick up something useful in the 
process.

Bill V.



-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Patrick Burns
Sent: Thursday, 25 March 2004 7:02 AM
To: Stephane DRAY
Cc: [EMAIL PROTECTED]; Stephane DRAY; Tom Blackwell
Subject: Re: [R] binding vectors or matrix using their names


I think you are looking for the eval-parse-text idiom:

eval(parse(text=paste(cbind(, paste(my.names, collapse=, ), 

Patrick Burns

Burns Statistics
[EMAIL PROTECTED]
+44 (0)20 8525 0696
http://www.burns-stat.com
(home of S Poetry and A Guide for the Unwilling S User)

Stephane DRAY wrote:

 Hi Tom,

 Your approach did not work,

  do.call(cbind, as.list(my.names))
  [,1] [,2]
 [1,] x  x2

 but it helps me a lot to find the good one:

 do.call(cbind, as.list(parse(text=my.names)))

 Thanks,


 At 14:56 24/03/2004, Tom Blackwell wrote:

 I believe the syntax is

 result - do.call(cbind, as.list(my.names))

 Haven't checked this on your example, though.

 -  tom blackwell  -  u michigan medical school  -  ann arbor  -

 On Wed, 24 Mar 2004, Stephane DRAY wrote:

  Hello list,
  I have two vectors x and x2:
 
  x=runif(10)
  x2=runif(10)
 
  and one vectors with their names :
 
  my.names=c(x,x2)
 
  I would like to cbind these two vectors using their names contained
 in the
  vector my.names.
  I can create a string with comma
  ncomma=paste(my.names,collapse=,)
 
  and now, I just need a function to transform this string into a
 adequate
  argument for cbind:
 
  cbind(afunction(ncomma))
 
  Is there in R a function that can do the job ? If not, how can I do
 it ??
 
  Thanks in advance,
  Sincerely.
 
 
  Stéphane DRAY
  
 -
 -

 
  Département des Sciences Biologiques
  Université de Montréal, C.P. 6128, succursale centre-ville 
  Montréal, Québec H3C 3J7, Canada
 
  Tel : 514 343 6111 poste 1233
  E-mail : [EMAIL PROTECTED]
  
 -
 -

 
  Web  
 http://www.steph280.freesurf.fr/
 
  __
  [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


 Stéphane DRAY
 --
 

 Département des Sciences Biologiques
 Université de Montréal, C.P. 6128, succursale centre-ville Montréal, 
 Québec H3C 3J7, Canada

 Tel : 514 343 6111 poste 1233
 E-mail : [EMAIL PROTECTED]
 --
 

 Web  
 http://www.steph280.freesurf.fr/

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

[R] if exists with regex return

2004-03-24 Thread Fred J.
Hello
I am trying for an hour now,  

 p - c:/data/
or 
 p - c:/data/abc.hig

d - sub((.+/.+?/)(.+),\\1,p,perl=TRUE)
f - sub((.+/.+?/)(.+)?,\\2,p,perl=TRUE)

if (exists(f)){ #why this gives TRUE no mater what?
do this with d and f
} else {
do that with d
}


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] if exists with regex return

2004-03-24 Thread Liaw, Andy
You assigned `f' whatever the result of
sub((.+/.+?/)(.+)?,\\2,p,perl=TRUE) is.  The only way for `f' not to
exist after that assignment (that I can think of anyway) is if there was an
error raised in the sub() call.  Otherwise `f' will always exist!  You
should simply check what value `f' has.  My guess is that you really want
something like:

  if (f == ) ...

or maybe:

  if (nchar(f) == 0) ...

Andy

 From: Fred J.
 
 Hello
 I am trying for an hour now,  
 
  p - c:/data/
 or 
  p - c:/data/abc.hig
   
 d - sub((.+/.+?/)(.+),\\1,p,perl=TRUE)
 f - sub((.+/.+?/)(.+)?,\\2,p,perl=TRUE)
 
 if (exists(f)){ #why this gives TRUE no mater what?
 do this with d and f
 } else {
 do that with d
 }
 
 
 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
 
 


--
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] statistical significance test for cluster agreement

2004-03-24 Thread Liaw, Andy
 From: Alexander Sirotkin [at Yahoo] [mailto:[EMAIL PROTECTED] 
 
 Christian,
 
 I think I understand your point, but I do not
 completely agree with you. I also did not describe 
 my problem clear enough.
 
  If you see two
  clusterings on the same
  data, they are identical, if they are 100%
  identical, and if not, then
  not. 
 
 What you are actually saying is that all values of 
 Rand index for cluster agreement other then 1 
 inidicate that clusters do not agree. I believe
 that many people would disagree with this statement.
 
 Let me explain my problem in a little bit more detail.
 
 I have some classified data set. These classes were 
 ontained using non-statistical methods. What I'm
 trying
 to do is run some clustering algorithm and compare
 it's results to this known classification.
 
 I think that this is not very different from
 calculating mean and comparing it to some known value.

AFAICS they are most definitely not the same.  The hypotheses in statistical
tests are about `true', unknown, population mean, not the sample mean
observed in the data.  What exactly would be the hypotheses you intend to
test?  If you are testing whether the clustering algorithm produces
something that disagree with the non-statistical classification, then one
disagreement would have settled it, no?  Before you think about what
statistic to use, do try to figure out how you would write the null and
alternative hypotheses, mathematically.

Andy

 
 I think that is should be theoretically possible to
 use
 Rand index as a test statistic. 
 
 Or maybe I'm missing something...
 
 __
 Do you Yahoo!?
 Yahoo! Finance Tax Center - File online. File on time.
 http://taxes.yahoo.com/filing.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] Status of Rmpi--Good with tweaks

2004-03-24 Thread Na Li
On 24 Mar 2004, Ross Boylan outgrape:

 By the way, I'm in the dark about (r)sprng.  From some of the snow docs,
 I thought that was really snow's business.  But your site notes that the
 Rmpi packages are withough SPRNG support.  And Tony Rossini's pages (I
 think) had a slightly cryptic remark that SPRNG under MPI was a bit
 dicey.

rsprng works like this: each process calls the function init.sprng, with
three pieces of information: 1) the total number of processes; 2) the rank
of current process; 3) a seed that is the same for all processes.

An alternative is that the master generates say ten streams, and send one
stream to each slave (and keep track of who gets what, to ensure
reproducibility).

Only very little (and simple) inter-process communication is required for
SPRNG. The communication layer is orthogonal of SPRNG itself.  rsprng can
be used with Rmpi just fine.  (SPRNG can be used in serial code as well.)

If you look at SPRNG source, it has some sort of MPI support, which is
disabled when I compile SPRNG.  See this note:

http://www.biostat.umn.edu/~nali/RsprngNotes.php

Cheers,

Michael

__
[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] debugging a code

2004-03-24 Thread Prof Brian Ripley
Using debugger() for post-mortem debugging is the best way to chase down 
the immediate cause of an error, which seems to be the issue here.

If you use debug() (which is not a `dubuger') you need to single-step
(with n), and look at values just before the line in which the error
occurs.

There are a lot of good books out there and, `Fred J.', it looks to be 
time you started reading them as you are asking a lot of questions they do 
answer.


On Wed, 24 Mar 2004, Liaw, Andy wrote:

 Well, you can insert `browser()' right above the offending line, then run
 the code again.  It will stop with the `browse' prompt right before that
 line.  You can then check which value(s) give you the problem.
 
 Have you tried Mark Bravington's `debug' package on CRAN?  There's an
 article on it in the most recent issue of R News.
 
 Andy
 
  From: Fred J.
  
  Hello
  just learned HowTo but R, reminded me with the way
  Perl does it but with much less on-line commands, R
  AFAIK has n, c, Q and where and cann't debug outside
  the {}. 
  
  1) is there a more versatile/flexable debugging method
  for R?
  
  I have saved 2 functions in an ASCII file digfun.
  getdata function calls squash function and both
  use loops. In another file.R I have
  
  source(digfun)
  debug(getdata)
  data - getdata(c:/data/)
  
  Browse[1] c
  Error in if (d[i, V3] == d[i + 1, V3]  d[i,
  V4] == d[i + 1, V4]   : 
  missing value where TRUE/FALSE needed
   traceback()
  2: squash(dt1)
  1: getdata(c:/data/)
   
  to dubug this I need to know the value of some
  variable at this particular loop/sub-fun loop case,
  and since the dubuger terminated by showing 
  prompt, how then I am going to debug this error?

You are not even in the `debugger', sic.

-- 
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] if block and brackets

2004-03-24 Thread Prof Brian Ripley
On Wed, 24 Mar 2004, Fred J. wrote:

 Hello
 the maunal states When the if statement is not in a
 block the else, if present, must appear on the same
 line as statement1. Otherwise the new line at the end
 of statement1 yields a syntactically complete
 statement that is evaluated.
 well, what is wrong with this if structure? I am
 getting an error on the line where else is

The else is inside a { } block.

If you use a good editor and proper indentation such errors will be 
obvious to you.

 
 thanks
 
   if (exists(f)){
 dt - read.csv(file.path(d,f),header=F)#data frame
 builddl(dt,f)
   else
 for (i in dir(d)){
   dt -
 read.csv(file.path(c:/data,i),header=F)#data frame
   an - sub(([^.]+)(\\..+),\\1, i))
 builddl(dt,an)
   }
 }
 
 __
 [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] geoR - help for bayesian modelling

2004-03-24 Thread Ole F. Christensen
Dear Monica

Guess the reason for the problem you are seeing is that you are 
requiring simulations from the predictive distribution. geoR is doing 
this simulation in a joint step, simulating from the joint predictive 
distriubtion [as far as I know some other geostatistical software 
packages are doing such simulation in a sequential way, where a point 
the grid is added at a time]. For a relatively large grid the covariance 
matrix needed for this joint simulation is large [in your example a 
matrix of size 7500 by 7500].

Possible solutions :

* Do you really want simulations from the multivariate predictive 
distribution ? What do you want to do with them ?
Most summaries you would want of the predictive distribution are 
summaries of the univariate distributions at individual locations.

* Do you really need to predict in a 150 by 250 grid ? If possible, then 
reduce the size of your grid.

The error you are seeing is related to the cholesky factorisation of the 
covariance matrix, which is needed to do the joint simulations. If you 
do not require these simulations, the error will disappear.
As you write, the error is probably due to some locations being very 
close to data locations. As I remember there is an internal handling in 
the package of prediction locations close to data locations, but your 
locations are not sufficiently near to the data locations to be handled 
by this. Maybe you should change the prediction coordinates in question 
such that they actually do coincide with the data locations.

Hope this is helpful

Cheers

Ole

***

Hi,

I am trying to do a bayesian prediction for soil pollution data above 
a certain threshold, using geoR. 

Everything is working fine until i am doing the krig.bayes. I tried to 
do the prediction on a grid 67 by 113 cells and my computer is 
freezing to death. At larger numbers of cells it tells me after a while 
that it reaches the max. memory of 511 Mb. My computer has only 
512 Mb of RAM. What RAM capacity should i look for to do a 150 
x 250 cell grid???

If i want to do the prediction on my initial data locations (well, 
actually the prediction points are shifted 1 m in X and respectively 
Y direction, so the raw data coordinates don't coincide with the 
prediction coordinates) i am getting the following error using the 
command:

zn.bayes - krige.bayes(zn.gdata, loc = xy, model = 
model.control(cov.model = exponential, lambda = 0), prior = 
prior.control(phi.prior =exponential, phi = 89.1894), 
output=output.control(n.predictive=2, mean.var = TRUE, quantile = 
c(0.025,0.25, 0.5, 0.75, 0.975), threshold = c(300)))

Error in cond.sim(env.loc = base.env, env.iter = iter.env, 
loc.coincide = get(loc.coincide,  : 
   chol: matrix not pos def, diag[13]= -1.279220e-018

I will really appreciate any suggestion you may have.

Thank you so much,

Monica

--
Ole F. Christensen
Center for Bioinformatik
Aarhus Universitet
Ny Munkegade, Bygning 540
8000 Aarhus C
__
[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] First Variable in lm

2004-03-24 Thread Christian Hoffmann
 I want to take the first variable (column) of a data frame and regress
 it against all other variables.

 bla - function (dat) {
reg - lm(whateverthefirstofthevariablenamesis ~., data=dat)
return(reg)
 }


Thanks to all who answered my question:

Prof. Brian Ripley:
---
bla - function (dat)
  eval(substitute(lm(foo ~., data=dat), list(foo=as.name(names(dat)[1]
which has the advantage of embedding a clean value of $call.

[EMAIL PROTECTED]:

lm(formula = dat)
[EMAIL PROTECTED]:
-
for(j in 1:ncol(dat)) {
fff - as.formula(paste(names(dat)[j],~,
  paste(names(dat)[-j],collapse=+)))
nm - paste(rslt,j,sep=.)
assign(nm,lm(fff,data=dat))
}
[EMAIL PROTECTED]
---
data(longley)
lm( longley[,7] ~. , data = longley[,-7] )
You cannot call data() inside a function:
  data(dat)
  reg - lm(dat[,1] ~ dat[,-1])
Error in model.frame(formula, rownames, variables, varnames, extras, 
extranames,  :
	invalid variable type
In addition: Warning message:
Data set 'dat' not found in: data(dat)

Regards
Christian
--
Dr.sc.math.Christian W. Hoffmann, 
http://www.wsl.ch/staff/christian.hoffmann
Mathematics + Statistical Computing   e-mail: [EMAIL PROTECTED]
Swiss Federal Research Institute WSL  Tel: ++41-44-73922-   -77  (office)
CH-8903 Birmensdorf, Switzerland -11(exchange), -15  (fax)

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