Re: [R] effect sizes for Wilcoxon tests

2005-11-16 Thread Torsten Hothorn


On Tue, 15 Nov 2005, Thomas Lumley wrote:

 On Tue, 15 Nov 2005, Claus Atzenbeck wrote:

  On Tue, 15 Nov 2005, Peter Dalgaard wrote:
 
  However, for Wilcoxon tests, the formula for effect sizes is:
  r = Z / sqrt(N)
 
  I wonder how I can calculate the Z-score in R for a Wilcoxon test.
 
  Does anyone know how to calculate effect sizes for Wilcoxon tests as
  SPSS can do? I wonder if it would be very difficult to do so with R.
 
  If the above formula is correct, it can't be hard. What I wonder is
  whether (and if so, how) it makes sense. ( the fact that SPSS does it
  is no guarantee...)
 
  According to my references, the formula is OK.
 

 I think you have misinterpreted the direction of Peter's scepticism. The
 question is whether an effect size defined this way means anything useful.
 For example, even if your data are Normally distributed with equal
 variance this definition will not agree with the definition based on the
 mean. This is only the start of the potential problems, especially if the
 distributions do not have the same shape.


  However, how do I get Z from a Wilcoxon test in R?

 wtest - wilcox.test(y~group,data=d, alternative=greater)
 qnorm(wtest$p.value)


or

library(coin)
statistic(wilcox_test(y ~ group, data = d, ...), type = standardized)

where the variance `estimator' takes care of tied observations.

Best,

Torsten


   -thomas

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



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


Re: [R] effect sizes for Wilcoxon tests

2005-11-16 Thread Claus Atzenbeck
On Tue, 15 Nov 2005, Thomas Lumley wrote:

 I think you have misinterpreted the direction of Peter's scepticism.
 The question is whether an effect size defined this way means anything
 useful. For example, even if your data are Normally distributed with
 equal variance this definition will not agree with the definition
 based on the mean. This is only the start of the potential problems,
 especially if the distributions do not have the same shape.

I see the point. The book that I use (it is a kind of practical guide)
calculates the effect sizes of Mann-Whitney tests  and compares it to
Cohen's benchmarks (small effect: r=.10 -- medium effect: r=.30 -- large
effect: r=.50). This was also my plan. However, as far as I understand
you and Peter, the formula is not appropriate for comparison with
Cohen's benchmarks?

  However, how do I get Z from a Wilcoxon test in R?

 wtest - wilcox.test(y~group,data=d, alternative=greater)
 qnorm(wtest$p.value)

Thanks, also to Peter.

Claus

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


Re: [R] www.krankenversicherung.ch News - Krankenkassen - Information Newsletter

2005-11-16 Thread Martin Maechler
 Hans-Peter == Hans-Peter  [EMAIL PROTECTED]
 on Tue, 15 Nov 2005 16:10:35 +0100 writes:

Hans-Peter Am 14.11.05 schrieb [EMAIL PROTECTED] [EMAIL PROTECTED]:
 [snip some spam]

Hans-Peter Being located only some blocks away from these spammers, I just 
asked
Hans-Peter them in person to remove the R list from their database.


Vielen Dank,
Hans-Peter.

Es betrifft auch noch andere  R-..@stat.math.ethz.ch  
Listen.

Und dann könnte man doch gleich alle @...ethz.ch auch streichen...

Aber eigentlich müssten die davon überzeugt werden können, nicht
mehr zu spammen.

Mit liebem Gruss,
Martin Mächler
(R- Mailing List Administrator)

Martin [EMAIL PROTECTED]  http://stat.ethz.ch/people/maechler
Seminar fuer Statistik, ETH-Zentrum  LEO C16Leonhardstr. 27
ETH (Federal Inst. Technology)  8092 Zurich SWITZERLAND
phone: +41-44-632-3408  fax: ...-1228   

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


[R] spatial statistics on images, any packages?

2005-11-16 Thread Koen Hufkens
Hi list,

Is there a package that covers the evaluation of spatial statistics on 
images and not on point data? I've converted an image matrix to x, y 
coordinates and a measurement value but evaluation with the package 
spdep (not really designed for image data I suppose) is unworkable. Any 
suggestions?

Regards,
Koen

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


[R] matrix assembly

2005-11-16 Thread Robin Hankin
Hi

I have a function f(k,l) which returns a matrix for integer k and l.
I want to call f(.,.) for each combination of a supplied vector (as  
in expand.grid())
and then I want to assemble these matrices into one big one using
k and l to index the position of the submatrices returned by f(k,l).

Toy example follows.


f - function(k,l){
matrix(k+l , k , l)
}

and I want to call f() with each combination of c(1,3)
for the first argument and c(2,4,5) for the second
and then assemble the resulting matrices.

I can do it piecemeal:

a - c(1,3)
b - c(2,4,5)
expand.grid(a,b)
   Var1 Var2
112
232
314
434
515
635
  cbind(rbind(f(1,2),f(3,2)) , rbind(f(1,4),f(3,4)) , rbind(f(1,5),f 
(3,5)))
  [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11]
[1,]335555666 6 6
[2,]557777888 8 8
[3,]557777888 8 8
[4,]557777888 8 8

[see how the calls to f(. , .) follow the rows of expand.grid(a,b)]


How to do this in a nice vectorized manner?



--
Robin Hankin
Uncertainty Analyst
National Oceanography Centre, Southampton
European Way, Southampton SO14 3ZH, UK
  tel  023-8059-7743

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


Re: [R] effect sizes for Wilcoxon tests

2005-11-16 Thread Peter Dalgaard
Torsten Hothorn [EMAIL PROTECTED] writes:
[snip]

   However, how do I get Z from a Wilcoxon test in R?
 
  wtest - wilcox.test(y~group,data=d, alternative=greater)
  qnorm(wtest$p.value)
 
 
 or
 
 library(coin)
 statistic(wilcox_test(y ~ group, data = d, ...), type = standardized)
 
 where the variance `estimator' takes care of tied observations.

Doesn't it do that in the same way as inside wilcox.test(...,exact=FALSE)?

Just wondering.

-p

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

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


[R] Histogram font

2005-11-16 Thread Christopher Willmot
The hist() command produces this message on my machine...

Error in title(main = main, sub = sub, xlab = xlab, ylab = ylab, ...) :
 X11 font at size 14 could not be loaded

How can I either (a) determine what font is required,
  or (b) specify one of the fonts I have available?

This problem is specific to hist(), plot() works fine.
I am using R on SuSE Linux v9.3, from the KDE desktop.

-- 
Christopher Willmot

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


Re: [R] www.... News - Krankenkassen - ....

2005-11-16 Thread Martin Maechler
Sorry to everyone -- I'm deeply embarrassed that this private
reply (to Hans-Peter) accidentally went to the whole R-help list.

It's bad enough (and inavoidable as long as we keep the list
open) that real spam occasionally goes through, but 
of all people, I should know better and be more careful 

Martin Maechler, ETH Zurich

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


Re: [R] effect sizes for Wilcoxon tests

2005-11-16 Thread torsten

On Wed, 16 Nov 2005, Peter Dalgaard wrote:

 Torsten Hothorn [EMAIL PROTECTED] writes:
 [snip]

However, how do I get Z from a Wilcoxon test in R?
  
   wtest - wilcox.test(y~group,data=d, alternative=greater)
   qnorm(wtest$p.value)
  
 
  or
 
  library(coin)
  statistic(wilcox_test(y ~ group, data = d, ...), type = standardized)
 
  where the variance `estimator' takes care of tied observations.

 Doesn't it do that in the same way as inside wilcox.test(...,exact=FALSE)?


My understanding was that `wilcox.test' implements the unconditional version
(with unconditional variance estimator and some `adjustment' for ties) and
`wilcox_test' implements the conditional version of the test (of course both
coincide when there are no ties).

However, some quick experiments suggest that the standardized statistic is
the same for both versions (with correct = FALSE) for tied observations.
One needs to check if the expectation and variance formulae in
`wilcox.test' are equivalent with the conditional versions used in
`wilcox_test' (in contrast to my initial opinion).

Best,

Torsten

 Just wondering.

 -p

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


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

[R] natural selection coefficient S

2005-11-16 Thread Federico Calboli
Hi everyone,

before I embark in some coding, can I ask if there is any function in
any of the packages on CRAN dealing with the natural selection
coefficient S?

At the moment I am more curious to see it has been implemented already
in R, rather than what specific implementation.

Regards,

Federico Calboli
-- 
Federico C. F. Calboli
Department of Epidemiology and Public Health
Imperial College, St Mary's Campus
Norfolk Place, London W2 1PG

Tel  +44 (0)20 7594 1602 Fax (+44) 020 7594 3193

f.calboli [.a.t] imperial.ac.uk
f.calboli [.a.t] gmail.com

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


[R] Friedman test with replicated samples

2005-11-16 Thread Alessandro Bigi
Dear R-users,
I would need to do a Friedman test with replicated samples, and 
Friedman.test(y...) currently works only for unreplicated designs.
Is there a script or a function available?
Thanks,

Alessandro


-- 







--

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


Re: [R] y-axis in histograms

2005-11-16 Thread Jim Lemon
Michael Graber wrote:
 Dear R- list,
 I have some data to present with histograms. Therefore I used hist(...). 
 I have few values with almost 80% of
 the frequencies (totaly 800) and some other values with low frequencies 
 ( totaly 5 -10 )
 that I want to emphasize. Therefore I want to cut the y-axis on 100, 
 but I
 don't know how to deal with this.
 
If you mean that you would like to have an axis break from 10 to 100, 
you can try this:

# be creative, make up some data
fakedat-c(sample(1:6,50,TRUE),sample(7:9,1000,TRUE))
# get the histogram counts
# note that I have to explicitly specify breaks
fakehist-hist(fakedat,breaks=0:10,type=n)
# here's a rough function
gap.barplot-function(y,gap,x=NA,xlabels=NA,col=NULL,...) {
  if(missing(y) || missing(gap))
   stop(Must pass at least y and gap)
  littleones-which(y=gap[1])
  bigones-which(y=gap[2])
  if(length(bigones)+length(littleones) != length(y))
   warning(gap includes some values of y)
  gapsize-gap[2]-gap[1]
  if(is.na(x)) x-1:length(y)
  if(is.na(xlabels)) xlabels-as.character(x)
  xlim-range(x)
  ylim-c(min(y),max(y)-gapsize)
  plot(0,xlim=xlim,ylim=ylim,axes=FALSE,type=n,...)
  box()
  axis(1,at=x,labels=xlabels)
  ytics-pretty(y)
  littletics-which(yticsgap[1])
  bigtics-which(ytics=gap[2])
  axis(2,at=c(ytics[littletics],ytics[bigtics]-gapsize),
   labels=c(ytics[littletics],ytics[bigtics]))
  axis.break(2,gap[1])
  halfwidth-min(diff(x))/2
  plot.lim-par(usr)
  rect(x-halfwidth,plot.lim[3],x+halfwidth,
   c(y[littleones],y[bigones]-gapsize),
   col=col)
  abline(h=gap[1],col=white,lwd=5)
}
gap.barplot(fakehist$counts,gap=c(100,295))

Jim

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


Re: [R] spatial statistics on images, any packages?

2005-11-16 Thread Roger Bivand
On Wed, 16 Nov 2005, Koen Hufkens wrote:

 Hi list,
 
 Is there a package that covers the evaluation of spatial statistics on 
 images and not on point data? I've converted an image matrix to x, y 
 coordinates and a measurement value but evaluation with the package 
 spdep (not really designed for image data I suppose) is unworkable. Any 
 suggestions?

It depends what you are trying to do, also please consider re-posting on 
the R-sig-geo list. Yes, constructing a neighbour list for a large image - 
millions of points and thus potentially very many neighbours - is not what 
spdep is dimensioned for. Advice will depend on your research problem.

 
 Regards,
 Koen
 
-- 
Roger Bivand
Economic Geography Section, Department of Economics, Norwegian School of
Economics and Business Administration, Helleveien 30, N-5045 Bergen,
Norway. voice: +47 55 95 93 55; fax +47 55 95 95 43
e-mail: [EMAIL PROTECTED]

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


Re: [R] Histogram font

2005-11-16 Thread Roger Bivand
On Wed, 16 Nov 2005, Christopher Willmot wrote:

 The hist() command produces this message on my machine...
 
 Error in title(main = main, sub = sub, xlab = xlab, ylab = ylab, ...) :
  X11 font at size 14 could not be loaded
 
 How can I either (a) determine what font is required,
   or (b) specify one of the fonts I have available?
 
 This problem is specific to hist(), plot() works fine.
 I am using R on SuSE Linux v9.3, from the KDE desktop.

Try searching the mailing list, this feels like:

http://finzi.psych.upenn.edu/R/Rhelp02a/archive/20511.html

-- 
Roger Bivand
Economic Geography Section, Department of Economics, Norwegian School of
Economics and Business Administration, Helleveien 30, N-5045 Bergen,
Norway. voice: +47 55 95 93 55; fax +47 55 95 95 43
e-mail: [EMAIL PROTECTED]

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


Re: [R] Replace missing values in spatial design using moving average

2005-11-16 Thread Roger Bivand
On Wed, 9 Nov 2005, Arnaud Dowkiw wrote:

 Dera R helpers,
 
 I have a (x,y,z) data file where x and y are spatial coordinates and z a 
 variable. I have some missing values in the z column and I would like to 
 replace them with an optimized estimation from the neighbour cells. I could 
 not find any function in R to do that. Is anybody aware of such function ? 
 Maybe someone knows how to implement the Papadakis method in R...
 Thanks for your help,

I'm not sure about the Papadakis method, I don't think it is there, though 
could be implemented using standard tools. Ripley (1981) relates the 
method to SAR and CAR models, but predicting with them is far from easy 
(there are papers by Martin from the 1980's about this). Are 
geostatistical methods an option for you? That is, what is the support of 
your cells?

 
 Arnaud DOWKIW
 
 - - - - - - - - - - - - - - - - - - - - - - -
 Arnaud DOWKIW
 INRA
 Unité Amélioration Génétique et Physiologie Forestières
 2163 avenue de la Pomme de Pin
 BP 20619 ARDON
 45166 OLIVET CEDEX
 FRANCE
 Tel. + 33 2 38 41 78 00
 Fax. + 33 2 38 41 48 09
 - - - - - - - - - - - - - - - - - - - - - - -
 
 __
 R-help@stat.math.ethz.ch mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
 

-- 
Roger Bivand
Economic Geography Section, Department of Economics, Norwegian School of
Economics and Business Administration, Helleveien 30, N-5045 Bergen,
Norway. voice: +47 55 95 93 55; fax +47 55 95 95 43
e-mail: [EMAIL PROTECTED]

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


Re: [R] effect sizes for Wilcoxon tests

2005-11-16 Thread Peter Dalgaard
[EMAIL PROTECTED] writes:

 On Wed, 16 Nov 2005, Peter Dalgaard wrote:
 
  Torsten Hothorn [EMAIL PROTECTED] writes:
  [snip]
 
 However, how do I get Z from a Wilcoxon test in R?
   
wtest - wilcox.test(y~group,data=d, alternative=greater)
qnorm(wtest$p.value)
   
  
   or
  
   library(coin)
   statistic(wilcox_test(y ~ group, data = d, ...), type = standardized)
  
   where the variance `estimator' takes care of tied observations.
 
  Doesn't it do that in the same way as inside wilcox.test(...,exact=FALSE)?
 
 
 My understanding was that `wilcox.test' implements the unconditional version
 (with unconditional variance estimator and some `adjustment' for ties) and
 `wilcox_test' implements the conditional version of the test (of course both
 coincide when there are no ties).
 
 However, some quick experiments suggest that the standardized statistic is
 the same for both versions (with correct = FALSE) for tied observations.
 One needs to check if the expectation and variance formulae in
 `wilcox.test' are equivalent with the conditional versions used in
 `wilcox_test' (in contrast to my initial opinion).


I think you'll find that they are the same. There isn't really an
unconditional variance formula in the presence of ties - I don't think
you can do that without knowing what the point masses are in the
underlying distribution. The question is only whether the tie
corrected statistic is an asymptotic approximation or an exact formula
for the variance. I believe it is the latter.

What you need to calculate is the expectation and variance of the
(possibly tied) rank of a particular observation, given the sets of
tied observations. In principle, also the covariance between two of
them, but this is easily seen to be equal to -1/(N-1) times the
variance since they are all equal and the rows/columns of the
covariance sums to zero.

The expectation is a no-brainer: tie-breaking preserves the sum of
ranks so the average rank is left unchanged by ties. 

The fun bit is trying to come up with an elegant argument why the
correction term for the variances, involving sum(NTIES.CI^3 -
NTIES.CI) is exact. I think you can do it by saying that breaking a
set of tied ranks randomly corresponds to adding a term which has a
variance related to that of a random number between 1 and d, with
probability d/N . Notice that sum((1:d)^2) - sum(1:d)^2 is (d^3-d)/3.
After breaking the ties at random, you should end up with the untied
situation, so you get the tied variance by subtracting the variance of
the tie-breaking terms.

Tying up the loose ends is left as an exercise


 Best,
 
 Torsten
 
  Just wondering.
 
  -p
 
  --
 O__   Peter Dalgaard Øster Farimagsgade 5, Entr.B
c/ /'_ --- Dept. of Biostatistics PO Box 2099, 1014 Cph. K
   (*) \(*) -- University of Copenhagen   Denmark  Ph:  (+45) 35327918
  ~~ - ([EMAIL PROTECTED])  FAX: (+45) 35327907
 
 

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

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


Re: [R] matrix assembly

2005-11-16 Thread Dimitris Rizopoulos
a crude approach is the following:

f - function(x){
k - x[1]
l - x[2]
matrix(k + l, k , l)
}
a - c(1, 3)
b - c(2, 4, 5)
combs - expand.grid(a, b)

do.call(cbind, lapply(split(combs, combs$Var2), function(x) 
do.call(rbind, apply(x, 1, f


I hope it helps.

Best,
Dimitris


Dimitris Rizopoulos
Ph.D. Student
Biostatistical Centre
School of Public Health
Catholic University of Leuven

Address: Kapucijnenvoer 35, Leuven, Belgium
Tel: +32/(0)16/336899
Fax: +32/(0)16/337015
Web: http://www.med.kuleuven.be/biostat/
 http://www.student.kuleuven.be/~m0390867/dimitris.htm


- Original Message - 
From: Robin Hankin [EMAIL PROTECTED]
To: RHelp r-help@stat.math.ethz.ch
Sent: Wednesday, November 16, 2005 11:10 AM
Subject: [R] matrix assembly


 Hi

 I have a function f(k,l) which returns a matrix for integer k and l.
 I want to call f(.,.) for each combination of a supplied vector (as
 in expand.grid())
 and then I want to assemble these matrices into one big one using
 k and l to index the position of the submatrices returned by f(k,l).

 Toy example follows.


 f - function(k,l){
 matrix(k+l , k , l)
 }

 and I want to call f() with each combination of c(1,3)
 for the first argument and c(2,4,5) for the second
 and then assemble the resulting matrices.

 I can do it piecemeal:

 a - c(1,3)
 b - c(2,4,5)
 expand.grid(a,b)
   Var1 Var2
 112
 232
 314
 434
 515
 635
  cbind(rbind(f(1,2),f(3,2)) , rbind(f(1,4),f(3,4)) , rbind(f(1,5),f
 (3,5)))
  [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11]
 [1,]335555666 6 6
 [2,]557777888 8 8
 [3,]557777888 8 8
 [4,]557777888 8 8

 [see how the calls to f(. , .) follow the rows of expand.grid(a,b)]


 How to do this in a nice vectorized manner?



 --
 Robin Hankin
 Uncertainty Analyst
 National Oceanography Centre, Southampton
 European Way, Southampton SO14 3ZH, UK
  tel  023-8059-7743

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


Disclaimer: http://www.kuleuven.be/cwis/email_disclaimer.htm

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


[R] numericDeriv

2005-11-16 Thread Florent Bresson
I have to compute some standard errors using the delta
method and so have to use the command numericDeriv
to get the desired gradient. Befor using it on my
complicated function, I've done a try with a simple
exemple :

x - 1:5
numericDeriv(quote(x^2),x)

and i get :

[1]   1   8  27  64 125 216
attr(,gradient)
 [,1] [,2] [,3] [,4] [,5] [,6]
[1,]  Inf00  NaN00
[2,]000  NaN00
[3,]0  Inf0  NaN00
[4,]000  NaN00
[5,]00  Inf  NaN00
[6,]000  NaN00

I don't understand the result. I thought I will get :

[1]   1   8  27  64 125 216
attr(,gradient)
 [,1]
[1,]  1
[2,]  4
[3,]  6
[4,]  8
[5,]  10
[6,]  12

The derivative of x^2 is still 2x, isn't it ?

Thanks for help

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


Re: [R] Histogram font

2005-11-16 Thread Prof Brian Ripley
On Wed, 16 Nov 2005, Christopher Willmot wrote:

 The hist() command produces this message on my machine...

 Error in title(main = main, sub = sub, xlab = xlab, ylab = ylab, ...) :
 X11 font at size 14 could not be loaded

 How can I either (a) determine what font is required,
  or (b) specify one of the fonts I have available?

?options (see option X11fonts).

 This problem is specific to hist(), plot() works fine.
 I am using R on SuSE Linux v9.3, from the KDE desktop.

This usually means that 100dpi fonts are missing or not in the X11 font 
path.  The code assumes that the standard 75dpi and where necessary 100dpi 
fonts are installed.

The issue is title(), not hist() and not plot() as the error message 
shows.  So calling plot(main=) would also fail.

-- 
Brian D. Ripley,  [EMAIL PROTECTED]
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford, Tel:  +44 1865 272861 (self)
1 South Parks Road, +44 1865 272866 (PA)
Oxford OX1 3TG, UKFax:  +44 1865 272595

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


Re: [R] matrix assembly

2005-11-16 Thread Gabor Grothendieck
On 11/16/05, Robin Hankin [EMAIL PROTECTED] wrote:
 Hi

 I have a function f(k,l) which returns a matrix for integer k and l.
 I want to call f(.,.) for each combination of a supplied vector (as
 in expand.grid())
 and then I want to assemble these matrices into one big one using
 k and l to index the position of the submatrices returned by f(k,l).

 Toy example follows.


 f - function(k,l){
 matrix(k+l , k , l)
 }

 and I want to call f() with each combination of c(1,3)
 for the first argument and c(2,4,5) for the second
 and then assemble the resulting matrices.

 I can do it piecemeal:

 a - c(1,3)
 b - c(2,4,5)
 expand.grid(a,b)
   Var1 Var2
 112
 232
 314
 434
 515
 635
  cbind(rbind(f(1,2),f(3,2)) , rbind(f(1,4),f(3,4)) , rbind(f(1,5),f
 (3,5)))
  [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11]
 [1,]335555666 6 6
 [2,]557777888 8 8
 [3,]557777888 8 8
 [4,]557777888 8 8

 [see how the calls to f(. , .) follow the rows of expand.grid(a,b)]


 How to do this in a nice vectorized manner?


Replacing your example with the appropriate do.call and lapply
calls gives this:

do.call(cbind, lapply(b, function(x) do.call(rbind, lapply(a, f, l = x

or one can do the cbind in the inner loop and the rbind in the outer
giving the same result:

 do.call(rbind, lapply(a, function(x) do.call(cbind, lapply(b, f, k = x

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


Re: [R] www.... News - Krankenkassen - ....

2005-11-16 Thread Thomas Schönhoff
Hello Martin,

2005/11/16, Martin Maechler [EMAIL PROTECTED]:
 Sorry to everyone -- I'm deeply embarrassed that this private
 reply (to Hans-Peter) accidentally went to the whole R-help list.

 It's bad enough (and inavoidable as long as we keep the list
 open) that real spam occasionally goes through, but
 of all people, I should know better and be more careful 

In the end there is only a very small segment of spam getting the spam
filters, not to say: Great job, no reason to worry.
After all, finally everone has the possiblity to also kill spam in its
only mail client aterwards!
On this occasion, thanks for setting up and running this good and helpful list.

sincerely

Thomas

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


Re: [R] numericDeriv

2005-11-16 Thread Prof Brian Ripley
On Wed, 16 Nov 2005, Florent Bresson wrote:

 I have to compute some standard errors using the delta
 method and so have to use the command numericDeriv
 to get the desired gradient. Befor using it on my
 complicated function, I've done a try with a simple
 exemple :

 x - 1:5
 numericDeriv(quote(x^2),x)

 and i get :

 [1]   1   8  27  64 125 216
 attr(,gradient)
 [,1] [,2] [,3] [,4] [,5] [,6]
 [1,]  Inf00  NaN00
 [2,]000  NaN00
 [3,]0  Inf0  NaN00
 [4,]000  NaN00
 [5,]00  Inf  NaN00
 [6,]000  NaN00

 I don't understand the result. I thought I will get :

 [1]   1   8  27  64 125 216
 attr(,gradient)
 [,1]
 [1,]  1
 [2,]  4
 [3,]  6
 [4,]  8
 [5,]  10
 [6,]  12

 The derivative of x^2 is still 2x, isn't it ?

and (1:5)^2 is still

[1]  1  4  9 16 25

!

Try

 x - as.numeric(1:5)
 numericDeriv(quote(x^2),x)

since the author of numericDeriv has forgotten some coercions.

-- 
Brian D. Ripley,  [EMAIL PROTECTED]
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford, Tel:  +44 1865 272861 (self)
1 South Parks Road, +44 1865 272866 (PA)
Oxford OX1 3TG, UKFax:  +44 1865 272595

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


Re: [R] numericDeriv

2005-11-16 Thread Ted Harding
On 16-Nov-05 Florent Bresson wrote:
 I have to compute some standard errors using the delta
 method and so have to use the command numericDeriv
 to get the desired gradient. Befor using it on my
 complicated function, I've done a try with a simple
 exemple :
 
 x - 1:5
 numericDeriv(quote(x^2),x)
 
 and i get :
 
 [1]   1   8  27  64 125 216
 attr(,gradient)
  [,1] [,2] [,3] [,4] [,5] [,6]
 [1,]  Inf00  NaN00
 [2,]000  NaN00
 [3,]0  Inf0  NaN00
 [4,]000  NaN00
 [5,]00  Inf  NaN00
 [6,]000  NaN00
 
 I don't understand the result. I thought I will get :
 
 [1]   1   8  27  64 125 216
 attr(,gradient)
  [,1]
 [1,]  1
 [2,]  4
 [3,]  6
 [4,]  8
 [5,]  10
 [6,]  12
 
 The derivative of x^2 is still 2x, isn't it ?

The trap you've fallen into is that x - 1:5 makes x of
integer type, and (believe it or not) you cannot differentiate
when the support of a function is the integers. Wrong topology
(though I'm not sure that this is quite how R thinks about it).

So give x a bit of elbow-room (numeric type has continous
-- well, nearly -- topology):

 x - as.numeric(1:5)
 numericDeriv(quote(x^2),x)
[1]  1  4  9 16 25
attr(,gradient)
 [,1] [,2] [,3] [,4] [,5]
[1,]20000
[2,]04000
[3,]00600
[4,]00080
[5,]0000   10

Cheers,
Ted.



E-Mail: (Ted Harding) [EMAIL PROTECTED]
Fax-to-email: +44 (0)870 094 0861
Date: 16-Nov-05   Time: 13:11:49
-- XFMail --

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


Re: [R] Difficulties with for() {while(){}}

2005-11-16 Thread TEMPL Matthias
Is this possible:

function(){
  initialize - function( ){ initialize }
  for(i in test){
   ...
   if( j = test2 ) {i - 1; initialize()} 
   ...
  }

Best,
Matthias

 Hi,
 
 I have the follow function:
 
 function() {
 
   ## Init of function
   ...
 
   for(i in test) {
 ...
 
 while(j = test2) {
 ...
 
 }
   }
 }
 
 The problem is that sometimes, naturally, the while is not 
 possible to be 
 resolved, and so the program abort.
 
 In this case I need that program return to the init of 
 function and run again.
 
 How I can make this? Abort the while, abort the for and run 
 the function 
 again?
 
 Thanks
 Ronaldo
 -- 
   Os homens ficam terrivelmente chatos quando sao bons 
   maridos, e abominavelmente convencidos quando nao 
   sao.
   -- Oscar Wilde 
 --
 |   // | \\   [***]
 |   ( õ   õ )  [Ronaldo Reis Júnior]
 |  V  [UFV/DBA-Entomologia]
 |/ \   [36570-000 Viçosa - MG  ]
 |  /(.''`.)\  [Fone: 31-3899-4007 ]
 |  /(: :'  :)\ [EMAIL PROTECTED]]
 |/ (`. `'` ) \[ICQ#: 5692561 | LinuxUser#: 205366 ]
 |( `-  )   [***]
 |  _/   \_Powered by GNU/Debian Woody/Sarge
 
 __
 R-help@stat.math.ethz.ch mailing list 
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read 
 the posting guide! http://www.R-project.org/posting-guide.html


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


[R] Error in integrate

2005-11-16 Thread Vivien W. Chen
Hi!

I am a beginner of R. I am trying to calculate integrate and draw a graph of 
the output, but just kept on getting error messages. I list my program and 
error message below. Please help. Many Thanks!

===
+  a--11 
 b-0.1
 c-0.012
 x-0:110
 t-0:15
 integrand-function(x) {exp(-exp(a-c*t)*(exp(b*x)-exp(c*x))/(b-c))}
 cal-integrate(integrand,0,Inf)
Error in integrate(integrand, 0, Inf) : evaluation of function gave a result of 
wrong length
In addition: Warning message:
longer object length
is not a multiple of shorter object length in: -exp(a - c * t) * (exp(b 
* x) - exp(c * x)) 
 plot(cal~t, xlab=Time, ylab=Pop at t)
Error in model.frame(formula, rownames, variables, varnames, extras, 
extranames,  : 
invalid variable type
===

- Vivien Chen -
[[alternative HTML version deleted]]

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


Re: [R] Combine related plots

2005-11-16 Thread Sean Davis
On 11/16/05 8:48 AM, Vivien W. Chen [EMAIL PROTECTED] wrote:

 Dear R users,
 
 If I have to combine plots which have the same independent and dependent
 variables in one graph. Which command should I use? Any example? Can I use
 panel?

Viven,

plot(x1,y1)
par(new=TRUE)
plot(x2,y2)

You may have to use xlim and ylim to get the plots to match axes.

Alternatively,

plot(x1,y1)
points(x2,y2) # or use lines, or whatnot

Sean

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


Re: [R] Combine related plots

2005-11-16 Thread Wiener, Matthew
You can also look at xyplot in the lattice package.  You will have to set up
your data slightly differently than for the standard graphics package, but
it may well be worth learning to do so.  The lattice package has enormous
flexibility for combining multiple sets of data in one panel or plotting
them in separate panels.

Hope this helps,

Matt

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Vivien W. Chen
Sent: Wednesday, November 16, 2005 8:49 AM
To: r-help@stat.math.ethz.ch
Subject: [R] Combine related plots


Dear R users,

If I have to combine plots which have the same independent and dependent
variables in one graph. Which command should I use? Any example? Can I use
panel?

Your help will be deeply appreciated. Thanks!

-Vivien Chen-

[[alternative HTML version deleted]]

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

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


Re: [R] numericDeriv

2005-11-16 Thread Peter Dalgaard
(Ted Harding) [EMAIL PROTECTED] writes:

 On 16-Nov-05 Florent Bresson wrote:
  I have to compute some standard errors using the delta
  method and so have to use the command numericDeriv
  to get the desired gradient. Befor using it on my
  complicated function, I've done a try with a simple
  exemple :
  
  x - 1:5
  numericDeriv(quote(x^2),x)
  
  and i get :
  
  [1]   1   8  27  64 125 216
  attr(,gradient)
   [,1] [,2] [,3] [,4] [,5] [,6]
  [1,]  Inf00  NaN00
  [2,]000  NaN00
  [3,]0  Inf0  NaN00
  [4,]000  NaN00
  [5,]00  Inf  NaN00
  [6,]000  NaN00
  
  I don't understand the result. I thought I will get :
  
  [1]   1   8  27  64 125 216
  attr(,gradient)
   [,1]
  [1,]  1
  [2,]  4
  [3,]  6
  [4,]  8
  [5,]  10
  [6,]  12
  
  The derivative of x^2 is still 2x, isn't it ?
 
 The trap you've fallen into is that x - 1:5 makes x of
 integer type, and (believe it or not) you cannot differentiate
 when the support of a function is the integers. Wrong topology
 (though I'm not sure that this is quite how R thinks about it).
 
 So give x a bit of elbow-room (numeric type has continous
 -- well, nearly -- topology):
 
  x - as.numeric(1:5)
  numericDeriv(quote(x^2),x)
 [1]  1  4  9 16 25
 attr(,gradient)
  [,1] [,2] [,3] [,4] [,5]
 [1,]20000
 [2,]04000
 [3,]00600
 [4,]00080
 [5,]0000   10


Oho. That had me baffled for a while... We should probably also
explain that x is a vector and differentiation of a vector w.r.t. a
vector is a matrix. If you want a 5x1 result you should likely use
something like

 d-0
 numericDeriv(quote((x+d)^2),d)
[1]  1  4  9 16 25
attr(,gradient)
 [,1]
[1,]2
[2,]4
[3,]6
[4,]8
[5,]   10

(I *hope* there's no way to get the result that Florent claims that he
expected...)


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

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


[R] COM dates (was origin and origin- in chron)

2005-11-16 Thread davidr
I was just looking for an easy way to convert between COM datetime and
chron datetime (both ways.)

I found examples on the list, but they involved origin.

 

Does anyone have functions for converting COM datetime - chron
datetimethat work safely?

 

David L. Reiner

 

 

 -Original Message-

 From: Gabor Grothendieck [mailto:[EMAIL PROTECTED]

 Sent: Tuesday, November 15, 2005 5:34 PM

 To: David Reiner [EMAIL PROTECTED]

 Cc: r-help@stat.math.ethz.ch

 Subject: [SPAM] - Re: [R] origin and origin- functions on chron -

 Bayesian Filter detected spam

 

 chron has a namespace so try this:

 

chron:::origin

getAnywhere(origin-)

 

 Having said that I would recommend that you don't use origins in
chron.

 The situation may have changed but when I wrote the Help Desk article

 in R News 4/1 I encountered problems with using origins in some

 situations and as discussed in the article its so easy to avoid using
them

 that there is really no good reason I can see not to avoid them.

 

 

 On 11/15/05, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:

  I'm trying to use/modify some code I found (at Omegahat, but I've
seem

 similar usage elsewhere.)

  It contains the lines:

if(any(origin(chronDate)!=orig))

   origin(chronDate) - orig

 

  Let's say:

   require(chron)

  [1] TRUE

   chronDate - chron(11/15/2005, format=m/d/y,

 origin.=c(12,31,1899))

   orig - c(month=12, day=31, year=1899)

   origin(chronDate)

  Error: couldn't find function origin

   origin(chronDate) - orig

  Error: couldn't find function origin-

 

  I'm sure I'm missing something simple here, but what? I've looked in
the

 archives and docs quite a lot

 

  Thanks for the help!

 

  R-2.2.0 on Windows XP (SP2)

 

   R.Version()

  $platform

  [1] i386-pc-mingw32

  $arch

  [1] i386

  $os

  [1] mingw32

  $system

  [1] i386, mingw32

  $status

  [1] 

  $major

  [1] 2

  $minor

  [1] 2.0

  $year

  [1] 2005

  $month

  [1] 10

  $day

  [1] 06

  $svn rev

  [1] 35749

  $language

  [1] R

 

  David L. Reiner

 

  Rho Trading

  440 S. LaSalle St.

  Chicago IL 60605

  312-362-4963

 

 

  __

  R-help@stat.math.ethz.ch mailing list

  https://stat.ethz.ch/mailman/listinfo/r-help

  PLEASE do read the posting guide! http://www.R-project.org/posting-

 guide.html

 

 

 

David L. Reiner

 

Rho Trading

440 S. LaSalle St.

Chicago  IL  60605

312-362-4963

 

 


[[alternative HTML version deleted]]

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


Re: [R] COM dates (was origin and origin- in chron)

2005-11-16 Thread Gabor Grothendieck
This is covered in the R News article.


On 11/16/05, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:


 I was just looking for an easy way to convert between COM datetime and chron
 datetime (both ways.)

 I found examples on the list, but they involved origin.



 Does anyone have functions for converting COM datetime - chron
 datetimethat work safely?



 David L. Reiner





  -Original Message-

  From: Gabor Grothendieck [mailto:[EMAIL PROTECTED]

  Sent: Tuesday, November 15, 2005 5:34 PM

  To: David Reiner [EMAIL PROTECTED]

  Cc: r-help@stat.math.ethz.ch

  Subject: [SPAM] - Re: [R] origin and origin- functions on chron -

  Bayesian Filter detected spam

 

  chron has a namespace so try this:

 

 chron:::origin

 getAnywhere(origin-)

 

  Having said that I would recommend that you don't use origins in chron.

  The situation may have changed but when I wrote the Help Desk article

  in R News 4/1 I encountered problems with using origins in some

  situations and as discussed in the article its so easy to avoid using them

  that there is really no good reason I can see not to avoid them.

 

 

  On 11/15/05, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:

   I'm trying to use/modify some code I found (at Omegahat, but I've seem

  similar usage elsewhere.)

   It contains the lines:

 if(any(origin(chronDate)!=orig))

origin(chronDate) - orig

  

   Let's say:

require(chron)

   [1] TRUE

chronDate - chron(11/15/2005, format=m/d/y,

  origin.=c(12,31,1899))

orig - c(month=12, day=31, year=1899)

origin(chronDate)

   Error: couldn't find function origin

origin(chronDate) - orig

   Error: couldn't find function origin-

  

   I'm sure I'm missing something simple here, but what? I've looked in the

  archives and docs quite a lot

  

   Thanks for the help!

  

   R-2.2.0 on Windows XP (SP2)

  

R.Version()

   $platform

   [1] i386-pc-mingw32

   $arch

   [1] i386

   $os

   [1] mingw32

   $system

   [1] i386, mingw32

   $status

   [1] 

   $major

   [1] 2

   $minor

   [1] 2.0

   $year

   [1] 2005

   $month

   [1] 10

   $day

   [1] 06

   $svn rev

   [1] 35749

   $language

   [1] R

  

   David L. Reiner

  

   Rho Trading

   440 S. LaSalle St.

   Chicago IL 60605

   312-362-4963

  

  

   __

   R-help@stat.math.ethz.ch mailing list

   https://stat.ethz.ch/mailman/listinfo/r-help

   PLEASE do read the posting guide!
 http://www.R-project.org/posting-

  guide.html

  





 David L. Reiner



 Rho Trading

 440 S. LaSalle St.

 Chicago  IL  60605

 312-362-4963





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


Re: [R] numericDeriv

2005-11-16 Thread Florent Bresson
Effectively, it's much better
thanks
--- Prof Brian Ripley [EMAIL PROTECTED] a
écrit :

 On Wed, 16 Nov 2005, Florent Bresson wrote:
 
  I have to compute some standard errors using the
 delta
  method and so have to use the command
 numericDeriv
  to get the desired gradient. Befor using it on my
  complicated function, I've done a try with a
 simple
  exemple :
 
  x - 1:5
  numericDeriv(quote(x^2),x)
 
  and i get :
 
  [1]   1   8  27  64 125 216
  attr(,gradient)
  [,1] [,2] [,3] [,4] [,5] [,6]
  [1,]  Inf00  NaN00
  [2,]000  NaN00
  [3,]0  Inf0  NaN00
  [4,]000  NaN00
  [5,]00  Inf  NaN00
  [6,]000  NaN00
 
  I don't understand the result. I thought I will
 get :
 
  [1]   1   8  27  64 125 216
  attr(,gradient)
  [,1]
  [1,]  1
  [2,]  4
  [3,]  6
  [4,]  8
  [5,]  10
  [6,]  12
 
  The derivative of x^2 is still 2x, isn't it ?
 
 and (1:5)^2 is still
 
 [1]  1  4  9 16 25
 
 !
 
 Try
 
  x - as.numeric(1:5)
  numericDeriv(quote(x^2),x)
 
 since the author of numericDeriv has forgotten some
 coercions.
 
 -- 
 Brian D. Ripley, 
 [EMAIL PROTECTED]
 Professor of Applied Statistics, 
 http://www.stats.ox.ac.uk/~ripley/
 University of Oxford, Tel:  +44 1865
 272861 (self)
 1 South Parks Road, +44 1865
 272866 (PA)
 Oxford OX1 3TG, UKFax:  +44 1865
 272595


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


[R] x-axis in dendrogram

2005-11-16 Thread Werner Bier
Hi there,
   
  Is it possible to fix the x-axis on a dendrogram and allow vertical lines to 
intersect to each other? 
   
  Regards, 
  Julio




-

[[alternative HTML version deleted]]

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


Re: [R] Error in integrate

2005-11-16 Thread Thomas Lumley
On Wed, 16 Nov 2005, Vivien W. Chen wrote:

 Hi!

 I am a beginner of R. I am trying to calculate integrate and draw a 
 graph of the output, but just kept on getting error messages. I list my 
 program and error message below. Please help. Many Thanks!

 ===
 +  a--11
 b-0.1
 c-0.012
 x-0:110

This is harmless but suspicious -- this x is completely unrelated to the x 
in integrand()

 t-0:15
 integrand-function(x) {exp(-exp(a-c*t)*(exp(b*x)-exp(c*x))/(b-c))}

The problem is that x is a vector of whatever length integrate() decides 
to pass, but t is a vector of length 16.  This mismatch of lengths is 
going to cause a problem.

 cal-integrate(integrand,0,Inf)
 Error in integrate(integrand, 0, Inf) : evaluation of function gave a result 
 of wrong length
 In addition: Warning message:
 longer object length
is not a multiple of shorter object length in: -exp(a - c * t) * 
 (exp(b * x) - exp(c * x))
 plot(cal~t, xlab=Time, ylab=Pop at t)
 Error in model.frame(formula, rownames, variables, varnames, extras, 
 extranames,  :
invalid variable type
 ===

 - Vivien Chen -
   [[alternative HTML version deleted]]

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


Thomas Lumley   Assoc. Professor, Biostatistics
[EMAIL PROTECTED]   University of Washington, Seattle

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


[R] save to ascii

2005-11-16 Thread Afshartous, David

All,

Usually when I save a variable I have ascii = FALSE since I usually
load the variable via the load(variable) command and do not need to
view the variable outside of R.

When I set ascii = TRUE and view the variable outside of R in a text editor,
I notice additional characters (starting w/ RDA2 ...) before the first actual 
value
in the vector.

Is there are way to save to ascii such that this does not happen?
I checked the help under save and didn't see anything.  I apologize
in advance for this overly simplistic question.

Cheers,
Dave
ps - please reply directly to [EMAIL PROTECTED]

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


Re: [R] save to ascii

2005-11-16 Thread Roger D. Peng
You could try using functions like 'dput()' or 'dump()'.  These may or may not 
be equivalent to 'save()' depending on how complex the object to be saved is.

-roger

P.S. Asking people to respond to a different email address is not a good way to 
get responses!

Afshartous, David wrote:
 All,
 
 Usually when I save a variable I have ascii = FALSE since I usually
 load the variable via the load(variable) command and do not need to
 view the variable outside of R.
 
 When I set ascii = TRUE and view the variable outside of R in a text editor,
 I notice additional characters (starting w/ RDA2 ...) before the first actual 
 value
 in the vector.
 
 Is there are way to save to ascii such that this does not happen?
 I checked the help under save and didn't see anything.  I apologize
 in advance for this overly simplistic question.
 
 Cheers,
 Dave
 ps - please reply directly to [EMAIL PROTECTED]
 
 __
 R-help@stat.math.ethz.ch mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
 

-- 
Roger D. Peng  |  http://www.biostat.jhsph.edu/~rpeng/

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


[R] invert y-axis in barplot

2005-11-16 Thread Jörg Schlingemann
Hi!

 

This is probably a very trivial question. Is there an easy way to invert the
y-axis (low values on top) when using the function barplot()? 

 

Thanks,

Jörg


[[alternative HTML version deleted]]

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

Re: [R] Difficulties with for() {while(){}}

2005-11-16 Thread Ronaldo Reis-Jr.
Em Qua 16 Nov 2005 11:30, jim holtman escreveu:
 What do you mean by 'abort'? Does an 'error' occur that you want to catch?
 If so, look at 'try'. Otherwise if it is testable, then just test for the
 condition and restart.


Hi,

this is not a real error, is a situation whitout a resolution.

Is, I try to test the condition and restart, but how to restart all?

Matthias suggest the use of initialize, I dont undertande how to use this.

I try this:

myfunction - function(...) {

  ## Init of function
  ...

  for(i in test) {
...

while(j = test2) {
...
  test3 - make a test 
  if(test3 == error) {
  myfunction(...)
  }
}
  }
}

This is the best way to make this?

In this case I need to put all arguments initialized in function(...) on the 
myfunction(...) .

Thanks
Ronaldo

-- 
Faça algo à prova de idiotas e alguém fará um idiota melhor.
--
|   // | \\   [***]
|   ( õ   õ )  [Ronaldo Reis Júnior]
|  V  [UFV/DBA-Entomologia]
|/ \   [36570-000 Viçosa - MG  ]
|  /(.''`.)\  [Fone: 31-3899-4007 ]
|  /(: :'  :)\ [EMAIL PROTECTED]]
|/ (`. `'` ) \[ICQ#: 5692561 | LinuxUser#: 205366 ]
|( `-  )   [***]
|  _/   \_Powered by GNU/Debian Woody/Sarge

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


Re: [R] save to ascii

2005-11-16 Thread Liaw, Andy
Perhaps use dput?

HTH,
Andy

From: Afshartous, David
 
 All,
 
 Usually when I save a variable I have ascii = FALSE since I usually
 load the variable via the load(variable) command and do not need to
 view the variable outside of R.
 
 When I set ascii = TRUE and view the variable outside of R in 
 a text editor,
 I notice additional characters (starting w/ RDA2 ...) before 
 the first actual value
 in the vector.
 
 Is there are way to save to ascii such that this does not happen?
 I checked the help under save and didn't see anything.  I apologize
 in advance for this overly simplistic question.
 
 Cheers,
 Dave
 ps - please reply directly to [EMAIL PROTECTED]
 
 __
 R-help@stat.math.ethz.ch mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide! 
 http://www.R-project.org/posting-guide.html
 


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


[R] Warning message: package '...' was built under R version 2.3.0

2005-11-16 Thread Tuszynski, Jaroslaw W.
Hi,

While installing precompiled packages I often get warnings like the one in
the subject. I usually ignore them, but I still do not understand why
windows packages are build with unreleased versions of R. 
Is there some way to get packages build under R-2.2.0?
What are potential problems that can result from that version mismatch?

My system: winXP
R version: 2.2.0

Jarek Tuszynski 

[[alternative HTML version deleted]]

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


Re: [R] invert y-axis in barplot

2005-11-16 Thread Marc Schwartz (via MN)
On Wed, 2005-11-16 at 16:46 +, Jörg Schlingemann wrote:
 Hi!
 
  
 
 This is probably a very trivial question. Is there an easy way to invert the
 y-axis (low values on top) when using the function barplot()? 
 
  
 
 Thanks,
 
 Jrg

You mean something like this?:

  barplot(1:10, ylim = rev(c(0, 12)))

or, something like this?:

  barplot(1:10, yaxt = n) 
  axis(2, labels = rev(seq(0, 10, 2)), at = seq(0, 10, 2))


Note the use of rev() in each case.

HTH,

Marc Schwartz

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

[R] nlme question

2005-11-16 Thread Wassell, James T., Ph.D.
I am using the package nlme to fit a simple random effects (variance
components model)

with 3 parameters:  overall mean (fixed effect), between subject
variance (random) and 

within subject variance (random).

 

I have 16 subjects with 1-4 obs per subject. 

 

I need a 3x3 variance-covariance matrix that includes all 3 parameters
in order to 

compute the variance of a specific linear combination.

 

But I can't get the 3x3 matrix.  Should I specify the formulae in lme

differently or is there some other suggestion that I might try?

 

Thank you very much for any advice.  my data and code follows.  

 

mydata -

structure(list(subject = c(17, 17, 17, 17, 5, 16, 16, 8, 8, 8, 

8, 7, 7, 7, 7, 9, 9, 9, 10, 10, 11, 11, 11, 12, 12, 12, 12, 14, 

14, 14, 14, 15, 15, 15, 15, 13, 13, 13, 1, 1, 1, 2, 2, 2, 2, 

3, 3, 3, 4, 4, 4), y = c(-2.944, -5.521, -4.644, -4.736, -5.799, 

-4.635, -5.986, -5.011, -3.989, -4.682, -6.975, -6.064, -5.991, 

-8.068, -5.075, -5.298, -6.446, -5.037, -6.534, -4.828, -5.886, 

-4.025, -6.607, -5.914, -4.159, -6.757, -4.564, -5.011, -5.416, 

-5.371, -5.768, -7.962, -5.635, -4.575, -5.268, -6.975, -5.598, 

-7.669, -8.292, -7.265, -5.858, -7.003, -3.807, -5.829, -5.613, 

-3.135, -5.136, -5.394, -5.011, -5.598, -4.174)), .Names = c(subject, 

y), class = data.frame, row.names = c(1, 2, 3, 4, 

5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 

16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 

27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 

38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 

49, 50, 51))

 

lme.res-lme(fixed=y~1,data=mydata,random=~1|subject,method=ML)

VarCorr(lme.res)

 


[[alternative HTML version deleted]]

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


Re: [R] invert y-axis in barplot

2005-11-16 Thread Uwe Ligges
Jörg Schlingemann wrote:

 Hi!
 
  
 
 This is probably a very trivial question. Is there an easy way to invert the
 y-axis (low values on top) when using the function barplot()? 


barplot(1:10, ylim=c(10, 0))

works for me ...

Uwe Ligges


  
 
 Thanks,
 
 Jörg
 
 
   [[alternative HTML version deleted]]
 
 
 
 
 
 __
 R-help@stat.math.ethz.ch mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

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


Re: [R] Warning message: package '...' was built under R version 2.3.0

2005-11-16 Thread Uwe Ligges
Tuszynski, Jaroslaw W. wrote:

 Hi,
 
 While installing precompiled packages I often get warnings like the one in
 the subject. I usually ignore them, but I still do not understand why
 windows packages are build with unreleased versions of R. 
 Is there some way to get packages build under R-2.2.0?

Well, those in the corresponding 2.2 repository on CRAN should all be 
build with R-2.2.0. If not, please tell me which one is wrong.

Where did you get the packages for R-devel from?

Uwe Ligges


 What are potential problems that can result from that version mismatch?
 
 My system: winXP
 R version: 2.2.0
 
 Jarek Tuszynski 
 
   [[alternative HTML version deleted]]
 
 __
 R-help@stat.math.ethz.ch mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

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


Re: [R] Warning message: package '...' was built under R version 2.3.0

2005-11-16 Thread Tuszynski, Jaroslaw W.
Uwe,

I think I used following repositories: PA1, PA2 and NC, which are the
closest to me and I think I got the same results in all. The package I
downloaded was coin which downloaded other packages. The consol printout
follows:


 chooseCRANmirror()
 utils:::menuInstallPkgs()
trying URL
'http://www.ibiblio.org/pub/languages/R/CRAN/bin/windows/contrib/2.2/coin_0.
3-3.zip'
Content type 'application/zip' length 793299 bytes
opened URL
downloaded 774Kb

package 'coin' successfully unpacked and MD5 sums checked

The downloaded packages are in
C:\Documents and Settings\tuszynskij\Local
Settings\Temp\Rtmp7594\downloaded_packages
updating HTML package descriptions
 library(coin)
Loading required package: survival
Loading required package: splines
Loading required package: mvtnorm
Loading required package: modeltools
Error in load(dataFile, ns) : ReadItem: unknown type 241
In addition: Warning messages:
1: package 'mvtnorm' was built under R version 2.3.0 
2: package 'modeltools' was built under R version 2.3.0 
Error: unable to load R code in package 'modeltools'
Error: package 'modeltools' could not be loaded

Jarek Tuszynski

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] 
Sent: Wednesday, November 16, 2005 11:27 AM
To: Tuszynski, Jaroslaw W.
Cc: r-help@stat.math.ethz.ch
Subject: Re: [R] Warning message: package '...' was built under R version
2.3.0


Tuszynski, Jaroslaw W. wrote:

 Hi,
 
 While installing precompiled packages I often get warnings like the 
 one in the subject. I usually ignore them, but I still do not 
 understand why windows packages are build with unreleased versions of 
 R. Is there some way to get packages build under R-2.2.0?

Well, those in the corresponding 2.2 repository on CRAN should all be 
build with R-2.2.0. If not, please tell me which one is wrong.

Where did you get the packages for R-devel from?

Uwe Ligges


 What are potential problems that can result from that version 
 mismatch?
 
 My system: winXP
 R version: 2.2.0
 
 Jarek Tuszynski
 
   [[alternative HTML version deleted]]
 
 __
 R-help@stat.math.ethz.ch mailing list 
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide! 
 http://www.R-project.org/posting-guide.html

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


Re: [R] combination xyplot and barchart?

2005-11-16 Thread Erin Berryman
Thank you, that worked great. Per your suggestion, I transformed the 
Precip data to fit on the same scale as the Temp data. After changing 
trellis.par.set$layout.widths$right.padding to 5, I was able to fit a 
second axis and label for the Precip (using panel.axis) to achieve the 
plot I want.

Erin

On Nov 15, 2005, at 9:09 PM, Deepayan Sarkar wrote:

 On 11/15/05, Erin Berryman [EMAIL PROTECTED] wrote:
 Dear R community,

 I am having trouble determining how to create the graph I want
 utilizing my relatively limited knowledge of R. So far I have been
 using the lattice library to create most of what I need.
 The dataset (enviro) consists of 2 variables (Temp and Precip) for 
 each
 Day of a 2-yr period (Year). I wish to display Temp and Precip along
 the y axis plotted by Day on the x axis to allow comparison (one 
 year's
 data in each of 2 panels stacked on top of each other) between the
 years. Essentially what I want it to look like is an xyplot (Temp ~ 
 Day
 | Year, type='l') superimposed onto a barchart(Precip ~ Day | Year,
 horizontal=F), with scales adjusted so one can see detail in both
 variables.
 The closest I have come to what I need is by the following code :

 library(lattice)
 barchart(Precip + Temp ~ Day | Year, data=enviro, layout=c(1,2),
 horizontal=F, origin=0,
 panel=function(x,y,subscripts,...){panel.xyplot(x=enviro$Day,
 y=enviro$Temp, type='l',subscripts=subscripts, ...);
 panel.barchart(x=enviro$Day, y=enviro$Precip, subscripts=subscripts,
 ...)})

 Two panels are produced; however, both years' data are plotted in each
 panel (panels look identical). And I get this error:

 Error in grid.Call.graphics(L_rect, x$x, x$y, x$width, x$height,
 resolveHJust(x$just,  :
  invalid line type

 A reproducible example, even if it's a toy one, would have been 
 helpful.

 Your usage is confused. In particular, panel.xyplot ignores the
 subscripts argument, so you end up giving exactly the same set of
 values to panel.xyplot for both panels (so it's not surprising that
 your panels show the same data). It seems that you are looking for
 something like the following:


 enviro -
 data.frame(Year = rep(2001:2002, each = 365),
Day = rep(1:365, 2),
Precip = pmax(0, rnorm(365 * 2)),
Temp = 2 + 0.2 * rnorm(365 * 2))


 xyplot(Precip + Temp ~ Day | Year, data=enviro,
layout = c(1, 2),
panel = panel.superpose.2,
type = c('h', 'l'))

 In case it helps, this is shorthand for

 xyplot(Precip + Temp ~ Day | Year, data=enviro,
layout = c(1, 2),
panel = function(x, y, groups, subscripts, ...) {
panel.superpose.2(x = x, y = y,
  groups = groups,
  subscripts = subscripts,
  ...)
},
type = c('h', 'l'))

 Note that the panel function is defined in terms of arguments it gets,
 and does not explicitly refer to any external variables (like the data
 frame 'enviro'). If you find yourself writing code that does, it's a
 likely sign that you are doing something wrong (or at least
 unnecessarily convoluted).


  From the documentation or the help archives, I cannot understand how 
 to:
 1) indicate a conditioning variable (Year) for panel.barchart and
 panel.xyplot
 2) have 2 y axes with different scales in one panel

 You can't easily. A panel has one set of scales, and that's it. You
 can of course fake it by transforming the relevant part of your data
 and adding a set of tick marks with appropriate (fake) labels (see
 ?panel.axis).

 -Deepayan


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


[R] nmle question

2005-11-16 Thread Wassell, James T., Ph.D.
Hello.

I have 16 subjects with 1-4 obs per subject. 

I am using the package nlme to fit a simple random effects (variance
components model) with 3 parameters:  overall mean (fixed effect),
between subject variance (random) and within subject variance (random).
 
I need a 3x3 variance-covariance matrix that includes all 3 parameters
in order to compute the variance of a specific linear combination.

But I can't get the 3x3 matrix.  Should I specify the formulae in lme
differently or is there some other suggestion that I might try?

Thank you very much for any advice.  my data and code follows.  

mydata -
structure(list(subject = c(17, 17, 17, 17, 5, 16, 16, 8, 8, 8, 
8, 7, 7, 7, 7, 9, 9, 9, 10, 10, 11, 11, 11, 12, 12, 12, 12, 14, 
14, 14, 14, 15, 15, 15, 15, 13, 13, 13, 1, 1, 1, 2, 2, 2, 2, 
3, 3, 3, 4, 4, 4), y = c(-2.944, -5.521, -4.644, -4.736, -5.799, 
-4.635, -5.986, -5.011, -3.989, -4.682, -6.975, -6.064, -5.991, 
-8.068, -5.075, -5.298, -6.446, -5.037, -6.534, -4.828, -5.886, 
-4.025, -6.607, -5.914, -4.159, -6.757, -4.564, -5.011, -5.416, 
-5.371, -5.768, -7.962, -5.635, -4.575, -5.268, -6.975, -5.598, 
-7.669, -8.292, -7.265, -5.858, -7.003, -3.807, -5.829, -5.613, 
-3.135, -5.136, -5.394, -5.011, -5.598, -4.174)), .Names = c(subject, 
y), class = data.frame, row.names = c(1, 2, 3, 4, 
5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 
16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 
27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 
38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 
49, 50, 51))

lme.res-lme(fixed=y~1,data=mydata,random=~1|subject,method=ML)
VarCorr(lme.res)

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


Re: [R] Unexpected result of names-

2005-11-16 Thread Liaw, Andy
That's because S does partial matching of component names, if it can be done
unambiguously:


 z - list(aaa=1, bbb=2)
 z$a
[1] 1
 z[[a]]
[1] 1
 z[a]
$NA
NULL

 z[aaa]
$aaa
[1] 1

Andy



From: Hong Ooi
 
 Hi,
 
 I came across some rather unexpected behaviour the other day with
 assigning names and lists. Here's an example.
 
  z - list(aaa=1, bbb=2)
  z
 $aaa
 [1] 1
 
 $bbb
 [1] 2
 
 Note that z has members named aaa and bbb. Now:
 
  names(z$a) - X
  z
 $aaa
 [1] 1
 
 $bbb
 [1] 2
 
 $a
 X 
 1
 
 I would have expected that trying to name z$a would either 
 give an error
 (because z doesn't have an element a) or would cause z$aaa to be
 modified (due to partial name matching).  I didn't expect that a new
 list member would be created.
 
 I've checked that this is consistent across SPlus 2000, SPlus 7, and R
 2.2 for Windows. Can someone give an explanation for why this is
 happening?
 
 
 -- 
 Hong Ooi
 Senior Research Analyst, IAG Limited
 388 George St, Sydney NSW 2000
 (02) 9292 1566
 
 
 __
 _
 
 The information transmitted in this message and its 
 attachments (if any) is intended 
 only for the person or entity to which it is addressed.
 The message may contain confidential and/or privileged 
 material. Any review, 
 retransmission, dissemination or other use of, or taking of 
 any action in reliance 
 upon this information, by persons or entities other than the 
 intended recipient is 
 prohibited.
 
 If you have received this in error, please contact the sender 
 and delete this e-mail 
 and associated material from any computer.
 
 The intended recipient of this e-mail may only use, 
 reproduce, disclose or distribute 
 the information contained in this e-mail and any attached 
 files, with the permission 
 of the sender.
 
 This message has been scanned for viruses with Symantec Scan 
 Engine and cleared by 
 MailMarshal.
 
 __
 R-help@stat.math.ethz.ch mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide! 
 http://www.R-project.org/posting-guide.html
 


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


[R] Newton-Raphson

2005-11-16 Thread Zhu, Chao \(UMC-Student\)
Dear all,
 
I want to solve a score function by using Newton-Raphson algorithm. Is there 
such a fucntion in R? I know there's one called optim, but it seems only doing 
minimizing or maximizing. 
 
Thanks,
 
Jimmy

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

[R] RODBC help

2005-11-16 Thread Keith Sabol
I am using the RODBC package to read data from an Excel file. An excerpt of 
the file looks like this:

00103V206   AES Corporation 6.00%   42.87
00808N202   AES Trust III   6.75%   34.98
03748R861   Apartment Investment  Management   9.00%   #ERROR (I)
039380209   Arch Coal, Inc. 5.00%   61.51


My problem appears to be related to specification of data types by column.  
For instance, the CUSIPS in column 1 are read in correctly when they contain 
a letter, but as NA when they are purely numbers.  Similarly, in the fourth 
column the rows with #ERROR (I) are read in as such, but all other values 
become NA.


I have experimented with as.is but have not been able to arrive at a 
solution.  I also changed the nullstrings return value and each of the NAs 
generated above appear to be genrated by the query seeing null strings.


As always, your assistance is most appreciated.

_
Don’t just search. Find. Check out the new MSN Search!

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

Re: [R] Warning message: package '...' was built under R version 2.3.0

2005-11-16 Thread Uwe Ligges
Tuszynski, Jaroslaw W. wrote:

 Uwe,
 
 I think I used following repositories: PA1, PA2 and NC, which are the
 closest to me and I think I got the same results in all. The package I
 downloaded was coin which downloaded other packages. The consol printout
 follows:
 
 
 
chooseCRANmirror()
utils:::menuInstallPkgs()
 
 trying URL
 'http://www.ibiblio.org/pub/languages/R/CRAN/bin/windows/contrib/2.2/coin_0.
 3-3.zip'
 Content type 'application/zip' length 793299 bytes
 opened URL
 downloaded 774Kb
 
 package 'coin' successfully unpacked and MD5 sums checked
 
 The downloaded packages are in
 C:\Documents and Settings\tuszynskij\Local
 Settings\Temp\Rtmp7594\downloaded_packages
 updating HTML package descriptions
 
library(coin)
 
 Loading required package: survival
 Loading required package: splines
 Loading required package: mvtnorm
 Loading required package: modeltools
 Error in load(dataFile, ns) : ReadItem: unknown type 241
 In addition: Warning messages:
 1: package 'mvtnorm' was built under R version 2.3.0 


I have just downloaded
http://www.ibiblio.org/pub/languages/R/CRAN/bin/windows/contrib/2.2/mvtnorm_0.7-2.zip
and its DESCRIPTION file correctly has:
Built: R 2.2.0; i386-pc-mingw32; 2005-10-14 14:44:12; windows


My guess is that you are using one library for two different R versions 
and you have installed some R-devel package into the library you are now 
using with R-2.2.0 ...

You cannot mix binary packages for R  2.3.0 with those for R-devel due 
to changes in environment handling.

Uwe Ligges




 2: package 'modeltools' was built under R version 2.3.0 
 Error: unable to load R code in package 'modeltools'
 Error: package 'modeltools' could not be loaded
 
 Jarek Tuszynski
 
 -Original Message-
 From: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED] 
 Sent: Wednesday, November 16, 2005 11:27 AM
 To: Tuszynski, Jaroslaw W.
 Cc: r-help@stat.math.ethz.ch
 Subject: Re: [R] Warning message: package '...' was built under R version
 2.3.0
 
 
 Tuszynski, Jaroslaw W. wrote:
 
 
Hi,

While installing precompiled packages I often get warnings like the 
one in the subject. I usually ignore them, but I still do not 
understand why windows packages are build with unreleased versions of 
R. Is there some way to get packages build under R-2.2.0?
 
 
 Well, those in the corresponding 2.2 repository on CRAN should all be 
 build with R-2.2.0. If not, please tell me which one is wrong.
 
 Where did you get the packages for R-devel from?
 
 Uwe Ligges
 
 
 
What are potential problems that can result from that version 
mismatch?

My system: winXP
R version: 2.2.0

Jarek Tuszynski

  [[alternative HTML version deleted]]

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

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


[R] normal cdf over an interval

2005-11-16 Thread Olivia Lau
Hi, 

I'm trying to find a way to take evaluate the Normal CDF over an interval and 
return the result on the log scale.  This works, but I think it isn't 
numerically stable:  

log(pnorm(a, mean = x, sd = y) - pnorm(b, mean = x, sd = y))

Does anyone know of a single function that does the above?  Or knows of a way 
to make it more stable?  I'd really appreciate any suggestions!  

Thanks, 

Olivia
[[alternative HTML version deleted]]

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


[R] RODBC and Very long field lengths

2005-11-16 Thread tom wright
I'm having a small problem using RODBC. I'm trying to retrieve a string
from a very long memo field (512*20*9=9360 characters = 74880 bytes) in
an MSAccess database. 
It appears that RODBC set a maximum buffer size for a single column of
65535 bytes.

## cut from RODBC.c ##
} else { /* transfer as character */
int datalen = thisHandle-ColData[i].ColSize;
if (datalen = 0 || datalen  COLMAX) datalen = COLMAX;
/* sanity check as the reports are sometimes unreliable */
if (datalen  65535) datalen = 65535;
##

Can I increase this by just changeing the value in RODBC.c? If so how do
I get R  to re-compile the package?

Thanks for your advice 
Tom

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


Re: [R] Unexpected result of names-

2005-11-16 Thread Prof Brian Ripley
On Wed, 16 Nov 2005, Liaw, Andy wrote:

 That's because S does partial matching of component names, if it can be 
 done unambiguously:

 z - list(aaa=1, bbb=2)
 z$a
 [1] 1
 z[[a]]
 [1] 1
 z[a]
 $NA
 NULL
[That could be done unambiguously, but [] does not partial match in R
(see ?[), only [[]] and $ do.  That is different from S (Blue Book 
p.358), and I do not know why.]
 z[aaa]
 $aaa
 [1] 1

Well, *sometimes*.  For

 z - list(aaa=1, bbb=2)
 z$a - 3
 z
$aaa
[1] 1

$bbb
[1] 2

$a
[1] 3

It is that the rules are different for extraction and replacement that 
surprises people.  In this case we have effectively

z - $-(names-(z$a, X), a)

and the replacement function $- does not partially match (Blue Book, 
p.362).



 Andy



 From: Hong Ooi

 Hi,

 I came across some rather unexpected behaviour the other day with
 assigning names and lists. Here's an example.

 z - list(aaa=1, bbb=2)
 z
 $aaa
 [1] 1

 $bbb
 [1] 2

 Note that z has members named aaa and bbb. Now:

 names(z$a) - X
 z
 $aaa
 [1] 1

 $bbb
 [1] 2

 $a
 X
 1

 I would have expected that trying to name z$a would either
 give an error
 (because z doesn't have an element a) or would cause z$aaa to be
 modified (due to partial name matching).  I didn't expect that a new
 list member would be created.

 I've checked that this is consistent across SPlus 2000, SPlus 7, and R
 2.2 for Windows. Can someone give an explanation for why this is
 happening?


 --
 Hong Ooi
 Senior Research Analyst, IAG Limited
 388 George St, Sydney NSW 2000
 (02) 9292 1566


 __
 _

 The information transmitted in this message and its
 attachments (if any) is intended
 only for the person or entity to which it is addressed.
 The message may contain confidential and/or privileged
 material. Any review,
 retransmission, dissemination or other use of, or taking of
 any action in reliance
 upon this information, by persons or entities other than the
 intended recipient is
 prohibited.

 If you have received this in error, please contact the sender
 and delete this e-mail
 and associated material from any computer.

 The intended recipient of this e-mail may only use,
 reproduce, disclose or distribute
 the information contained in this e-mail and any attached
 files, with the permission
 of the sender.

 This message has been scanned for viruses with Symantec Scan
 Engine and cleared by
 MailMarshal.

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



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


-- 
Brian D. Ripley,  [EMAIL PROTECTED]
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford, Tel:  +44 1865 272861 (self)
1 South Parks Road, +44 1865 272866 (PA)
Oxford OX1 3TG, UKFax:  +44 1865 272595

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


Re: [R] Warning message: package '...' was built under R version 2.3.0

2005-11-16 Thread Tuszynski, Jaroslaw W.
I do have single version of R (2.2.0) and all packages I have were installed
by downloading precompiled packages from PA or NC repositories within last
month. 

I also just managed to download 'modeltools' from PA2 and its DESCRIPTION
says:
Built: R 2.3.0; ; 2005-11-04 20:47:47; windows

R console:

 utils:::menuInstallPkgs()
--- Please select a CRAN mirror for use in this session ---
trying URL
'http://lib.stat.cmu.edu/R/CRAN/bin/windows/contrib/2.2/modeltools_0.2-0.zip
'
Content type 'application/zip' length 64426 bytes
opened URL
downloaded 62Kb

package 'modeltools' successfully unpacked and MD5 sums checked

The downloaded packages are in
C:\Documents and Settings\tuszynskij\Local
Settings\Temp\Rtmp4458\downloaded_packages
updating HTML package descriptions
 library(modeltools)
Error in load(dataFile, ns) : ReadItem: unknown type 241
In addition: Warning message:
package 'modeltools' was built under R version 2.3.0 
Error: unable to load R code in package 'modeltools'
Error: package/namespace load failed for 'modeltools'

The same package downloaded from PA1 does not give me any warnings or
errors.

Jarek Tuszynski


-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] 
Sent: Wednesday, November 16, 2005 1:04 PM
To: Tuszynski, Jaroslaw W.
Cc: r-help@stat.math.ethz.ch
Subject: Re: [R] Warning message: package '...' was built under R version
2.3.0


Tuszynski, Jaroslaw W. wrote:

 Uwe,
 
 I think I used following repositories: PA1, PA2 and NC, which are the 
 closest to me and I think I got the same results in all. The package I 
 downloaded was coin which downloaded other packages. The consol 
 printout
 follows:
 
 
 
chooseCRANmirror()
utils:::menuInstallPkgs()
 
 trying URL 
 'http://www.ibiblio.org/pub/languages/R/CRAN/bin/windows/contrib/2.2/c
 oin_0.
 3-3.zip'
 Content type 'application/zip' length 793299 bytes
 opened URL
 downloaded 774Kb
 
 package 'coin' successfully unpacked and MD5 sums checked
 
 The downloaded packages are in
 C:\Documents and Settings\tuszynskij\Local 
 Settings\Temp\Rtmp7594\downloaded_packages
 updating HTML package descriptions
 
library(coin)
 
 Loading required package: survival
 Loading required package: splines
 Loading required package: mvtnorm
 Loading required package: modeltools
 Error in load(dataFile, ns) : ReadItem: unknown type 241
 In addition: Warning messages:
 1: package 'mvtnorm' was built under R version 2.3.0


I have just downloaded
http://www.ibiblio.org/pub/languages/R/CRAN/bin/windows/contrib/2.2/mvtnorm_
0.7-2.zip
and its DESCRIPTION file correctly has:
Built: R 2.2.0; i386-pc-mingw32; 2005-10-14 14:44:12; windows


My guess is that you are using one library for two different R versions 
and you have installed some R-devel package into the library you are now 
using with R-2.2.0 ...

You cannot mix binary packages for R  2.3.0 with those for R-devel due 
to changes in environment handling.

Uwe Ligges

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


Re: [R] normal cdf over an interval

2005-11-16 Thread Ted Harding
On 16-Nov-05 Olivia Lau wrote:
 Hi, 
 
 I'm trying to find a way to take evaluate the Normal CDF over an
 interval and return the result on the log scale.  This works, but I
 think it isn't numerically stable:  
 
 log(pnorm(a, mean = x, sd = y) - pnorm(b, mean = x, sd = y))
 
 Does anyone know of a single function that does the above?  Or knows of
 a way to make it more stable?  I'd really appreciate any suggestions!  
 
 Thanks, 
 
 Olivia

A little more detail might be helpful.

Your formula is simple enough in itself, and you should not be
getting numerical stability problems for reasonable values of
(a-x)/y or (b-x)/y (say in the range -4 to 4). And I assume
you're being careful that a  b!

So for what values of your variables are problems arising?
And how do they manifest themselves?

If it's due to large values of (a-x)/y etc., then possibly
an asymptotic approximation may serve. There are some good
ones around.

Can you tell us a bit more?

Best wishes,
Ted.



E-Mail: (Ted Harding) [EMAIL PROTECTED]
Fax-to-email: +44 (0)870 094 0861
Date: 16-Nov-05   Time: 20:37:47
-- XFMail --

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


Re: [R] RODBC and Very long field lengths

2005-11-16 Thread Prof Brian Ripley
On Wed, 16 Nov 2005, tom wright wrote:

 I'm having a small problem using RODBC. I'm trying to retrieve a string
 from a very long memo field (512*20*9=9360 characters = 74880 bytes) in
 an MSAccess database.
 It appears that RODBC set a maximum buffer size for a single column of
 65535 bytes.

Well, it is documented in the ChangeLog.  (The limit used to be much 
lower.)

 ## cut from RODBC.c ##
   } else { /* transfer as character */
   int datalen = thisHandle-ColData[i].ColSize;
   if (datalen = 0 || datalen  COLMAX) datalen = COLMAX;
   /* sanity check as the reports are sometimes unreliable */
   if (datalen  65535) datalen = 65535;
 ##

 Can I increase this by just changeing the value in RODBC.c? If so how do
 I get R  to re-compile the package?

Yes, and you re-compile it just like any other package, see the rw-FAQ, 
the R-admin manual and the latest Helpdesk in R-news, for example.

-- 
Brian D. Ripley,  [EMAIL PROTECTED]
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford, Tel:  +44 1865 272861 (self)
1 South Parks Road, +44 1865 272866 (PA)
Oxford OX1 3TG, UKFax:  +44 1865 272595

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


Re: [R] Warning message: package '...' was built under R version 2.3.0

2005-11-16 Thread Peter Dalgaard
Tuszynski, Jaroslaw W. [EMAIL PROTECTED] writes:

 I do have single version of R (2.2.0) and all packages I have were installed
 by downloading precompiled packages from PA or NC repositories within last
 month. 
 
 I also just managed to download 'modeltools' from PA2 and its DESCRIPTION
 says:
 Built: R 2.3.0; ; 2005-11-04 20:47:47; windows
 
 R console:
 
utils:::menuInstallPkgs()
   --- Please select a CRAN mirror for use in this session ---
   trying URL
 'http://lib.stat.cmu.edu/R/CRAN/bin/windows/contrib/2.2/modeltools_0.2-0.zip
 '
   Content type 'application/zip' length 64426 bytes
   opened URL
   downloaded 62Kb
 
   package 'modeltools' successfully unpacked and MD5 sums checked
 
   The downloaded packages are in
   C:\Documents and Settings\tuszynskij\Local
 Settings\Temp\Rtmp4458\downloaded_packages
   updating HTML package descriptions
library(modeltools)
   Error in load(dataFile, ns) : ReadItem: unknown type 241
   In addition: Warning message:
   package 'modeltools' was built under R version 2.3.0 
   Error: unable to load R code in package 'modeltools'
   Error: package/namespace load failed for 'modeltools'
 
 The same package downloaded from PA1 does not give me any warnings or
 errors.
 
 Jarek Tuszynski

Yes. The Statlib mirror (which I suppose is what you call PA2) appears
to be badly messed up.

The packages under 

http://lib.stat.cmu.edu/R/CRAN/bin/windows/contrib

seem not to have been updated since 2004, whereas (e.g.)

http://lib.stat.cmu.edu/R/CRAN/bin/windows/contrib/r-release/gRbase_0.1.23.zip

carries the Built: 2.3.0 line in the DESCRIPTION file.

Even stranger, looking in R/CRAN/bin/windows/contrib shows no
subfolder r-release, and R/CRAN/bin/windows/contrib/r-release contains
version 0.1.13 of gRbase!

In short, use another mirror until this one gets sorted out...



 
 -Original Message-
 From: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED] 
 Sent: Wednesday, November 16, 2005 1:04 PM
 To: Tuszynski, Jaroslaw W.
 Cc: r-help@stat.math.ethz.ch
 Subject: Re: [R] Warning message: package '...' was built under R version
 2.3.0
 
 
 Tuszynski, Jaroslaw W. wrote:
 
  Uwe,
  
  I think I used following repositories: PA1, PA2 and NC, which are the 
  closest to me and I think I got the same results in all. The package I 
  downloaded was coin which downloaded other packages. The consol 
  printout
  follows:
  
  
  
 chooseCRANmirror()
 utils:::menuInstallPkgs()
  
  trying URL 
  'http://www.ibiblio.org/pub/languages/R/CRAN/bin/windows/contrib/2.2/c
  oin_0.
  3-3.zip'
  Content type 'application/zip' length 793299 bytes
  opened URL
  downloaded 774Kb
  
  package 'coin' successfully unpacked and MD5 sums checked
  
  The downloaded packages are in
  C:\Documents and Settings\tuszynskij\Local 
  Settings\Temp\Rtmp7594\downloaded_packages
  updating HTML package descriptions
  
 library(coin)
  
  Loading required package: survival
  Loading required package: splines
  Loading required package: mvtnorm
  Loading required package: modeltools
  Error in load(dataFile, ns) : ReadItem: unknown type 241
  In addition: Warning messages:
  1: package 'mvtnorm' was built under R version 2.3.0
 
 
 I have just downloaded
 http://www.ibiblio.org/pub/languages/R/CRAN/bin/windows/contrib/2.2/mvtnorm_
 0.7-2.zip
 and its DESCRIPTION file correctly has:
 Built: R 2.2.0; i386-pc-mingw32; 2005-10-14 14:44:12; windows
 
 
 My guess is that you are using one library for two different R versions 
 and you have installed some R-devel package into the library you are now 
 using with R-2.2.0 ...
 
 You cannot mix binary packages for R  2.3.0 with those for R-devel due 
 to changes in environment handling.
 
 Uwe Ligges
 
 __
 R-help@stat.math.ethz.ch mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
 

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

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


[R] X11 error in png

2005-11-16 Thread Jack Zhu
Hi all,

When I ran a script containing the following codes:

png(paste(savepath,a_rnaplot.png,sep = ),width = fwidth, height = 
fheight,pointsize = fpointsize);
data_deg - AffyRNAdeg(data_cel)
plotAffyRNAdeg(data_deg,col=cols,lty=1,lwd = 2)
#a - par(fin)
legend(bottomright,sampleNames(data_cel),col=cols,lty=1)
RNAdegSlope = cbind(Sample Names = data_deg$sample.names, RNA Deg Slope 
= data_deg$slope)
write.csv(RNAdegSlope, file = paste(savepath,RNAdegSlope.csv,sep = ))
dev.off()

I got this error message:
Error in X11(paste(png::, filename, sep = ), width, height, pointsize,  
: 
unable to start device PNG
In addition: Warning message:
unable to open connection to X11 display '' 


My system:

Linux AS 4.0 64-bit





PATH=/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:/usr/X11



Jack Zhu, MD, MS

Lombardi Cancer center
Georgetown University
3970 Reservoir Rd, NW, NRB, W405b
Washington, DC 20057
Email: [EMAIL PROTECTED]
Tel: (202)-687-7451
Web: http://clarkelabs.georgetown.edu

[[alternative HTML version deleted]]

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


[R] How to choose a validation set

2005-11-16 Thread Julio Thomas
Dear R-helpers,
   
  I am working with a time series data set of 1000 observations and I am runnig 
several models on it. I divided the sample in three sets: estimation [1:700], 
validation, [701:990] and test [991:1000].
   
  Now I was wondering if there is a more elegant way to do this. 
  Are you aware of a standard approach using R functions? 
  Or if you could just suggest me some references I would really appreaciate it.
   
  Thansk a lot in advance.
  Regards,
  J. 


-

[[alternative HTML version deleted]]

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


Re: [R] X11 error in png

2005-11-16 Thread Liaw, Andy
Does this help?
http://cran.r-project.org/doc/FAQ/R-FAQ.html#How-do-I-produce-PNG-graphics-i
n-batch-mode_003f

Andy

From: Jack Zhu
 
 Hi all,
 
 When I ran a script containing the following codes:
 
 png(paste(savepath,a_rnaplot.png,sep = ),width = 
 fwidth, height = fheight,pointsize = fpointsize);
 data_deg - AffyRNAdeg(data_cel)
 plotAffyRNAdeg(data_deg,col=cols,lty=1,lwd = 2)
 #a - par(fin)
 legend(bottomright,sampleNames(data_cel),col=cols,lty=1)
 RNAdegSlope = cbind(Sample Names = 
 data_deg$sample.names, RNA Deg Slope = data_deg$slope)
 write.csv(RNAdegSlope, file = 
 paste(savepath,RNAdegSlope.csv,sep = ))
 dev.off()
 
 I got this error message:
 Error in X11(paste(png::, filename, sep = ), width, 
 height, pointsize,  : 
 unable to start device PNG
 In addition: Warning message:
 unable to open connection to X11 display '' 
 
 
 My system:
 
 Linux AS 4.0 64-bit
 
 
 
 
 
 PATH=/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/bin:/bin:
 /usr/bin:/usr/X11
 
 
 
 Jack Zhu, MD, MS
 
 Lombardi Cancer center
 Georgetown University
 3970 Reservoir Rd, NW, NRB, W405b
 Washington, DC 20057
 Email: [EMAIL PROTECTED]
 Tel: (202)-687-7451
 Web: http://clarkelabs.georgetown.edu
 
   [[alternative HTML version deleted]]
 
 __
 R-help@stat.math.ethz.ch mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide! 
 http://www.R-project.org/posting-guide.html
 


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


Re: [R] Warning message: package '...' was built under R version 2.3.0

2005-11-16 Thread Tuszynski, Jaroslaw W.

 Yes. The Statlib mirror (which I suppose is what you call PA2) appears to

 be badly messed up.

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

Peter,

Thanks for checking on this problem. 

My names for CRAN mirror sites (PA 1, PA 2, NC, etc.) came from that is
shown in windows RGui when you choose Packages/Set CRAN mirror menu. All
mirrors are represented by Country (city) for most of the world except US
which is shown as USA (state abbreviation + number). So what I call PA 1
means USA/Pennsylvania #1, etc. Names you are using (Statlib mirror) are
not visible in GUI. Just a clarification.

Jarek Tuszynski

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


[R] update R packages in local repos

2005-11-16 Thread Muhammad Subianto
I try to update R packages via my local repository.
I put all R packages in g:/myFolder/myRepository, I do like

 library(tools)
 write_PACKAGES(g:/myFolder/myRepository)
 options(repos=c(LocalR=file://g:/myFolder/myRepository))
 getOption(repos)
   LocalR
file://g:/myFolder/myRepository
 update.packages(ask = graphics)
Error in gzfile(file, r) : unable to open connection
In addition: Warning message:
cannot open compressed file
':/myFolder/myRepository/bin/windows/contrib/2.2/PACKAGES'

 ?update.packages

It produces these file in g:/myFolder/myRepository
PACKAGES
PACKAGES.gz

Could I make this folder (bin/windows/contrib/2.2/)? Why?

Regards, Muhammad Subianto


 version
 _
platform i386-pc-mingw32
arch i386
os   mingw32
system   i386, mingw32
status
major2
minor2.0
year 2005
month10
day  06
svn rev  35749
language R


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


Re: [R] update R packages in local repos

2005-11-16 Thread P Ehlers
This should work:

update.packages(ask = graphics, repos = NULL,
 contriburl = file:///g:/myFolder/myRepository))

-peter

Muhammad Subianto wrote:
 I try to update R packages via my local repository.
 I put all R packages in g:/myFolder/myRepository, I do like
 
 
library(tools)
write_PACKAGES(g:/myFolder/myRepository)
options(repos=c(LocalR=file://g:/myFolder/myRepository))
getOption(repos)
 
LocalR
 file://g:/myFolder/myRepository
 
update.packages(ask = graphics)
 
 Error in gzfile(file, r) : unable to open connection
 In addition: Warning message:
 cannot open compressed file
 ':/myFolder/myRepository/bin/windows/contrib/2.2/PACKAGES'
 
?update.packages
 
 
 It produces these file in g:/myFolder/myRepository
 PACKAGES
 PACKAGES.gz
 
 Could I make this folder (bin/windows/contrib/2.2/)? Why?
 
 Regards, Muhammad Subianto
 
 
 
version
 
  _
 platform i386-pc-mingw32
 arch i386
 os   mingw32
 system   i386, mingw32
 status
 major2
 minor2.0
 year 2005
 month10
 day  06
 svn rev  35749
 language R
 
 
 __
 R-help@stat.math.ethz.ch mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

-- 
Peter Ehlers
Department of Mathematics and Statistics
University of Calgary, 2500 University Dr. NW

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


Re: [R] X11 error in png

2005-11-16 Thread David Scott

I managed to delete the original post about this and will no doubt mess up 
threading of responses. The post is shown below.

This looks like a problem I saw just a couple of days ago. I noticed that 
you used a path variable in determining the file location and name. If 
something is wrong with your path (e.g. the directories it specifies don't 
exist) I think you will get this error.

Check your path to make sure it is ok.

David Scott


***
Original post
***


From: Jack Zhu yz8_at_georgetown.edu
Date: Thu 17 Nov 2005 - 08:47:27 EST


Hi all,

When I ran a script containing the following codes:

 png(paste(savepath,a_rnaplot.png,sep = ),width = fwidth, height = 
fheight,pointsize = fpointsize); data_deg - AffyRNAdeg(data_cel)
 plotAffyRNAdeg(data_deg,col=cols,lty=1,lwd = 2) #a - par(fin)
 legend(bottomright,sampleNames(data_cel),col=cols,lty=1) 
RNAdegSlope = cbind(Sample Names = data_deg$sample.names, RNA Deg 
Slope = data_deg$slope) write.csv(RNAdegSlope, file = 
paste(savepath,RNAdegSlope.csv,sep = )) dev.off()

I got this error message:

 Error in X11(paste(png::, filename, sep = ), width, height, 
pointsize, :

 unable to start device PNG
 In addition: Warning message:
 unable to open connection to X11 display ''

My system:

Linux AS 4.0 64-bit

PATH=/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:/usr/X11

Jack Zhu, MD, MS

Lombardi Cancer center
Georgetown University
3970 Reservoir Rd, NW, NRB, W405b
Washington, DC 20057
Email: [EMAIL PROTECTED]
Tel: (202)-687-7451
Web: http://clarkelabs.georgetown.edu



-- 
_
David Scott Department of Statistics, Tamaki Campus
The University of Auckland, PB 92019
AucklandNEW ZEALAND
Phone: +64 9 373 7599 ext 86830 Fax: +64 9 373 7000
Email:  [EMAIL PROTECTED]


Graduate Officer, Department of Statistics

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


[R] GEE in Fortran

2005-11-16 Thread Zhu Wang
Dear all,

Does anybody happen to have written some GEE source code in Fortran to 
solve a Generalized Estimation Equation Model? Or kindly point out me a 
good starting point. Thanks.

 Zhu Wang
 SCHARP

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


[R] Is it feasible with R?

2005-11-16 Thread Louis Longchamps

   My data are (for one experiment):

   3 Types of plant (1,2,3)

   4  Species  per  Type (ex:for type 1(a,b,c,d), for type 2(e,f,g,h) and
   for type 3(i,j,k,l)

   8 Repetitions of each Species

   3 Stages (10, 20, 30)

   2  Measures per Stages, for the stages 20 and 30 (ex: for Stage 10(C),
   for Stage 20 (A and B) and for Stage 30 (A and B)

   3  Types  x  4 Species(Type) x 8 Repetitions x (1 Stage x 1 Mesure + 2
   Stages  x  2  Measures= 480 data. There are 10 data missing. The final
   number of data is 470.

   My questions that I ask to my data:

   1- Is there a significant difference between Measure A and Measure B?

   2- Is there a significant difference between Stages 10, 20 and 30?

   3- Is there a significant difference between the 3 plant Types?

   I haven't found  any way to consider the whole data lot in one shot, I
   decided to remove the first stage with the Measure C that comes with
   it. It bring the number of data to 384.

   Is it possible to consider the whole lot in one shot?

   Thus my model is

   Sourced.l.

   Types  2

   Species (Type)  9

   Error a)84


   Stage  1

   Measure   1

   Stage x Measure   1

   Stage x Type2

   Measure x Type 2

   Stage x Measure x Type 2

   Stage x Species (Type)  9

   Measure x Species (Type)   9

   Stage x Measure x Species (Type)9

   Erreur b) 252

   Total   383

   How  can I write this in R? My problem is that when I use %in% to nest
   Species in Type, R looks, for exemple, for specie a in Type 2 and it
   finds nothing and returns Na.

   Type1:Plante[T.a]  -1.519670.82774  -1.836   0.0672 .
   Type2:Plante[T.a]NA NA  NA   NA

   Can  you  help  me?  Can  R  consider  Species a,b,c,d only in Type 1,
   Species e,f,g,h only in Type 2 and Species i,j,k,l only in Type 3?

   Thank you very much.
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] Portable R?

2005-11-16 Thread David Mitchell
Hello list,

A short time ago, I found
http://johnhaller.com/jh/useful_stuff/portable_apps_suite/, which
contains basically a complete set of office tools that can be run
*entirely* from a USB key.  The concept is:
- find a Windows PC
- put in your USB key
- run OpenOffice, Firefox, Gaim, Nvu, Thunderbird, ... directly from
your USB key, with no app installation required
- save your files wherever
- remove your USB key and leave, with nothing installed on the original PC

As a consultant who battles regularly with limited toolsets at
customer sites, this strikes me as an extremely handy way of working.

Has anyone managed to setup a base R configuration that runs entirely
from USB key?  Being a regular user, but no expert, with R, it'd be
very helpful for me if such a mechanism existed, but I've got no idea
where to begin in building such a thing.

Thanks in advance for any responses or suggestions

Dave M.

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


Re: [R] Portable R?

2005-11-16 Thread Wensui Liu
David,

I've run old version of R (2 years ago) from a CD and it worked well for me.
I guess you could run R from a USB drive.

On 11/16/05, David Mitchell [EMAIL PROTECTED] wrote:

 Hello list,

 A short time ago, I found
 http://johnhaller.com/jh/useful_stuff/portable_apps_suite/, which
 contains basically a complete set of office tools that can be run
 *entirely* from a USB key. The concept is:
 - find a Windows PC
 - put in your USB key
 - run OpenOffice, Firefox, Gaim, Nvu, Thunderbird, ... directly from
 your USB key, with no app installation required
 - save your files wherever
 - remove your USB key and leave, with nothing installed on the original PC

 As a consultant who battles regularly with limited toolsets at
 customer sites, this strikes me as an extremely handy way of working.

 Has anyone managed to setup a base R configuration that runs entirely
 from USB key? Being a regular user, but no expert, with R, it'd be
 very helpful for me if such a mechanism existed, but I've got no idea
 where to begin in building such a thing.

 Thanks in advance for any responses or suggestions

 Dave M.

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




--
WenSui Liu
(http://statcompute.blogspot.com)
Senior Decision Support Analyst
Cincinnati Children Hospital Medical Center

[[alternative HTML version deleted]]

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


Re: [R] Portable R?

2005-11-16 Thread Dirk Eddelbuettel

On 17 November 2005 at 14:16, David Mitchell wrote:
| Hello list,
| 
| A short time ago, I found
| http://johnhaller.com/jh/useful_stuff/portable_apps_suite/, which
| contains basically a complete set of office tools that can be run
| *entirely* from a USB key.  The concept is:
| - find a Windows PC
| - put in your USB key
| - run OpenOffice, Firefox, Gaim, Nvu, Thunderbird, ... directly from
| your USB key, with no app installation required
| - save your files wherever
| - remove your USB key and leave, with nothing installed on the original PC
| 
| As a consultant who battles regularly with limited toolsets at
| customer sites, this strikes me as an extremely handy way of working.
| 
| Has anyone managed to setup a base R configuration that runs entirely
| from USB key?  Being a regular user, but no expert, with R, it'd be
| very helpful for me if such a mechanism existed, but I've got no idea
| where to begin in building such a thing.

Short answer:
Yes but using Linux, requiring a larger USB stick and some fiddling.

Longer answer: 
Quantian (http://dirk.eddelbuettel.com/quantian) is a everything, 
the kitchen sink and some Linux distribution running off a DVD. Quantian is
focussed on quantitative / numeric apps, and tends to include R plus related
goodies -- the last release had an almost complete set of CRAN and
BioConductor packages. The raw size of the last release is around 2 GB,
corresponding to 6.6 GB expanded.  Marco Caliari, who often contributes
improved boot code to Quantian, has managed to boot Quantian off a USB
stick. I didn't manage to do that with my laptop, possibly because of
limitations in its bios. Some of this was discussed in past threads on the
quantian-general mailing list.

Lots-o-work suggestion:
To not require a huge USB stick, you could try to shrink a given live
cdrom such as Knoppix or Ubuntu, then add R and other goodies such that
you're left with around 512 MB compressed. Then throw it onto a USB stick and
make it bootable.

Shortcut:
Order a Quantian DVD. Some folks sell them pre-made for less than $5.
Experiment with that, If you like it, consider making your own mini-distro.
Or stick with the DVD and use it directly with the USB stick for your
configuration, data, demos, ...

Even shorter:
R is perfectly relocatable. If you install the Windows binary onto
the USB drive, it will run fine. You'll probably need to add editors and
other tools.

Hope this helps, Dirk

-- 
Statistics: The (futile) attempt to offer certainty about uncertainty.
 -- Roger Koenker, 'Dictionary of Received Ideas of Statistics'

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


[R] some questions

2005-11-16 Thread yuying shi
Dear R expert,
 The following is my questions:

1. How to generate two sequences of 150 uniform
deviates, called v1 and v2, in the range [-1,1]. 
2. How to compute  r=(v1)^2+(v2)^2
3.If r is outside the range of (0,1) then it will be
discarded. 
4 How to compute (v1)*sqrt(-2*log(r)/r) and output the
first 100 z values in the list. 
5. Plot histograms for the sequences from steps 1 and
2. 

Thanks very much for your help!

xingyu

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


[R] R questions

2005-11-16 Thread Yuying Shi
Dear Sir/Madam,
 I am a beginner in R. Here is my questions.
 1. Can you give me one test for randomness (a name and descriptive
paragraph is sufficient).
2. I have learned a uniform random number generator [e.g. not the
algorithms: i)Wichmann-Hill, ii) Marsaglia-Multicarry, iii) Super-Duper
(Marsaglia), iv) Mersenne-Twister, v) TAOCP-1997 (Knuth), or vi) TAOCP-2002
(Knuth)] . Is there any other method besides that?
3. How to generate 100 random standard normal deviates using the Box-Muller
method for standard normal random deviates and sort the sequence, smallest
to largest?
  Your kind help is greatly appreciated. Thanks in advance!
 best wishes
yuying shi

[[alternative HTML version deleted]]

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


Re: [R] Portable R?

2005-11-16 Thread David Mitchell
Thanks guys,

Dirk: I generally resort to using my laptop for R analysis, but it
usually involves dragging loads of data multiple times between a
customer system and my laptop.  Moving large amounts of data in this
fashion can be a problem, particularly when there's sensitivity issues
about the data itself.

I've used Quantian in the past, and I've customised my own Knoppix
CDs, but ideally I'd like to run *my* tools (i.e. R) on *their* system
so I'm not having to deal with the logistical and security issues that
come with moving data around between systems.

I didn't realise that the Windows version of R was relocatable that
easily - I just assumed the install did something more complex than
that.  I'll try copying the R files to a USB key later today.

Thanks again

Dave M.


On 11/17/05, Dirk Eddelbuettel [EMAIL PROTECTED] wrote:

 On 17 November 2005 at 14:16, David Mitchell wrote:
 | Hello list,
 |
 | A short time ago, I found
 | http://johnhaller.com/jh/useful_stuff/portable_apps_suite/, which
 | contains basically a complete set of office tools that can be run
 | *entirely* from a USB key.  The concept is:
 | - find a Windows PC
 | - put in your USB key
 | - run OpenOffice, Firefox, Gaim, Nvu, Thunderbird, ... directly from
 | your USB key, with no app installation required
 | - save your files wherever
 | - remove your USB key and leave, with nothing installed on the original PC
 |
 | As a consultant who battles regularly with limited toolsets at
 | customer sites, this strikes me as an extremely handy way of working.
 |
 | Has anyone managed to setup a base R configuration that runs entirely
 | from USB key?  Being a regular user, but no expert, with R, it'd be
 | very helpful for me if such a mechanism existed, but I've got no idea
 | where to begin in building such a thing.

 Short answer:
 Yes but using Linux, requiring a larger USB stick and some fiddling.

 Longer answer:
 Quantian (http://dirk.eddelbuettel.com/quantian) is a everything,
 the kitchen sink and some Linux distribution running off a DVD. Quantian is
 focussed on quantitative / numeric apps, and tends to include R plus related
 goodies -- the last release had an almost complete set of CRAN and
 BioConductor packages. The raw size of the last release is around 2 GB,
 corresponding to 6.6 GB expanded.  Marco Caliari, who often contributes
 improved boot code to Quantian, has managed to boot Quantian off a USB
 stick. I didn't manage to do that with my laptop, possibly because of
 limitations in its bios. Some of this was discussed in past threads on the
 quantian-general mailing list.

 Lots-o-work suggestion:
 To not require a huge USB stick, you could try to shrink a given live
 cdrom such as Knoppix or Ubuntu, then add R and other goodies such that
 you're left with around 512 MB compressed. Then throw it onto a USB stick and
 make it bootable.

 Shortcut:
 Order a Quantian DVD. Some folks sell them pre-made for less than $5.
 Experiment with that, If you like it, consider making your own mini-distro.
 Or stick with the DVD and use it directly with the USB stick for your
 configuration, data, demos, ...

 Even shorter:
 R is perfectly relocatable. If you install the Windows binary onto
 the USB drive, it will run fine. You'll probably need to add editors and
 other tools.

 Hope this helps, Dirk

 --
 Statistics: The (futile) attempt to offer certainty about uncertainty.
  -- Roger Koenker, 'Dictionary of Received Ideas of Statistics'


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


Re: [R] Portable R?

2005-11-16 Thread Jacob Michaelson
I use SLAX on my USB stick (1GB) and I carry R, a host of contributed  
R packages, all the core BioC packages, rkward as the R frontend,  
Octave, and many many more.  SLAX is in my experience much smaller,  
lighter, faster, and more complete than any of the other Linux Live  
CDs out there (my installation with all these packages is about ~600  
MB).  Heck, I even installed my remastered SLAX onto my iPod nano!

Give it a shot.

--Jake

On Nov 16, 2005, at 9:11 PM, David Mitchell wrote:

 Thanks guys,

 Dirk: I generally resort to using my laptop for R analysis, but it
 usually involves dragging loads of data multiple times between a
 customer system and my laptop.  Moving large amounts of data in this
 fashion can be a problem, particularly when there's sensitivity issues
 about the data itself.

 I've used Quantian in the past, and I've customised my own Knoppix
 CDs, but ideally I'd like to run *my* tools (i.e. R) on *their* system
 so I'm not having to deal with the logistical and security issues that
 come with moving data around between systems.

 I didn't realise that the Windows version of R was relocatable that
 easily - I just assumed the install did something more complex than
 that.  I'll try copying the R files to a USB key later today.

 Thanks again

 Dave M.


 On 11/17/05, Dirk Eddelbuettel [EMAIL PROTECTED] wrote:

 On 17 November 2005 at 14:16, David Mitchell wrote:
 | Hello list,
 |
 | A short time ago, I found
 | http://johnhaller.com/jh/useful_stuff/portable_apps_suite/, which
 | contains basically a complete set of office tools that can be run
 | *entirely* from a USB key.  The concept is:
 | - find a Windows PC
 | - put in your USB key
 | - run OpenOffice, Firefox, Gaim, Nvu, Thunderbird, ... directly  
 from
 | your USB key, with no app installation required
 | - save your files wherever
 | - remove your USB key and leave, with nothing installed on the  
 original PC
 |
 | As a consultant who battles regularly with limited toolsets at
 | customer sites, this strikes me as an extremely handy way of  
 working.
 |
 | Has anyone managed to setup a base R configuration that runs  
 entirely
 | from USB key?  Being a regular user, but no expert, with R, it'd be
 | very helpful for me if such a mechanism existed, but I've got no  
 idea
 | where to begin in building such a thing.

 Short answer:
 Yes but using Linux, requiring a larger USB stick and some  
 fiddling.

 Longer answer:
 Quantian (http://dirk.eddelbuettel.com/quantian) is a  
 everything,
 the kitchen sink and some Linux distribution running off a DVD.  
 Quantian is
 focussed on quantitative / numeric apps, and tends to include R  
 plus related
 goodies -- the last release had an almost complete set of CRAN and
 BioConductor packages. The raw size of the last release is around  
 2 GB,
 corresponding to 6.6 GB expanded.  Marco Caliari, who often  
 contributes
 improved boot code to Quantian, has managed to boot Quantian off a  
 USB
 stick. I didn't manage to do that with my laptop, possibly because of
 limitations in its bios. Some of this was discussed in past  
 threads on the
 quantian-general mailing list.

 Lots-o-work suggestion:
 To not require a huge USB stick, you could try to shrink a  
 given live
 cdrom such as Knoppix or Ubuntu, then add R and other goodies such  
 that
 you're left with around 512 MB compressed. Then throw it onto a  
 USB stick and
 make it bootable.

 Shortcut:
 Order a Quantian DVD. Some folks sell them pre-made for  
 less than $5.
 Experiment with that, If you like it, consider making your own  
 mini-distro.
 Or stick with the DVD and use it directly with the USB stick for your
 configuration, data, demos, ...

 Even shorter:
 R is perfectly relocatable. If you install the Windows  
 binary onto
 the USB drive, it will run fine. You'll probably need to add  
 editors and
 other tools.

 Hope this helps, Dirk

 --
 Statistics: The (futile) attempt to offer certainty about  
 uncertainty.
  -- Roger Koenker, 'Dictionary of Received Ideas of  
 Statistics'


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

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


Re: [R] Portable R?

2005-11-16 Thread Dirk Eddelbuettel

On 17 November 2005 at 15:11, David Mitchell wrote:
| I didn't realise that the Windows version of R was relocatable that
| easily - I just assumed the install did something more complex than
| that.  I'll try copying the R files to a USB key later today.

Yup. I've installed it onto Windows SMB shares to provide little R apps with
tcl/tk apps to colleagues. Works very well until you hit snags like requiring
ODBC entry on each client which one can't script ... (as far as I know).

Cheers, Dirk

-- 
Statistics: The (futile) attempt to offer certainty about uncertainty.
 -- Roger Koenker, 'Dictionary of Received Ideas of Statistics'

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


[R] Morans I for Spatial Surveillance

2005-11-16 Thread Serryn Eagleson

Hello, 

I am interested in using Morans I for different time intervals to detect 
disease clusters. 

Ultimately I would like to use CUSUM - or similar monitoring statistic to 
monitor the results of Morans I - similar to the work by 
Rogerson (2005) Spatial Surveillance and Cummulative Sum Methods in Spatial and 
Syndromic Surveillance for Public Health. 

Thus far - thanks to the list I have Morans I running in a loop for each day 
(however I found that on some days no data is recorded, this caused an error to 
get around this error I included an elseif statement to skip the calculation 
for days where no disease notifications are recorded.) 

I am just wondering if anyone has code/advice for the best way to apprach the 
next stage of monitoring Morans I over different time intervals for the 
detection of abnormal clusters. My code thus far is below - I would also like 
to assemble the results in a neat table if anyone has tips for this I would alo 
appreciate it as I am rather new to R! 

Thanks
Serryn

T1-read.dbf(ob.dbf)
N - colnames(T1)

T2nb - read.gal(PC.gal,override=TRUE)
col.W - nb2listw(T2nb, style=W)

for(i in seq(N)) {   
  Vec1 - spNamedVec(N[i+7], T1)
  Svec1-sum(Vec1)
   ifelse ( Svec1 0, res[i]-moran.test(spNamedVec(N[i+7], T1), col.W, 
zero.policy=TRUE), res[i]-NULL) 

}

print(res)






[[alternative HTML version deleted]]

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


Re: [R] some questions

2005-11-16 Thread Ales Ziberna
Firstly, these are all very basic questions, thah you coukld probobly answer 
yourself by searching the manual and help files. Nevertheless, here are the 
answers to give you a little head start.

 Dear R expert,
 The following is my questions:

 1. How to generate two sequences of 150 uniform
 deviates, called v1 and v2, in the range [-1,1].
v1-runif(n=150,min=-1,max=1)
v2-runif(n=150,min=-1,max=1)

 2. How to compute  r=(v1)^2+(v2)^2
r-(v1)^2+(v2)^2

 3.If r is outside the range of (0,1) then it will be
 discarded.
newr-r[r1]
newr-newr[r0]

 4 How to compute (v1)*sqrt(-2*log(r)/r) and output the
 first 100 z values in the list.
z-(v1)*sqrt(-2*log(r)/r)
z[1:100] #or
print(z[1:100])

 5. Plot histograms for the sequences from steps 1 and
 2.
hist(v1)
hist(v2)
hist(r)


 Thanks very much for your help!
I hope this helps,

Ales Ziberna


 xingyu

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

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


[R] ECDF values

2005-11-16 Thread Vito Ricci
Dear UseRs,

maybe is a silly question: how can I get Empirical CDF
values from an object created with ecdf()?? Using
print I obtain:

Empirical CDF 
Call: ecdf(t)
 x[1:57] =4.1,4.4,4.5,  ...,  491.3,
671.27

Thanks in advance.

Regards,

Vito

Diventare costruttori di soluzioni
Became solutions' constructors

The business of the statistician is to catalyze 
the scientific learning process.  
George E. P. Box

Statistical thinking will one day be as necessary for efficient citizenship as 
the ability to read and write
H. G. Wells

Top 10 reasons to become a Statistician

 1. Deviation is considered normal
 2. We feel complete and sufficient
 3. We are 'mean' lovers
 4. Statisticians do it discretely and continuously
 5. We are right 95% of the time
 6. We can legally comment on someone's posterior distribution
 7. We may not be normal, but we are transformable
 8. We never have to say we are certain
 9. We are honestly significantly different
10. No one wants our jobs


Visitate il portale http://www.modugno.it/
e in particolare la sezione su Palese  
http://www.modugno.it/archivio/palesesanto_spirito/

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


Re: [R] update R packages in local repos

2005-11-16 Thread Prof Brian Ripley
On Wed, 16 Nov 2005, P Ehlers wrote:

 This should work:

 update.packages(ask = graphics, repos = NULL,
 contriburl = file:///g:/myFolder/myRepository))

Only if the so-called repository contains (only) binary builds under R 
2.2.x of packages for Windows.

It would be better to set up the 'repository' correctly as a repository. 
See my article in R-news 5/1 and the R-admin manual for the format of a 
repository.


 -peter

 Muhammad Subianto wrote:
 I try to update R packages via my local repository.
 I put all R packages in g:/myFolder/myRepository, I do like

Are these source packages or binary packages or what?

 library(tools)
 write_PACKAGES(g:/myFolder/myRepository)
 options(repos=c(LocalR=file://g:/myFolder/myRepository))
 getOption(repos)

LocalR
 file://g:/myFolder/myRepository

Your syntax is incorrect here: Peter has silently corrected it.
file:// syntax has an element for 'machine' followed by a third slash
(although 'machine' is not supported in R, so it should be empty).

 update.packages(ask = graphics)

 Error in gzfile(file, r) : unable to open connection
 In addition: Warning message:
 cannot open compressed file
 ':/myFolder/myRepository/bin/windows/contrib/2.2/PACKAGES'

 ?update.packages


 It produces these file in g:/myFolder/myRepository
 PACKAGES
 PACKAGES.gz

 Could I make this folder (bin/windows/contrib/2.2/)? Why?

-- 
Brian D. Ripley,  [EMAIL PROTECTED]
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford, Tel:  +44 1865 272861 (self)
1 South Parks Road, +44 1865 272866 (PA)
Oxford OX1 3TG, UKFax:  +44 1865 272595

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


Re: [R] nlme question

2005-11-16 Thread Deepayan Sarkar
On 11/16/05, Wassell, James T., Ph.D. [EMAIL PROTECTED] wrote:
 I am using the package nlme to fit a simple random effects (variance
 components model)

 with 3 parameters:  overall mean (fixed effect), between subject
 variance (random) and  within subject variance (random).

So to paraphrase, your model can be written as (with the index i
representing subject)

y_ij = \mu + b_i + e_ij

where

b_i ~ N(0, \tao^2)
e_ij ~ N(0, \sigma_2)
and all b_i's and e_ij's are mutually independent. The model has, as
you say, 3 parameters, \mu, \tao and \sigma.

 I have 16 subjects with 1-4 obs per subject.

 I need a 3x3 variance-covariance matrix that includes all 3 parameters
 in order to compute the variance of a specific linear combination.

Can you specify the 'linear combination' that you want to estimate in
terms of the model above?

Deepayan

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


Re: [R] Portable R?

2005-11-16 Thread Prof Brian Ripley
See the rw-FAQ Q2.6 for a more precise answer than has yet appeared in 
this thread.  A while back (for 2.1.0) some aspects of R were optimized 
for usage from a slow (and possibly read-only) drive.

This does presume that the sites you visit will allow you to run programs 
from an external drive, and in my experience that is often explicitly 
disallowed.

On Thu, 17 Nov 2005, David Mitchell wrote:

 Hello list,

 A short time ago, I found
 http://johnhaller.com/jh/useful_stuff/portable_apps_suite/, which
 contains basically a complete set of office tools that can be run
 *entirely* from a USB key.  The concept is:
 - find a Windows PC
 - put in your USB key
 - run OpenOffice, Firefox, Gaim, Nvu, Thunderbird, ... directly from
 your USB key, with no app installation required
 - save your files wherever
 - remove your USB key and leave, with nothing installed on the original PC

 As a consultant who battles regularly with limited toolsets at
 customer sites, this strikes me as an extremely handy way of working.

 Has anyone managed to setup a base R configuration that runs entirely
 from USB key?  Being a regular user, but no expert, with R, it'd be
 very helpful for me if such a mechanism existed, but I've got no idea
 where to begin in building such a thing.

 Thanks in advance for any responses or suggestions

-- 
Brian D. Ripley,  [EMAIL PROTECTED]
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford, Tel:  +44 1865 272861 (self)
1 South Parks Road, +44 1865 272866 (PA)
Oxford OX1 3TG, UKFax:  +44 1865 272595

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


[R] generalised linear mixed effect model, glmmPQL

2005-11-16 Thread Patrick Giraudoux
Dear listers,

I am trying to get more familiar with concepts underlying generalised 
linear mixed models, mainly through Venables and Ripley (fourth edition) 
and the R-list archive. Of course, as a  possibly tool-user biologist I 
am not that easy with every détails of the mathematical aspects of the 
optimisation methods described. I am trying to sort out which could be 
an acceptable strategy for model comparisons and selection. I have 
understood from the R-list archive that AIC and similar approaches are 
not valid for model comparisons with PQL. On the other hand, table 10.4 
in Venables and Ripley compares the results of various fitting methods 
(thus the fitting methods), but my wonder is about  comparing  models 
(or parameter estimates) given a  method.

Can somebody put me on the track with some hints or  basic references 
for dummies if any...

Thanks in advance,

Patrick

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