Re: [R] NAs in optim

2006-01-23 Thread Hannu Kahra
sum(na.rm=TRUE) works and gives a solution, but in that case I will loose
observations, since if any caw[i,j], mom[i,j] or me[i,j] is a NA, retp[i]
will be a NA in the following

retp[i] - (caw[i,j]+1/24*(b1*mom[i,j] + b2*me[i,j] + b3*btm[i,j]))*ret[i,j]

caw[i,j] is the weight of stock j at date i in a benchmark portfolio;  b1,
b2 and b3 are the coefficients to be estimated; mom[i,j], me[i,j] and
btm[i,j]  are  the characteristics  of  stock  j  at  date  i; and ret[i,j]
is the return on stock j at date i. Rather than estimating one weight for
each stock, I estimate weights as a single function of characteristics that
applies to all 24 stocks.

Prof. Ripley is right; I have NAs in my data using optim, not in optim
itself.

On 1/23/06, Prof Brian Ripley [EMAIL PROTECTED] wrote:

 This is NAs in your own code, not in optim!  Please use a truthful
 subject.

 Consider the use of sum(na.rm=TRUE) rather than your inner loop.

 On Sun, 22 Jan 2006, Hannu Kahra wrote:

  Hi,
 
  I am trying to maximize a utility function using optim. I have a problem
  with optim, since some of the values in the caw, mom, me and btm
 matrixes in
  the code bellow are missing. Is there a handy way just to skip the
 missing
  values in the loop?
 
  g - 5
  retp - NULL
  object - function (x)
  {
 b1 - x[1]
 b2 - x[2]
 b3 - x[3]
 for(i in 1:nrow(ret)){
 for(j in 1:ncol(ret)){
 retp[i] - (caw[i,j]+1/24*(b1*mom[i,j] + b2*me[i,j] +
  b3*btm[i,j]))*ret[i,j]
 }
 }
 util - (1+retp)^(1-g)/(1-g)
 return(-sum(util))
  }
  result - optim(c(2.0,-1.0,3.5
  ),object,control=list(maxit=500),hessian=TRUE,method=BFGS)
 
  Thank you in advance.
  Hannu Kahra
 
[[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
 

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


[[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] Latest revision of lme4 requires 'Matrix' = 0.995.2 but that version is not available on CRAN

2006-01-23 Thread Uwe Ligges
John Logsdon wrote:

 I've just hit this problem as well and as I am slumming it on XP at the
 moment, I don't have the compilation tools to use the .tar.gz version.

So please follow that thread and note that people were already working 
on it for you during the whole weekend!
In this case, it does not help to have the tools. The Windows binary 
package maintainer has had his reasons not to publish the most recent 
Matrix version.

 I also notice that the numbering format has changed.  Is this intentional?

Yes.

Uwe Ligges


 Best wishes
 
 John
 
 John Logsdon   Try to make things as simple
 Quantex Research Ltd, Manchester UK as possible but not simpler
 [EMAIL PROTECTED]  [EMAIL PROTECTED]
 +44(0)161 445 4951/G:+44(0)7717758675   www.quantex-research.com
 
 
 On Sat, 21 Jan 2006, Søren Højsgaard wrote:
 
 
I just updated the packages on my pc (windows xp). When loading lme4 I get
 
  library(lme4)
Error: package 'Matrix' 0.995-1 was found, but = 0.995.2 is required by 
'lme4'

'Matrix'  0.995-1 is indeed installed on my computer, but update.packages() 
does not capture a never version; and seemingly for good reasons: When 
looking at CRAN, the new version of Matrix is available - but only as a 
.tar.gz archive. Two questions
 
1) How can a new version of lme4 make its way to CRAN when the packages it 
depends on are not available (that is, in a zip-version)?
 
An answer could be: Buhh, you can just download the .tar.gz archive and then 
compile it yourself! Surely, that would be possible, but it can not be the 
intention...
 
2) When actually trying to compile Matrix, I get
 
lmer.o(.text+0x285f):lmer.c: undefined reference to `atanh'
make[3]: *** [Matrix.dll] Error 1
make[2]: *** [srcDynlib] Error 2
make[1]: *** [all] Error 2
make: *** [pkg-Matrix] Error 2
*** Installation of Matrix failed ***
Removing 'c:/programs/R/current/library/Matrix'
Restoring previous 'c:/programs/R/current/library/Matrix'
 
Can anyone help me on what to do???
Thanks / Søren

__
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-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] Run R in background?

2006-01-23 Thread Detlef Steuer
Hi,

look for BATCH in the manual. 
(The other friend is called nohup on unix)

Detlef

On Fri, 20 Jan 2006 13:53:05 -0800 (PST)
luk [EMAIL PROTECTED] wrote:

 According to the manual, a R script can be run in as follows in linux.

   $ R
source(xy.R)

   Does this mean we have to type R first, and then within R, type: 
 source(xy.R)?

   Is there other way to run xy.R, say 

   $ R CMD SOURCE xy.R

   Is there any way to run R in background?

   Luk

 
   
 -
 
  Photo Books. You design it and we’ll bind it!
   [[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] chm.help in windows

2006-01-23 Thread Thomas Steiner
options(chmhelp=TRUE)
help(package=fCalendar)

does not open teh windows help browser, but

help(CalendarData, package=fCalendar)

does. Why? A bug?
I use R 2.1.1 under Windows2000
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 with plot.svm from e1071

2006-01-23 Thread David Meyer
Josh,

the problem here is that your code and mine refer to x and
non-standard evaluation happens in points(), looking up x in the
object supplied to data. So your code will work when you are using,
e.g., xx instead of x in the data frame and the call to svm(). I
will fix this ASAP, thanks for pointing this out...

Cheers,

David.

--

Hi.

I'm trying to plot a pair of intertwined spirals and an svm that
separates them. I'm having some trouble. Here's what I tried.

 library(mlbench)
 library(e1071)
Loading required package: class
 raw - mlbench.spirals(200,2)
 spiral - data.frame(class=as.factor(raw$classes), x=raw$x[,1], y=raw$x[,2])
 m - svm(class~., data=spiral)
 plot(m, spiral)
Error in -x$index : invalid argument to unary operator

So we delve into e1071:::plot.svm. When I run the code in plot.svm
everything is fine up until
 points(formula, data = data[-x$index, ], pch = dataSymbol,
 col = symbolPalette[colind[-x$index]])
That gives me the same error message, Error in -x$index : invalid
argument to unary operator. The weird thing is that I can run either
of the those statements in isolation
data[-x$index, ]
symbolPalette[colind[-x$index]]
and neither gives me an error. I looked in the two points functions I


can see (points.default and points.formula) but neither calls x$index.

I was following along the documentation for plot.svm, which has a
simple example (that works)
## a simple example
library(MASS)
data(cats)
m - svm(Sex~., data = cats)
plot(m, cats)

I don't see what the difference between their example and mine.


-- 
Dr. David Meyer
Department of Information Systems and Operations

Vienna University of Economics and Business Administration
Augasse 2-6, A-1090 Wien, Austria, Europe
Fax: +43-1-313 36x746 
Tel: +43-1-313 36x4393
HP:  http://wi.wu-wien.ac.at/~meyer/

__
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] FW: aggregating variables with pca

2006-01-23 Thread Christian Jones

Christian Jones [EMAIL PROTECTED] schrieb am 19.01.06 16:58:58:




hello R_team

having perfomed a PCA on my fitted model with the function:

data- na.omit(dataset) 

data.pca-prcomp(data,scale =TRUE),

I´ve decided to aggregate two variables that are highly correlated.

My first question is:

How can I combine the two variables into one new predictor?

and secondly:

How can I predict with the newly created variable in a new dataset? 

Guess I need the predict and new data command but I´m having problems with 
the syntax and the help function was not sufficient on this issue.

many thanks in advance

Christian







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





Erweitern Sie FreeMail zu einem noch leistungsstarkeren E-Mail-Postfach!



[[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] chm.help in windows

2006-01-23 Thread Henrik Bengtsson
Same in R v2.2.1 patched (2006-01-01 r36947) and Rv2.3.0 (2006-01-01 
r36947). /Henrik

Thomas Steiner wrote:
 options(chmhelp=TRUE)
 help(package=fCalendar)
 
 does not open teh windows help browser, but
 
 help(CalendarData, package=fCalendar)
 
 does. Why? A bug?
 I use R 2.1.1 under Windows2000
 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] Making a markov transition matrix

2006-01-23 Thread Ingmar Visser
Ajay,
On a similar note, there are two other packages as well for similar models:
hmm.discnp for hidden Markov models of univariate discrete non-parametric
distributions and depmix for hidden Markov models for multivariate data, ie
gaussians, multinomials etc, and combinations of these
hth, ingmar

 
 Ajay--you seem to have gotten your question answered regarding putting your
 dataframe in the correct format, etc.  If you haven't already, you might
 want to check out the MSM package for multi-state Markov and hidden Markov
 models in continuous time.  It's been quite useful for some of my work
 regarding estimating Markov chains/matrices and is actively maintained.
 
 
 Thanks,
 Charles
 
  you wrote 
 
 Folks,
 
 I am holding a dataset where firms are observed for a fixed (and
 small) set of years. The data is in long format - one record for one
 firm for one point in time. A state variable is observed (a factor).
 
 I wish to make a markov transition matrix about the time-series
 evolution of that state variable. The code below does this. But it's
 hardcoded to the specific years that I observe. How might one
 generalise this and make a general function which does this? :-)
 
  -ans.
 
 
 
 set.seed(1001)
 
 # Raw data in long format --
 raw - data.frame(name=c(f1,f1,f1,f1,f2,f2,f2,f2),
 year=c(83,   84,  85,  86,  83,  84,  85,  86),
 state=sample(1:3, 8, replace=TRUE)
 )
 # Shift to wide format --
 fixedup - reshape(raw, timevar=year, idvar=name, v.names=state,
  direction=wide)
 # Now tediously build up records for an intermediate data structure
 try - rbind(
data.frame(prev=fixedup$state.83, new=fixedup$state.84),
data.frame(prev=fixedup$state.84, new=fixedup$state.85),
data.frame(prev=fixedup$state.85, new=fixedup$state.86)
)
 # This is a bad method because it is hardcoded to the specific values
 # of year.
 markov - table(destination$prev.state, destination$new.state)
 
 -- 
 Ajay Shah  http://www.mayin.org/ajayshah
 
 [EMAIL PROTECTED]
 http://ajayshahblog.blogspot.com
 *(:-? - wizard who doesn't know the answer.
 
 
 [[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] chm.help in windows

2006-01-23 Thread Uwe Ligges
Henrik Bengtsson wrote:

 Same in R v2.2.1 patched (2006-01-01 r36947) and Rv2.3.0 (2006-01-01 
 r36947). /Henrik
 
 Thomas Steiner wrote:
 
options(chmhelp=TRUE)
help(package=fCalendar)

does not open teh windows help browser, but

help(CalendarData, package=fCalendar)

does. Why? A bug?

Because help on a *package* (help(package=fCalendar)) shows a text 
representation containing well formatted information from the files 
DESCRIPTION and Index of a package. This is not converted to ANY other 
help format.

Help on a *function* (help(CalendarData, package=fCalendar)) CAN be 
converted to chm, and this happens for CRAN binary packages for Windows.

Uwe Ligges



I use R 2.1.1 under Windows2000
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

__
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] chm.help in windows

2006-01-23 Thread Prof Brian Ripley
Yes, and as documented.  `topic' is not an optional argument to help, so
help(package=) just gives you a hint about what you could have supplied.

On Mon, 23 Jan 2006, Henrik Bengtsson wrote:

 Same in R v2.2.1 patched (2006-01-01 r36947) and Rv2.3.0 (2006-01-01
 r36947). /Henrik

 Thomas Steiner wrote:
 options(chmhelp=TRUE)
 help(package=fCalendar)

 does not open teh windows help browser, but
  ^^^ ?
I have no idea what the `windows help browser' is, and it is not a term
mentioned on the R help page.

 help(CalendarData, package=fCalendar)

 does. Why? A bug?
 I use R 2.1.1 under Windows2000
 Thomas

-- 
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] R-2.2.1 doesn't compile under cygwin/Win2000

2006-01-23 Thread David Vonka
Hello,

I've just downloaded the R-2.2.1 source and I'm trying to
compile it under cygwin (1.5.19-4). The configure script runs
ok, but make generates the following error after a while:


-
al/include -DHAVE_CONFIG_H -D__NO_MATH_INLINES  -g -O2 -c zutil.c -o zutil.o
rm -f libz.a
ar cr libz.a adler32.o compress.o crc32.o deflate.o gzio.o infback.o
inffast.o inflate.o inftrees.o trees.o uncompr.o zutil.o
ranlib libz.a
make[4]: Leaving directory `/home/Vonkad/R-2.2.1/src/extra/zlib'
make[3]: Leaving directory `/home/Vonkad/R-2.2.1/src/extra/zlib'
make[3]: Entering directory `/home/Vonkad/R-2.2.1/src/extra/xdr'
make[4]: Entering directory `/home/Vonkad/R-2.2.1/src/extra/xdr'
making xdr.d from xdr.c
making xdr_float.d from xdr_float.c
making xdr_mem.d from xdr_mem.c
making xdr_stdio.d from xdr_stdio.c
make[4]: Leaving directory `/home/Vonkad/R-2.2.1/src/extra/xdr'
make[4]: Entering directory `/home/Vonkad/R-2.2.1/src/extra/xdr'
gcc -I. -I. -I../../../src/include -I../../../src/include -I/usr/local/inclu
de -DHAVE_CONFIG_H -D__NO_MATH_INLINES  -g -O2 -c xdr.c -o xdr.o
In file included from xdr.c:59:
./rpc/types.h:63: error: conflicting types for 'malloc'
./rpc/types.h:63: error: conflicting types for 'malloc'
make[4]: *** [xdr.o] Error 1
make[4]: Leaving directory `/home/Vonkad/R-2.2.1/src/extra/xdr'
make[3]: *** [R] Error 2
make[3]: Leaving directory `/home/Vonkad/R-2.2.1/src/extra/xdr'
make[2]: *** [R] Error 1
make[2]: Leaving directory `/home/Vonkad/R-2.2.1/src/extra'
make[1]: *** [R] Error 1
make[1]: Leaving directory `/home/Vonkad/R-2.2.1/src'
make: *** [R] Error 1
--

What could be the cause ?

Regards and thanks,
David Vonka

__
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] Trees

2006-01-23 Thread Stephen
Hi.,
 
I would like to conduct a CHAID tree analysis - Chi-square Automatic
Interaction Detector.
 
From what I can make out from MASS, tree, rpart, and a quick search it
isn't available 
as a package. 
 
Is that correct or have I missed it? Has anyone an available
implementation of it?
 
Thanks
 
Stephen

Nana Mail http://mail.nana.co.il - Get Your Free Personal Outlook 2003
Now

[[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] R-2.2.1 doesn't compile under cygwin/Win2000

2006-01-23 Thread Uwe Ligges
David Vonka wrote:

 Hello,
 
 I've just downloaded the R-2.2.1 source and I'm trying to
 compile it under cygwin (1.5.19-4). The configure script runs
 ok, but make generates the following error after a while:
 
 
 -
 al/include -DHAVE_CONFIG_H -D__NO_MATH_INLINES  -g -O2 -c zutil.c -o zutil.o
 rm -f libz.a
 ar cr libz.a adler32.o compress.o crc32.o deflate.o gzio.o infback.o
 inffast.o inflate.o inftrees.o trees.o uncompr.o zutil.o
 ranlib libz.a
 make[4]: Leaving directory `/home/Vonkad/R-2.2.1/src/extra/zlib'
 make[3]: Leaving directory `/home/Vonkad/R-2.2.1/src/extra/zlib'
 make[3]: Entering directory `/home/Vonkad/R-2.2.1/src/extra/xdr'
 make[4]: Entering directory `/home/Vonkad/R-2.2.1/src/extra/xdr'
 making xdr.d from xdr.c
 making xdr_float.d from xdr_float.c
 making xdr_mem.d from xdr_mem.c
 making xdr_stdio.d from xdr_stdio.c
 make[4]: Leaving directory `/home/Vonkad/R-2.2.1/src/extra/xdr'
 make[4]: Entering directory `/home/Vonkad/R-2.2.1/src/extra/xdr'
 gcc -I. -I. -I../../../src/include -I../../../src/include -I/usr/local/inclu
 de -DHAVE_CONFIG_H -D__NO_MATH_INLINES  -g -O2 -c xdr.c -o xdr.o
 In file included from xdr.c:59:
 ./rpc/types.h:63: error: conflicting types for 'malloc'
 ./rpc/types.h:63: error: conflicting types for 'malloc'
 make[4]: *** [xdr.o] Error 1
 make[4]: Leaving directory `/home/Vonkad/R-2.2.1/src/extra/xdr'
 make[3]: *** [R] Error 2
 make[3]: Leaving directory `/home/Vonkad/R-2.2.1/src/extra/xdr'
 make[2]: *** [R] Error 1
 make[2]: Leaving directory `/home/Vonkad/R-2.2.1/src/extra'
 make[1]: *** [R] Error 1
 make[1]: Leaving directory `/home/Vonkad/R-2.2.1/src'
 make: *** [R] Error 1
 --
 
 What could be the cause ?

The cause is that you have not read the R Installation and 
Administration manual. It tells you which tools are required to build R 
under Windows. In particular, cygwin is unsupported.
For the user's convenience, a Windows binary version is also provided on 
CRAN mirrors.

Uwe Ligges



 Regards and thanks,
 David Vonka
 
 __
 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] Making a markov transition matrix - more progress

2006-01-23 Thread Ajay Narottam Shah
I solved the problem in one more (and more elegant) way. So here's the
program again.

Where does R stand on the Anderson-Goodman test of 1957? I hunted
around and nobody seems to be doing this in R. Is it that there has
been much progress after 1957 and nobody uses it anymore?

# Problem statement:
#
# You are holding a dataset where firms are observed for a fixed
# (and small) set of years. The data is in long format - one
# record for one firm for one point in time. A state variable is
# observed (a factor).
# You wish to make a markov transition matrix about the time-series
# evolution of that state variable.

set.seed(1001)

# Raw data in long format --
raw - data.frame(name=c(f1,f1,f1,f1,f2,f2,f2,f2),
  year=c(83,   84,  85,  86,  83,  84,  85,  86),
  state=sample(1:3, 8, replace=TRUE)
  )
# Shift to wide format --
fixedup - reshape(raw, timevar=year, idvar=name, v.names=state,
   direction=wide)
# Now tediously build up records for an intermediate data structure
tmp - rbind(
 data.frame(prev=fixedup$state.83, new=fixedup$state.84),
 data.frame(prev=fixedup$state.84, new=fixedup$state.85),
 data.frame(prev=fixedup$state.85, new=fixedup$state.86)
 )
# This is a bad method because it is hardcoded to the specific values
# of year.
markov - table(tmp$prev, tmp$new)
markov

# Gabor's method --
transition.probabilities - function(D, timevar=year,
 idvar=name, statevar=state) {
  stage1 - merge(D, cbind(nextt=D[,timevar] + 1, D),
  by.x=timevar, by.y=nextt)
  v1 - paste(idvar,.x,sep=)
  v2 - paste(idvar,.y,sep=)
  stage2 - subset(stage1, stage1[,v1]==stage1[,v2])
  v1 - paste(statevar,.x,sep=)
  v2 - paste(statevar,.y,sep=)
  t(table(stage2[,v1], stage2[,v2]))
}

transition.probabilities(raw, timevar=year, idvar=name, statevar=state)

# The new and improved way --
library(msm)
statetable.msm(state, name, data=raw)

-- 
Ajay Shah  http://www.mayin.org/ajayshah  
[EMAIL PROTECTED] http://ajayshahblog.blogspot.com
*(:-? - wizard who doesn't know the answer.

__
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] linear contrasts with anova

2006-01-23 Thread Christoph Buser
Dear Marco

If you are interested in a comparison of a reference level
against each other level (in your case level 1 against level 2
and level 1 against level 3), you can use the summary.lm(),
since this is the default contrast (see ?contr.treatment)

ar - data.frame(GROUP = factor(rep(1:3, each = 8)),
 DIP = c(3.0, 3.0, 4.0, 5.0, 6.0, 7.0, 3.0, 2.0, 1.0, 6.0, 5.0,
   7.0, 2.0, 3.0, 1.5, 1.7, 17.0, 12.0, 15.0, 16.0, 12.0, 23.0,
   19.0, 21.0))


r.aov10 - aov(DIP ~  GROUP, data = ar)
anova(r.aov10)
summary.lm(r.aov10)

As result you will get the comparison GROUP 2 against GROUP 1,
denoted by GROUP2 and the comparison GROUP 3 against GROUP 1,
denoted by GROUP3.

Be careful. In your example you include both GROUP and C1 or C2,
respectively in your model. This results in a over parameterized
model and you get a warning that not all coefficients have been
estimated, due to singularities.

It is possible to use other contrasts than contr.treatment,
contr.sum, contr.helmert, contr.poly, but then you have to
specify the correctly in the model.

Regards,

Christoph Buser

--
Christoph Buser [EMAIL PROTECTED]
Seminar fuer Statistik, LEO C13
ETH (Federal Inst. Technology)  8092 Zurich  SWITZERLAND
phone: x-41-44-632-4673 fax: 632-1228
http://stat.ethz.ch/~buser/
--

Posta Univ. Cagliari writes:
  I have some doubts about the validity of my procedure to estimeate linear 
  contrasts ina a factorial design.
  For sake of semplicity, let's imagine a one way ANOVA with three levels. I 
  am interested to test the significance of the difference between the first 
  and third level (called here contrast C1) and between the first and the 
  seconda level (called here contrast C2). I used the following procedure:
  
  
  --- reading data from a text file ---
  
   ar -read.table(C:/Programmi/R/myworks/contrasti/cont1.txt,header=TRUE)
  
   ar
  
   CC GROUP
  
  1   3.0 0
  
  2   3.0 0
  
  3   4.0 0
  
  4   5.0 0
  
  5   6.0 0
  
  6   7.0 0
  
  7   3.0 0
  
  8   2.0 0
  
  9   1.0 1
  
  10  6.0 1
  
  11  5.0 1
  
  12  7.0 1
  
  13  2.0 1
  
  14  3.0 1
  
  15  1.5 1
  
  16  1.7 1
  
  17 17.0 2
  
  18 12.0 2
  
  19 15.0 2
  
  20 16.0 2
  
  21 12.0 2
  
  22 23.0 2
  
  23 19.0 2
  
  24 21.0 2
  
   
  
  --- creating a new array of data---
  
   ar-data.frame(GROUP=factor(ar$GROUP),DIP=ar$CC)
  
   ar
  
 GROUP  DIP
  
  1  0  3.0
  
  2  0  3.0
  
  3  0  4.0
  
  4  0  5.0
  
  5  0  6.0
  
  6  0  7.0
  
  7  0  3.0
  
  8  0  2.0
  
  9  1  1.0
  
  10 1  6.0
  
  11 1  5.0
  
  12 1  7.0
  
  13 1  2.0
  
  14 1  3.0
  
  15 1  1.5
  
  16 1  1.7
  
  17 2 17.0
  
  18 2 12.0
  
  19 2 15.0
  
  20 2 16.0
  
  21 2 12.0
  
  22 2 23.0
  
  23 2 19.0
  
  24 2 21.0
  
   
  
  --- creating two dummy variables (C1 and C2) for linear 
  contrasts---
  
   ar-data.frame(GROUP=factor(ar$GROUP),C1=factor(ar$GROUP),C2=factor(ar$GROUP),DIP=ar$DIP)
  
   ar
  
 GROUP C1 C2  DIP
  
  1  0  0  0  3.0
  
  2  0  0  0  3.0
  
  3  0  0  0  4.0
  
  4  0  0  0  5.0
  
  5  0  0  0  6.0
  
  6  0  0  0  7.0
  
  7  0  0  0  3.0
  
  8  0  0  0  2.0
  
  9  1  1  1  1.0
  
  10 1  1  1  6.0
  
  11 1  1  1  5.0
  
  12 1  1  1  7.0
  
  13 1  1  1  2.0
  
  14 1  1  1  3.0
  
  15 1  1  1  1.5
  
  16 1  1  1  1.7
  
  17 2  2  2 17.0
  
  18 2  2  2 12.0
  
  19 2  2  2 15.0
  
  20 2  2  2 16.0
  
  21 2  2  2 12.0
  
  22 2  2  2 23.0
  
  23 2  2  2 19.0
  
  24 2  2  2 21.0
  
   
  
  --- selecting the contrast levels---
  
   ar$C1 - C(ar$C1, c(1,0,-1), how.many = 1)
  
   ar$C2 - C(ar$C2, c(1,-1,0), how.many = 1)
  
   
  
   
  
  --- contrast analysis of C2 ---
  
   r.aov8 -aov(DIP ~  C2 + GROUP , data = ar)
  
   anova(r.aov8)
  
  Analysis of Variance Table
  
   
  
  Response: DIP
  
Df Sum Sq Mean Sq  F valuePr(F)
  
  C2 1   2.102.10   0.2622 0.614
  
  GROUP  1 917.00  917.00 114.3460 5.915e-10 ***
  
  Residuals 21 168.418.02   
  
  ---
  
  Signif. codes:  0 `***' 0.001 `**' 0.01 `*' 0.05 `.' 0.1 ` ' 1
  
   
  
  --- contrast analysis of C1 ---
  
   r.aov9 -aov(DIP ~  C1 + GROUP , data = ar)
  
   anova(r.aov9)
  
  Analysis of Variance Table
  
   
  
  Response: DIP
  
Df Sum Sq Mean Sq F valuePr(F)
  
  C1 1 

[R] Image Processing packages

2006-01-23 Thread Thomas Kaliwe
Hi,
 
I've been looking for Image Processing packages. Thresholding, Edge
Filters, Dct, Segmentation, Restoration. I'm aware, that Octave, Matlab
etc. would be a good address but then I'm missing the statistical
power  of R. Does anybody know of packages, projects etc. Comments on
wether the use of R for such matters is useful are welcome.
 
Greetings
 
Thomas Kaliwe

[[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] Image Processing packages

2006-01-23 Thread Thomas Kaliwe
 
 
-Ursprüngliche Nachricht-
Von: Thomas Kaliwe [mailto:[EMAIL PROTECTED] 
Gesendet: Montag, 23. Januar 2006 13:25
An: 'r-help@stat.math.ethz.ch'
Betreff: Image Processing packages
 
Hi,
 
I’ve been looking for Image Processing packages. Thresholding, Edge
Filters, Dct, Segmentation, Restoration. I’m aware, that Octave, Matlab
etc. would be a good address but then I’m missing the “statistical
power”  of R. Does anybody know of packages, projects etc. Comments on
wether the use of R for such matters is useful are welcome.
 
Greetings
 
Thomas Kaliwe

[[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] Image Processing packages

2006-01-23 Thread Philippe Grosjean
Hello,

There are a couple of things for image processing in R (look at pixmap 
and Rimage, for instance). However, R is *not* a good software for 
processing images (nor is Matlab, Octave, IDL: they use to have specific 
packages for image processing and analysis, but resulting applications 
are way to slow in comparison to dedicated software).

A good approach is to mix ImageJ and R, if you are looking for an Open 
Source solution. You could look at ZooImage for an example application 
using these two software (analysis of digital zooplankton images, see: 
http://www.sciviews.org/zooimage).

Best,

Philippe Grosjean


Thomas Kaliwe wrote:
 Hi,
  
 I've been looking for Image Processing packages. Thresholding, Edge
 Filters, Dct, Segmentation, Restoration. I'm aware, that Octave, Matlab
 etc. would be a good address but then I'm missing the statistical
 power  of R. Does anybody know of packages, projects etc. Comments on
 wether the use of R for such matters is useful are welcome.
  
 Greetings
  
 Thomas Kaliwe
 
   [[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] design matrix and coefficients

2006-01-23 Thread Assa Yeroslaviz
Hey,

As a beginner to the limma package I tried to understand how to define a
design  matrix. I did both experiment examples in the Limma user's Guide
manual. Afterwards I wanted to do it with my own data. Here I encounter a
few problems.

As an example I used four Control samples and 4 treated samples.
1. This is how my target files looks like:
filenametreated time.h  conc.
ctrl_1.cel no240
ctrl_2.cel no240
ctrl_3.cel no240
ctrl_4.cel no240
treat_100_1.cel yes24100
treat_100_2.cel yes24100
treat_1000_3.celyes241000
treat_1000_4.celyes241000

2. I would like to create a design matrix to compare all 4 wt files with all
4 ctrl files. But I also want to see the differences between the two
concentrations (100, 1000). I have a problem creating the different
coefficients.
How do I choose which coefficient to build?

I would be happy for any help. I didn't find much information about the
limma package and the affymetrix (single-channel) chips. If you can help me
looking for general information I'll be also grateful.


THX,

Assa


--
Assa Yeroslaviz
Loetzener Str. 15
51373 Leverkusen

[[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] Image Processing packages

2006-01-23 Thread Kare Edvardsen
Hi,

Have a look at PerlDL. http://pdl.perl.org/index_en.html

It's fast and It's free. Also there's a mailing-list. Far from the 
activity here, but usually you get your answer.

Kare

Thomas Kaliwe wrote:
  
  
 -Ursprüngliche Nachricht-
 Von: Thomas Kaliwe [mailto:[EMAIL PROTECTED] 
 Gesendet: Montag, 23. Januar 2006 13:25
 An: 'r-help@stat.math.ethz.ch'
 Betreff: Image Processing packages
  
 Hi,
  
 I’ve been looking for Image Processing packages. Thresholding, Edge
 Filters, Dct, Segmentation, Restoration. I’m aware, that Octave, Matlab
 etc. would be a good address but then I’m missing the “statistical
 power”  of R. Does anybody know of packages, projects etc. Comments on
 wether the use of R for such matters is useful are welcome.
  
 Greetings
  
 Thomas Kaliwe
 
   [[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

-- 
###
Kare Edvardsen [EMAIL PROTECTED]
Norwegian Institute for Air Research (NILU)
Polarmiljosenteret
NO-9296 Tromso   http://www.nilu.no
Swb. +47 77 75 03 75 Dir. +47 77 75 03 90
Fax. +47 77 75 03 76 Mob. +47 90 74 60 69
###

__
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] Latest revision of lme4 requires 'Matrix' = 0.995.2 but that version is not available on CRAN

2006-01-23 Thread Douglas Bates
On 1/22/06, John Logsdon [EMAIL PROTECTED] wrote:
 I've just hit this problem as well and as I am slumming it on XP at the
 moment, I don't have the compilation tools to use the .tar.gz version.

 I also notice that the numbering format has changed.  Is this intentional?

Which numbering format?  If you mean the use of 0.995 rather than 0.99
it is because I keep finding changes that need to be made in the
underlying format for mixed-effects representations (i.e. mer objects)
before a 1.0 release.  The current sequence of numbers is 0.99 (99%),
0.995 (99 1/2%), 0.9975 (99 3/4%), 0.99875 (99 7/8%), ...

It is a pattern like, but not as inventive as, Donald Knuth's
numbering sequence for TeX releases.  It has the desirable property of
allowing for an infinite number of releases before you need to declare
the package to be at release 1.0

There will be at least a 0.9975 series of minor releases (I need to
add another two slots to the mer object).

__
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] fractional factorial design in R

2006-01-23 Thread Ulrike Grömping
Roberto Furlan wrote:

Hi, 
i need to create a fractional factorial design sufficient to estimate the 
main effects. 
The factors may have any number of levels, let's say any number from 2 to 6. 
I've tried to use the library conf.design , but i cannot figure out how to 
write the code. 
For example, what is the code for a design with 5 factors (2x3x3x5x2) and 
only main effects not confounded?

thanks in advance! 
Roberto Furlan 
University of Turin, Italy

Hi Roberto,

unfortunately, fractional factorial designs typically require all factors to 
have the same number of levels. Hence, your 2x3x3x5x2 example is not a simple 
special case of a fractional factorial design. 

There are some special plans for mixed level designs, but the conf.design 
function requires all factors to have the same number of levels, as you can 
also find in its help:
    p: The common number of levels for each factor.  Must be a prime 
  number.

ffDesMatrix from package BHH2 is even worse, since it requires all factors to 
have 2 levels:
k: numeric. The number of 2-levels design factors in the
  designs. 

(Note that designs with two level-factors only can accommodate a few four-
level factors, by combining two main effects plus their interaction for the 
three degrees of freedom of the 4-level factor. For doing this, I would 
recommend to have someone plan the design who really knows what he/she is 
doing.)

Regards, Ulrike

__
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] [Rd] Display an Image on a Plane

2006-01-23 Thread Labbe, Vincent (AEREX)
Thanks to all for the answers.

I needed something quickly for a report so I used Gimp (as proposed by
François Pinard) but I will look at the links given by Barry Rowlingson if I
want something more fancy. Thanks also to Ben Bolker.

Vincent


-Original Message-
From: François Pinard [mailto:[EMAIL PROTECTED] 
Sent: Friday, January 20, 2006 6:31 PM
To: Barry Rowlingson
Cc: Ben Bolker; R-help; Labbe, Vincent (AEREX)
Subject: Re: [R] [Rd] Display an Image on a Plane

[Barry Rowlingson]
[Ben Bolker]
 [Labbe, Vincent]

I am new to R and I would like to display an image on a plane in a
3D plot, i.e. I would like to be able to specify a theta and a phi
parameters like in the function persp to display a 2D image on an
inclined plane.

 what do you mean by image exactly?

I think once you get into doing fancy visualisations like this then you
may find a solution outside of R. [good referrences deleted]

Bonjour, Vincent.

I'm not fully sure I understand your request, what I get is that you 
want to transform an image on a plane as if one was looking at it in 
space, from an angle.   If I had this problem, I would probably produce 
the image using regular R machinery for this like png() or postscript(), 
then interactively process the result within Gimp, using trapezoidal 
deformations (I think they call it Perspective transformation).  For 
example, I used this simple trick in the following picture:

   http://pinard.progiciels-bpi.ca/plaisirs/dessins/cd-back.jpg

for the KWIC listing being part of the composition.  However, if 
I needed a precise phi and theta for transformations beyond what 
trans3d() can offer, I would likely use Python or R for computing the 
projection of the rectangle enclosing the image, than PIL (Python 
Imaging Library) for producing that precise trapezoidal deformation.  
Just sharing ideas, of course.  Much likely that if I knew R better, 
I would use it more fully -- but that's a tautology! :-)

-- 
François Pinard   http://pinard.progiciels-bpi.ca

__
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] Sweave: skip if figure exists

2006-01-23 Thread Dieter Menne
Dear RWeavers,

to speed up report generation with Sweave, I am looking for an option
skipifexists for figures. A named figure chunk should not be executed if
the file to be produced already exists.

I know that this could be done with hooks, but I want to avoid to re-invent
this wheel.

Dieter

__
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] Sweave: skip if figure exists

2006-01-23 Thread Friedrich . Leisch
 On Mon, 23 Jan 2006 16:41:09 +0100,
 Dieter Menne (DM) wrote:

   Dear RWeavers,
   to speed up report generation with Sweave, I am looking for an option
   skipifexists for figures. A named figure chunk should not be executed if
   the file to be produced already exists.

   I know that this could be done with hooks, but I want to avoid to re-invent
   this wheel.

I have plans to implement something like this for a very long time
now, but no code yet. Contributions are of course more than welcome.

Best,

-- 
---
Friedrich Leisch 
Institut für Statistik Tel: (+43 1) 58801 10715
Technische Universität WienFax: (+43 1) 58801 10798
Wiedner Hauptstraße 8-10/1071
A-1040 Wien, Austria http://www.ci.tuwien.ac.at/~leisch

__
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] ordering a data frame to same order as a chr vector

2006-01-23 Thread Ken Termiso
Hi all,

I've got a data frame that has an identical column to a chr vector. I would 
like to use the chr vector to order the rows of the data frame to be 
identical to the order in the chr vector (the contents of the chr vector are 
completely identical to one col of the data frame), but this is proving 
trickier than it sounds..

Any help would be much obliged,
-Ken

__
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] Trees

2006-01-23 Thread Torsten Hothorn

On Mon, 23 Jan 2006, Stephen wrote:

 Hi.,

 I would like to conduct a CHAID tree analysis - Chi-square Automatic
 Interaction Detector.

 From what I can make out from MASS, tree, rpart, and a quick search it
 isn't available
 as a package.

 Is that correct or have I missed it?

correct, it is not available out-of-the-box.

 Has anyone an available implementation of it?

if you aim at unbiased variable selection you might want to checkout the
`party' package, especially the `ctree' function.

Best,

Torsten


 Thanks

 Stephen

 Nana Mail http://mail.nana.co.il - Get Your Free Personal Outlook 2003
 Now

   [[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] ordering a data frame to same order as a chr vector

2006-01-23 Thread Ken Termiso
Let me clarify the problem a bit further:

tv - 1:11108

tdf - data.frame(cbind(11108:1, 22216:11109))


In this example, what I would like to do is re-order the entire tdf data 
frame based on its first column (since the contents of tdf[,1] are identical 
to tv, just not necessarily in the same order in my problem, but here 
obviously the tdf data frame is already ordered the same as tv).

I would like to use the vector tv to give tdf the same exact order as tv, 
based on that first column of tdf which is identical to tv.

Thanks,
ken

__
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] Creating an R package file

2006-01-23 Thread Posta Univ. Cagliari
Dear R community,

I would like to create my own R package files, but I find some problemm for R 
versions 1.9.

When in previous versions of R I could write a simple text file, to have a 
functioning file package, now I found that is neccessary to implement also 
binary copies of the file. I cannot understand, reading from R manuals, how it 
is the correct procedure to create these binary files.

Is there anybody that can help me on this issue?

Many thanks,

Marco Tommasi
[[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] ordering a data frame to same order as a chr vector

2006-01-23 Thread Liaw, Andy
This is an FAQ that's not in the official FAQ (I believe).  Do
RSiteSearch(sort.data.frame) in R and you'll see.

Andy

From: Ken Termiso
 
 Hi all,
 
 I've got a data frame that has an identical column to a chr 
 vector. I would 
 like to use the chr vector to order the rows of the data frame to be 
 identical to the order in the chr vector (the contents of the 
 chr vector are 
 completely identical to one col of the data frame), but this 
 is proving 
 trickier than it sounds..
 
 Any help would be much obliged,
 -Ken
 
 __
 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] ordering a data frame to same order as a chr vector

2006-01-23 Thread Dimitris Rizopoulos
probably you are looking for something like the following:

dat - data.frame(chr = letters[1:20], x = rnorm(20), y = rnorm(20))
chr.vec - sample(letters[1:20])
3
dat[match(chr.vec, dat$chr), ]


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: Ken Termiso [EMAIL PROTECTED]
To: r-help@stat.math.ethz.ch
Sent: Monday, January 23, 2006 4:55 PM
Subject: [R] ordering a data frame to same order as a chr vector


 Hi all,

 I've got a data frame that has an identical column to a chr vector. 
 I would
 like to use the chr vector to order the rows of the data frame to be
 identical to the order in the chr vector (the contents of the chr 
 vector are
 completely identical to one col of the data frame), but this is 
 proving
 trickier than it sounds..

 Any help would be much obliged,
 -Ken

 __
 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


Re: [R] ordering a data frame to same order as a chr vector

2006-01-23 Thread Stefano Calza
Hi,

if I got it right I'd suggest to use match (which would allow you to use 
also character vectors)

So

tdf[match(tv,tdf[,1]),]

will give you tdf in the same order as tv


HIH
Ste

On Mon, Jan 23, 2006 at 04:09:58PM +, Ken Termiso wrote:
KenLet me clarify the problem a bit further:
Ken
Kentv - 1:11108
Ken
Kentdf - data.frame(cbind(11108:1, 22216:11109))
Ken
Ken
KenIn this example, what I would like to do is re-order the entire tdf data 
Kenframe based on its first column (since the contents of tdf[,1] are 
identical 
Kento tv, just not necessarily in the same order in my problem, but here 
Kenobviously the tdf data frame is already ordered the same as tv).
Ken
KenI would like to use the vector tv to give tdf the same exact order as tv, 
Kenbased on that first column of tdf which is identical to tv.
Ken
KenThanks,
Kenken
Ken
Ken__
KenR-help@stat.math.ethz.ch mailing list
Kenhttps://stat.ethz.ch/mailman/listinfo/r-help
KenPLEASE 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] White Noise

2006-01-23 Thread William Revelle
At 1:38 PM + 1/22/06, Laura Quinn wrote:
I'm wanting to create a series of near-identical matrices via the addition
of white noise to my starting matrix. Is there a function within R which
will allow me to do this?

Thank you

If the starting matrix is symmetric, see mvrnorm in the MASS package.



-- 
William Revelle http://pmc.psych.northwestern.edu/revelle.html   
Professor   http://personality-project.org/personality.html
Department of Psychology   http://www.wcas.northwestern.edu/psych/
Northwestern University http://www.northwestern.edu/

__
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] Creating an R package file

2006-01-23 Thread Liaw, Andy
Well, you simply type

R CMD INSTALL --build mypackage

or

R CMD build --binary mypackage

in the parent directory of the source package.  If you're on Windows, you
need to have some tools installed to be able to do that (but you haven't
said what OS you're using).

Andy

From: Posta Univ. Cagliari
 
 Dear R community,
 
 I would like to create my own R package files, but I find 
 some problemm for R versions 1.9.
 
 When in previous versions of R I could write a simple text 
 file, to have a functioning file package, now I found that is 
 neccessary to implement also binary copies of the file. I 
 cannot understand, reading from R manuals, how it is the 
 correct procedure to create these binary files.
 
 Is there anybody that can help me on this issue?
 
 Many thanks,
 
 Marco Tommasi
   [[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] Creating an R package file

2006-01-23 Thread Posta Univ. Cagliari
If you're on Windows, you
need to have some tools installed to be able to do that (but you haven't
said what OS you're using).

Yes, I forgo tto say that my OS is Windows.

Regards,

Marco Tommasi

__
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] R-help Digest, Vol 35, Issue 23

2006-01-23 Thread Dr. Herwig Meschke
 summary.aov(aovRes, split=list(interval = list(i1 vs i2 = 1, i2 vs
 i3 = 2, i3 vs i4 = 3, i4 vs i5 = 4, i5 vs i6 = 5)))
 
try
class(aovRes) #- aovlist !
summary.aovlist(aovRes, spit=...)
or simply
summary(aovRes, spit=...)

Hoping this helps,
Herwig

-- 
Dr. Herwig Meschke
Wissenschaftliche Beratung
Hagsbucher Weg 27
D-89150 Laichingen

phone +49 7333 210 417 / fax +49 7333 210 418
email [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] Creating an R package file

2006-01-23 Thread Uwe Ligges
Posta Univ. Cagliari wrote:

 Dear R community,
 
 I would like to create my own R package files, but I find some
 problemm for R versions 1.9.
 
 When in previous versions of R I could write a simple text file, to
 have a functioning file package, now I found that is neccessary to
 implement also binary copies of the file. I cannot understand,
 reading from R manuals, how it is the correct procedure to create
 these binary files.
 
 Is there anybody that can help me on this issue?


The manual Writing R Extensions explains how to write a source package.
The manual R Installation and Administration explains how to collect
the required tools (your mail header tells us you are on Windows) to perform
   R CMD INSTALL, R CMD check and R CMD build

Uwe Ligges



 Many thanks,
 
 Marco Tommasi [[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] lines() in heatmap()

2006-01-23 Thread kaoskrew.de
Hello!

I looked for help through google and the help-files and spend several 
hours with trial and
error, but didn't find a correct way.

It's all about lines in a heatmap to separate different data block from 
each other to underline
the significance of the found clusters!

The heatmap is build like that:

heatmap(X, Rowv=NA, Colv=NA, symm=TRUE, cexRow=0.3, cexCol=0.3)

I switched the dendrograms off, because I don't want the values sorted 
but in the way, I
extracted them from the data.

I tried to enter the lines that way:

lines(c(14,14),c(0,187), col=green)

That should appear as a line parallel to the x-axis, but there was no 
line at all.
I also tried several other ways, which didn't work at all. (The Matrix 
contains
187 values and is symmetric)

Also the line should start and end at the borders of the heatmap, so if 
there is
a parameter to enter that, I would be glad, if you add it.

Another short question:
Does anybody have an idea, how I could switch the names of my data from 
the heatmaps
right side to it's left side?


Thanks for help already,
Tobias Zimmer

__
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] fractional factorial design in R

2006-01-23 Thread Martin Maechler
 MM == Martin Maechler [EMAIL PROTECTED]
 on Sat, 21 Jan 2006 09:33:20 +0100 writes:

 BertG == Berton Gunter [EMAIL PROTECTED]
 on Fri, 20 Jan 2006 14:15:49 -0800 writes:

BertG I'm not sure what you mean by a fractional
BertG factorial design here. 
 
and Bert was right on target.
Please apologize for the following, which I'm now sure Bert
knows probably much better than me.

MM it's a pretty well known term, in (at least some schools of)
MM classical analysis of variance, e.g. 
MM in the famous Box, Hunter^2 (1987) book which had a 2nd
MM edition last year (Wiley), see also Doug Bates's nice account on
MM a talk about it,
MM http://finzi.psych.upenn.edu/R/Rhelp02a/archive/29768.html
MM and the R package  BHH2  which is devoted to the book (2nd Ed).

MM BHH2 has a function  ffDesMatrix()  for fractional factorial
MM designs, *and* in it's see also section a link to the
MM conf.design() function in the package of the same name which
MM allows to construct ff designs (via different specifications).
MM see e.g, 
http://finzi.psych.upenn.edu/R/library/BHH2/html/ffDesMatrix.html

BertG In general, when dealing with complex designs of the sort you appear 
to be thinking
BertG about, small orthogonal designs don't exist. You
BertG might wish to look at the AlgDesign package to
BertG generate an efficient design to estimate only main
BertG effects.

BertG -- Bert Gunter Genentech Non-Clinical Statistics
BertG South San Francisco, CA
 
BertG The business of the statistician is to catalyze the
BertG scientific learning process.  - George E. P. Box
 
MM now, since you have this nice signature, maybe you should
MM get the above book? ;-) :-)
 
which was supposed to be something like a joke;  
given my misreading of Bert's comment, I'm sorry about it.

I have no good excuse for my blunder:
  It was Saturday morning, 
  I had slept well, 
  had had a shower, coffee and breakfast, ...  

Martin Maechler, ETH Zurich

 -Original Message- From:
 [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED] On Behalf Of
 Roberto Furlan Sent: Friday, January 20, 2006 12:37 PM
 To: r-help@stat.math.ethz.ch Subject: [R] fractional
 factorial design in R
 
 Hi, i need to create a fractional factorial design
 sufficient to estimate the main effects.  The factors may
 have any number of levels, let's say any number from 2 to
 6.  I've tried to use the library conf.design , but i
 cannot figure out how to write the code.  For example,
 what is the code for a design with 5 factors (2x3x3x5x2)
 and only main effects not confounded?
 
 thanks in advance!  Roberto Furlan University of Turin,
 Italy

__
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 in R v.2.2.1 and S-Plus v. 7.0

2006-01-23 Thread Paolo Ghisletta
Dear R-Users,

I am comparing the nlme package in S-Plus (v. 7.0) and R (v. 2.2.1, nlme 
package version 3.1-68.1; the lattice, Matrix, and lme4 have also just 
been updated today, Jan. 23, 2006) on a PC (2.40 GHz Pentium 4 processor 
and 1 GHz RAM) operating on Windows XP. I am using a real data set with 
1,191 units with at most 4 repeated measures per unit (data are 
incomplete, unbalanced). I use the same code with the same starting 
values for both programs and obtain slightly different results. I am 
aware that at this stage my model is far from being well specified for 
the given data. Nevertheless, I wonder whether one program is more 
suited than the other to pursue my modeling.

Below I included the input + output code, first for S-Plus, than for R.

Many thanks and best regards,
Paolo Ghisletta


#S-Plus
#min=4, max=41
  logistic4.a - nlme(jugs ~ 4 + 41 / (1 + xmid*exp( -scal*I(occ-1) + 
u)), fixed=scal+xmid~1, random= u~1 |id, start=c(scal=.2, xmid=155), 
data=jug, na.action=na.exclude, method=ML)
  summary(logistic4.a)
Nonlinear mixed-effects model fit by maximum likelihood
  Model: jugs ~ 4 + 41/(1 + xmid * exp( - scal * I(occ - 1) + u))
 Data: jug
   AIC BIClogLik
  29595.62 29621.3 -14793.81

Random effects:
 Formula: u ~ 1 | id
   u Residual
StdDev: 5.162391 3.718887

Fixed effects: scal + xmid ~ 1
Value Std.Error   DF  t-value p-value
scal   4.96970.0823 3339 60.39508  .0001
xmid 683.5634  125.8509 3339  5.43153  .0001

Standardized Within-Group Residuals:
   Min Q1  MedQ3  Max
 -10.66576 -0.5039498 0.0002772166 0.1226745 5.453209

Number of Observations: 4531
Number of Groups: 1191


# R
  #min=4, max=41
  logistic4.a - nlme(jugs ~ 4 + 41 / (1 + xmid*exp( -scal*I(occ-1)+ 
u)), data=jug, fixed=scal+xmid~1, random= u~1 |id, start=c(scal=.2, 
xmid=155), method=ML, na.action=na.exclude)
  summary(logistic4.a)
Nonlinear mixed-effects model fit by maximum likelihood
  Model: jugs ~ 4 + 41/(1 + xmid * exp(-scal * I(occ - 1) + u))
 Data: jug
   AIC  BIClogLik
  29678.11 29703.78 -14835.05

Random effects:
 Formula: u ~ 1 | id
   u Residual
StdDev: 5.116542 3.767097

Fixed effects: scal + xmid ~ 1
Value Std.Error   DF  t-value p-value
scal   4.9244   0.08121 3339 60.63763   0
xmid 633.6956 115.37512 3339  5.49248   0
Erreur dans dim(x) : aucun slot de nom Dim pour cet objet de la classe 
correlation



[[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] mutlivariate normal and t distributions

2006-01-23 Thread Adelchi Azzalini

Dear R-help list members,

I have created a package 'mnormt' with facilities for the multivariate
normal and t distributions. The core part is simply an interface to
Fortran routines by Alan Genz for computing the integral of two
densities over rectangular regions, using an adaptive integration
method. Other R functions compute densities and generate random
numbers.

The starting motivation to write it was the  need to have functions
which compute the distribution functions in a non-Monte Carlo form,
sinse this caused me problems when these probabilities are involved in
a minimization problem. For this reason, I could not make use of the
CRAN package 'mvtnorm'.  Exactly to avoid superposition with the CRAN
package, 'mnormt' is made available somehere else, in case other
people want to use it.  The package 'mnormt' is at 
   http://azzalini.stat.unipd.it/SN/Pkg-mnormt

As explained, this is not uploaded to CRAN just to avoid clash with
the existing package. However, if it is felt appropriate, I have no
objection to upload it to CRAN.

Best wishes,

Adelchi Azzalini
-- 
Adelchi Azzalini  [EMAIL PROTECTED]
Dipart.Scienze Statistiche, Università di Padova, Italia
tel. +39 049 8274147,  http://azzalini.stat.unipd.it/

__
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] Selecting data frame components by name - do you know ashorter way?

2006-01-23 Thread Michael Reinecke
 
Thank you all very much! The subset function is great! I knew there must
be such a very convenient feature in R. I also learned a lot by studying
the other ways of selecting data frame components.

Greetings

Michael

__
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] command in survival package

2006-01-23 Thread Linda Lei
Thank you guys. 
But I tried the commands and I still get:

 aml1-aml[aml$group==1,]
 aml1
[1] time   status x 
0 rows (or 0-length row.names)
 esf.fit - survfit(Surv(aml1$weeks,status) ~ 1)
Error in Surv(aml1$weeks, status) : Time variable is not numeric
In addition: Warning message:
is.na() applied to non-(list or vector) in: is.na(time)

which still looks confusing. Or are they should be applied in s-plus
instead of R?

Thanks a lot!
Linda


-Original Message-
From: Marc Schwartz [mailto:[EMAIL PROTECTED] 
Sent: Friday, January 20, 2006 4:49 PM
To: Thomas Lumley
Cc: Linda Lei; R-help@stat.math.ethz.ch
Subject: Re: [R] command in survival package

On Fri, 2006-01-20 at 15:27 -0800, Thomas Lumley wrote:
 On Fri, 20 Jan 2006, Linda Lei wrote:
 
  Hi there,
 
 
 
  I have a question about one command sentence when I follow the
example
  in the book of Survival analysis in S:
 
   aml1-aml[aml$group==1]
 
 If this is really what the book says you should probably complain to
the 
 author.  However, if it says
aml1-aml[aml$group==1,]
 then you show type that instead.
 
 It is hard to be sure, because you don't say where the `aml' data set 
 comes from.  It can't be the one in the survival package as this
doesn't 
 have a variable called group
 
 
  Thus, I couldn't keep going on the next command:
 
  esf.fit-survfit(Surv(aml1,status)~1).
 
 
 This looks implausible as well. I would have expected something like
esf.fit-survfit(Surv(time,status)~1, data=aml1)


Correct on both accounts Thomas. The text in the book on page 26 appears
as Linda posted.

However, there is an errata document here:

http://www.crcpress.com/e_products/downloads/download.asp?cat_no=C4088

which shows the corrected text as:

aml1 - aml[aml$group==1,] # Maintained group only

esf.fit - survfit(Surv(aml1$weeks,status) ~ 1)


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] (no subject)

2006-01-23 Thread Linda Lei
Hi there,

 

May I have your help with the following question?

 

I have one output which is like follows:

 

 ValidCum 

Value Frequency Percent Percent percent 

 

15 1  1.01.01.0

17 1  1.01.02.0

 

Total 100   100   100

 

Median  42.000  Minimum   15.000  Maximum  55.000

Valid cases 100 Missing cases   0

 

According to the output, could you help me with what command (in which
package) it is used to get the above output?

 

Thank you very much!

Linda


[[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] Importing QIF files

2006-01-23 Thread Frank E Harrell Jr
Has anyone written R code for importing financial QIF files?  I know 
there is an OpenOffice plugin for importing these into a spreadsheet but 
I found that it omits some records.

Thanks,
Frank

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

__
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] Can one write a procedure in R like for instance in Maple ?

2006-01-23 Thread Baronin P. Storch von

Dear R-wizards!

I have been learning on my own how to use this fantastic program.. but I agree 
with some people that even with the manuals, the faq and so on.. when you are 
sitting fully alone.. progress can be ... slow... very slow indeed.. In fact 
sometimes, looking at the solutions provided by  some of you- I am just 
flabbergasted to the point that I couldn't figure out how to come up with them 
myself (sometimes I don't even understand them :-( )

 But after spending around three weeks on this, and starting to get fairly 
obsessed with it, I decided I shall ask for help,'cause i can't figure out in 
the documentation where I should look for this.

In Maple when I want to automatize something boring I write a procedure..
here I am not too sure.. how to bind together a few statements- most of which 
are functions... sounds like it would make up a personnal macro..
I am sure I am doing things in such a primitive way that the R-specialists will 
wince.. but that's how it goes with beginners!

Set up.

 I have 4 fairly large data base with unequal number of lines (around 
1200-1500), but identical number of columns (162)-years.
 
for each column, I construct a data-frame with the corresponding column of DB1, 
then from DB2, .. DB4.

This yields a data.frame in which many data are NA- some are real NAs some 
others are because I have to take the max of the lines. In any case, the number 
of NAs of each of these 4 columns is not identical.

I extract (by sorting and creating 4 new vectors) 4 vectors of variable length
-the relevant and interesting data- to whom I wish to apply some standardized 
treatment: that is  normality with say Shapiro-Wilks, Levene, etc.. 
Kruskal-Wallis and probably other things.. 

I am not showing my tasks because I do not think that I want to bother the 
readers with this,, rather ask for general remarks ( you can provide examples 
of your own).

For each column I want to write the results in a table.. and append these 
resulta for each column.

I was fairly efficient at doing that for a particular column,

but then the simple thought of  apply this list of tasks 162 times.. makes 
me.. 
feel that there should be a way to speed up my execution.. (a loop)

However I have not been able to create a super function (or procedure) that 
could tie all these statements together in a sensible fashion.. because each 
time the data.frame created is generated by a function.. and somehow i still 
did not figure out how to write a function of functions 
and then maybe a loop do for all values of dates =1:162 this function..

(all the stuff I tried failed, because I was indexing objects that were also 
indexed.. I am vague.. but then retracing a 3 weeks of trials and errors errors 
errors errors ...\infty :-) is cumbersome)


1. Could anybody  give me suggestions where to look and maybe unveil the tricks 
of the function of functions .. 

ideally I would construct a loop executing a super function.. whose results 
would be dumped in a file (write.table) appending each time the result of the 
loop i..

but I was not able to construct that...
 should I make a wiser use of these apply, tapply, sapply marvels? I dunno.
 does something like for (i in 1:G){sapply(b(i),sw)} were b(i) is the dataframe 
for column i, and SW is a function (super function-procedure) make sense in R?

I see that there are some fully esoterical paragraphs on things that seem to be 
relevant in the manuals.. but.. esoterical.. I cannot make sense of them...  
vicious circle..


Thank you in advance for any courageous that  would give me a hint..

 Christina

__
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] mutlivariate normal and t distributions

2006-01-23 Thread Spencer Graves
  Thanks for this.  I got stuck some months ago, because I needed to 
evaluate a certain special normal tail region in at least 10,000 
dimensional space, and mvtnorm could not give me adequate numerical 
precision above about 30 or 35 dimensions.  When I get time to return to 
that project, I will be particularly interested in looking at your code.

  I would strongly encourage you to submit your package to CRAN. 
Otherwise it will be harder for people to learn about it and get it.  If 
your package contains functions or other objects with the same names as 
objects in other packages, that fact could create a conflict, though not 
insurmountable.  If you can make some effort to minimize the potential 
for name conflicts with other packages, that would be great.  However, 
even without that, I prefer accessibility.

  Of course, from a user's perspective, it would be best if you and the 
'mvtnorm' maintainer (Torsten Hothorn) could develop a consensus on the 
circumstances under which each algorithm is best and then develop a 
combined package that makes it easier for users to access the best known 
method -- and to easily switch between methods, when it may not be clear 
which is best.  However, if you and Torsten don't have time  energy for 
that, I would still encourage you to submit your package to CRAN.

  Best Wishes,
  Spencer Graves

Adelchi Azzalini wrote:

 Dear R-help list members,
 
 I have created a package 'mnormt' with facilities for the multivariate
 normal and t distributions. The core part is simply an interface to
 Fortran routines by Alan Genz for computing the integral of two
 densities over rectangular regions, using an adaptive integration
 method. Other R functions compute densities and generate random
 numbers.
 
 The starting motivation to write it was the  need to have functions
 which compute the distribution functions in a non-Monte Carlo form,
 sinse this caused me problems when these probabilities are involved in
 a minimization problem. For this reason, I could not make use of the
 CRAN package 'mvtnorm'.  Exactly to avoid superposition with the CRAN
 package, 'mnormt' is made available somehere else, in case other
 people want to use it.  The package 'mnormt' is at 
http://azzalini.stat.unipd.it/SN/Pkg-mnormt
 
 As explained, this is not uploaded to CRAN just to avoid clash with
 the existing package. However, if it is felt appropriate, I have no
 objection to upload it to CRAN.
 
 Best wishes,
 
 Adelchi Azzalini

__
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] Converting from a dataset to a single column

2006-01-23 Thread r user
I have a dataset of 3 “columns” and 5 “rows”.

temp-data.frame(col1=c(5,10,14,56,7),col2=c(4,2,8,3,34),col3=c(28,4,52,34,67))

I wish to convert this to a single “column”, with
column 1 on “top” and column 3 on “bottom”.

i.e.

5
10
14
56
7
4
2
8
3
34
28
4
52
34
67

Are there any functions that do this, and that will
work well on much larger datasets (e.g. 1000 rows,
6000 columns)?

__
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] Can one write a procedure in R like for instance in Maple ?

2006-01-23 Thread Berton Gunter
1. Have you read the R LANGUAGE DEFINITION in which writing functions is
extensively discussed?

2. One excellent book on R is S PROGRAMMING by Venables and Ripley. I
recommend it highly.

-- Bert Gunter
Genentech Non-Clinical Statistics
South San Francisco, CA
 
The business of the statistician is to catalyze the scientific learning
process.  - George E. P. Box
 
 

 -Original Message-
 From: [EMAIL PROTECTED] 
 [mailto:[EMAIL PROTECTED] On Behalf Of 
 Baronin P. Storch von
 Sent: Monday, January 23, 2006 9:57 AM
 To: r-help@stat.math.ethz.ch
 Subject: [R] Can one write a procedure in R like for instance 
 in Maple ?
 
 
 Dear R-wizards!
 
 I have been learning on my own how to use this fantastic 
 program.. but I agree with some people that even with the 
 manuals, the faq and so on.. when you are sitting fully 
 alone.. progress can be ... slow... very slow indeed.. In 
 fact sometimes, looking at the solutions provided by  some 
 of you- I am just flabbergasted to the point that I couldn't 
 figure out how to come up with them myself (sometimes I don't 
 even understand them :-( )
 
  But after spending around three weeks on this, and starting 
 to get fairly obsessed with it, I decided I shall ask for 
 help,'cause i can't figure out in the documentation where I 
 should look for this.
 
 In Maple when I want to automatize something boring I write a 
 procedure..
 here I am not too sure.. how to bind together a few 
 statements- most of which are functions... sounds like it 
 would make up a personnal macro..
 I am sure I am doing things in such a primitive way that the 
 R-specialists will wince.. but that's how it goes with beginners!
 
 Set up.
 
  I have 4 fairly large data base with unequal number of lines 
 (around 1200-1500), but identical number of columns (162)-years.
  
 for each column, I construct a data-frame with the 
 corresponding column of DB1, then from DB2, .. DB4.
 
 This yields a data.frame in which many data are NA- some are 
 real NAs some others are because I have to take the max of 
 the lines. In any case, the number of NAs of each of these 4 
 columns is not identical.
 
 I extract (by sorting and creating 4 new vectors) 4 vectors 
 of variable length
 -the relevant and interesting data- to whom I wish to apply 
 some standardized treatment: that is  normality with say 
 Shapiro-Wilks, Levene, etc.. Kruskal-Wallis and probably 
 other things.. 
 
 I am not showing my tasks because I do not think that I want 
 to bother the readers with this,, rather ask for general 
 remarks ( you can provide examples of your own).
 
 For each column I want to write the results in a table.. and 
 append these resulta for each column.
 
 I was fairly efficient at doing that for a particular column,
 
 but then the simple thought of  apply this list of tasks 
 162 times.. makes me.. 
 feel that there should be a way to speed up my 
 execution.. (a loop)
 
 However I have not been able to create a super function (or 
 procedure) that could tie all these statements together in a 
 sensible fashion.. because each time the data.frame created 
 is generated by a function.. and somehow i still did not 
 figure out how to write a function of functions 
 and then maybe a loop do for all values of dates =1:162 this 
 function..
 
 (all the stuff I tried failed, because I was indexing objects 
 that were also indexed.. I am vague.. but then retracing a 3 
 weeks of trials and errors errors errors errors ...\infty :-) 
 is cumbersome)
 
 
 1. Could anybody  give me suggestions where to look and maybe 
 unveil the tricks of the function of functions .. 
 
 ideally I would construct a loop executing a super function.. 
 whose results would be dumped in a file (write.table) 
 appending each time the result of the loop i..
 
 but I was not able to construct that...
  should I make a wiser use of these apply, tapply, sapply 
 marvels? I dunno.
  does something like for (i in 1:G){sapply(b(i),sw)} were 
 b(i) is the dataframe for column i, and SW is a function 
 (super function-procedure) make sense in R?
 
 I see that there are some fully esoterical paragraphs on 
 things that seem to be relevant in the manuals.. but.. 
 esoterical.. I cannot make sense of them...  vicious circle..
 
 
 Thank you in advance for any courageous that  would give me a hint..
 
  Christina
 
 __
 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] Converting from a dataset to a single column

2006-01-23 Thread Peter Dalgaard
r user [EMAIL PROTECTED] writes:

 I have a dataset of 3 “columns” and 5 “rows”.
 
 temp-data.frame(col1=c(5,10,14,56,7),col2=c(4,2,8,3,34),col3=c(28,4,52,34,67))
 
 I wish to convert this to a single “column”, with
 column 1 on “top” and column 3 on “bottom”.
 
 i.e.
 
 5
 10
 14
 56
 7
 4
 2
 8
 3
 34
 28
 4
 52
 34
 67
 
 Are there any functions that do this, and that will
 work well on much larger datasets (e.g. 1000 rows,
 6000 columns)?

unlist(temp,use.names=FALSE)

Did you really mean column (as opposed to vector?), if so,

matrix(unlist(temp,use.names=FALSE))

-- 
   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] command in survival package

2006-01-23 Thread Thomas Lumley
On Mon, 23 Jan 2006, Linda Lei wrote:

 Thank you guys.
 But I tried the commands and I still get:

 aml1-aml[aml$group==1,]
 aml1
 [1] time   status x
 0 rows (or 0-length row.names)
 esf.fit - survfit(Surv(aml1$weeks,status) ~ 1)
 Error in Surv(aml1$weeks, status) : Time variable is not numeric
 In addition: Warning message:
 is.na() applied to non-(list or vector) in: is.na(time)

 which still looks confusing. Or are they should be applied in s-plus
 instead of R?

You *still* haven't said where the aml dataset comes from, but as I said 
before, it isn't the same as the one built in to R, so you need to load it 
somehow.  The one in R has columns called time, status and x; you 
appear to want one with columns weeks,status, and group, and with 
group being numeric rather than factor.


-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] cluster plot for cmeans cluster result

2006-01-23 Thread Werner Wernersen
Hi,
  
  I am trying to make a plot similar to figure 2 on page 318 of the  finding 
groups in data book by kaufman / rousseeuw. I found  plot.partition and 
clusplot but I don't get them to work from the  results returned from a 
cmeans() clustering.
  
  How do I have to transform the parameters?
  
  Thanks a million,
Werner
  

-


[[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] R: fractional factorial design in R

2006-01-23 Thread statistical . model

Hi! 
thanks for your response!

unfortunately, fractional factorial designs typically require all factors
to 
have the same number of levels. Hence, your 2x3x3x5x2 example is not a
simple 
special case of a fractional factorial design. 
There are some special plans for mixed level designs, but the conf.design 
function requires all factors to have the same number of levels, as you can 
also find in its help:
p: The common number of levels for each factor.  Must be a prime 
  number.
ffDesMatrix from package BHH2 is even worse, since it requires all factors
to 
have 2 levels:
k: numeric. The number of 2-levels design factors in the
  designs. 


I've tried both ffDesMatrix and conf.design and i realized that they cannot
help me for the problem above.

At the moment, I am using an SPSS function (orthoplan) for my needs. It
provides factorial design with only main effects (small orthogonal designs).
Since SPSS is very expensive (in particular with this add-on), I would like
to use R as for all my other projects and research activity.

Do you know any other way to produce these designs in R?

Thanks in advance,

Roberto Furlan
University of Turin, Italy




La mia Cartella di Posta in Arrivo è protetta con SPAMfighter
188 messaggi contenenti spam sono stati bloccati con successo.
Scarica gratuitamente SPAMfighter!

__
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] Converting from a dataset to a single column

2006-01-23 Thread Gabor Csardi
 temp-data.frame(col1=c(5,10,14,56,7),col2=c(4,2,8,3,34),col3=c(28,4,52,34,67))
 temp
  col1 col2 col3
154   28
2   1024
3   148   52
4   563   34
57   34   67
 as.numeric(as.matrix(temp))
 [1]  5 10 14 56  7  4  2  8  3 34 28  4 52 34 67
 
Whether this works well enough:
 
 temp - as.data.frame(matrix(1:(1000*6000), nr=1000))
 dim(temp)
  [1] 1000 6000
 date() ; num - as.numeric(as.matrix(temp)) ; date()
  [1] Mon Jan 23 19:40:25 2006
  [1] Mon Jan 23 19:40:25 2006
 length(num)
  [1] 600
 
Gabor
 
On Mon, Jan 23, 2006 at 09:49:40AM -0800, r user wrote:
 I have a dataset of 3 “columns” and 5 “rows”.
 
 temp-data.frame(col1=c(5,10,14,56,7),col2=c(4,2,8,3,34),col3=c(28,4,52,34,67))

 I wish to convert this to a single “column”, with
 column 1 on “top” and column 3 on “bottom”.
 
 i.e.
 
 5
 10
 14
 56
 7
 4
 2
 8
 3
 34
 28
 4
 52
 34
 67
 
 Are there any functions that do this, and that will
 work well on much larger datasets (e.g. 1000 rows,
 6000 columns)?
 
 __
 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

-- 
Csardi Gabor [EMAIL PROTECTED]MTA RMKI, ELTE TTK

__
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] Converting from a dataset to a single column

2006-01-23 Thread jim holtman
?unlist

 temp-data.frame
(col1=c(5,10,14,56,7),col2=c(4,2,8,3,34),col3=c(28,4,52,34,67))
 temp
  col1 col2 col3
154   28
2   1024
3   148   52
4   563   34
57   34   67
 unlist(temp)
col11 col12 col13 col14 col15 col21 col22 col23 col24 col25 col31 col32
col33 col34 col35
5101456 7 4 2 8 33428 4
523467




On 1/23/06, r user [EMAIL PROTECTED] wrote:

 I have a dataset of 3 columns and 5 rows.

 temp-data.frame
 (col1=c(5,10,14,56,7),col2=c(4,2,8,3,34),col3=c(28,4,52,34,67))

 I wish to convert this to a single column, with
 column 1 on top and column 3 on bottom.

 i.e.

 5
 10
 14
 56
 7
 4
 2
 8
 3
 34
 28
 4
 52
 34
 67

 Are there any functions that do this, and that will
 work well on much larger datasets (e.g. 1000 rows,
 6000 columns)?

 __
 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




--
Jim Holtman
Cincinnati, OH
+1 513 247 0281

What the problem you are trying to solve?

[[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] Image Processing packages

2006-01-23 Thread Philippe Grosjean
[EMAIL PROTECTED] wrote:
 Philippe, I am trying to get there but I keep on receiving a blank file after 
 5
 minutes, is there something wrong with the site?
 H.Ghezzo
 McGill University
 Montreal - Canada

Well, I am trying myself. Indded, it seems that my server is down, or 
very busy. I will look at this tomorrow.
Best,

Philippe Grosjean

 Quoting Philippe Grosjean [EMAIL PROTECTED]:
 
 
Hello,

There are a couple of things for image processing in R (look at pixmap
and Rimage, for instance). However, R is *not* a good software for
processing images (nor is Matlab, Octave, IDL: they use to have specific
packages for image processing and analysis, but resulting applications
are way to slow in comparison to dedicated software).

A good approach is to mix ImageJ and R, if you are looking for an Open
Source solution. You could look at ZooImage for an example application
using these two software (analysis of digital zooplankton images, see:
http://www.sciviews.org/zooimage).

Best,

Philippe Grosjean


Thomas Kaliwe wrote:

Hi,

I've been looking for Image Processing packages. Thresholding, Edge
Filters, Dct, Segmentation, Restoration. I'm aware, that Octave, Matlab
etc. would be a good address but then I'm missing the statistical
power  of R. Does anybody know of packages, projects etc. Comments on
wether the use of R for such matters is useful are welcome.

Greetings

Thomas Kaliwe

 [[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-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] fractional factorial design in R

2006-01-23 Thread Berton Gunter
 
 At the moment, I am using an SPSS function (orthoplan) for my 
 needs. It provides factorial design with only main effects 
 (small orthogonal designs).
 Since SPSS is very expensive (in particular with this 
 add-on), I would like to use R as for all my other projects 
 and research activity.

Yes, you're right. For, say, a 3 x 5 design, one can do this in as few as 7
runs -- but only in general by some version of one-factor-at-a-time (OFAT)
designs, which are inefficient.  It is easy, via, say model.matrix() to
write a general function to produce these. But I think it's a bad idea; more
efiicient algorithmic designs are better, IMO, which is why I suggested
AlgDesign. You and others are free to disagree, of course.

Cheers,
Bert


 
 Do you know any other way to produce these designs in R?
 
 Thanks in advance,
 
 Roberto Furlan
 University of Turin, Italy
 
 
 
 
 La mia Cartella di Posta in Arrivo è protetta con SPAMfighter
 188 messaggi contenenti spam sono stati bloccati con successo.
 Scarica gratuitamente SPAMfighter!
 


__
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] Latest revision of lme4 requires 'Matrix' = 0.995.2 but that version is not available on CRAN

2006-01-23 Thread John Logsdon
Doug and list

No, the change as reported on my XP PC was Matrix package 0.995-1 was
found but lme4 requires = 0.995.2.

The format change was from a dash to a dot.  

Maybe a few more would spell SOS!

But it's the sort of thing where sometimes even the geniuses very close to
the work may read the string they think they wrote by gestalt.  As long as
it is what was intended and works, it doesn't matter.

But what about working in logits.  Each new mini-version would have a
constant amount of logit added, ultimately to be changed to the next
release...:-))

Best wishes to all

John

John Logsdon   Try to make things as simple
Quantex Research Ltd, Manchester UK as possible but not simpler
[EMAIL PROTECTED]  [EMAIL PROTECTED]
+44(0)161 445 4951/G:+44(0)7717758675   www.quantex-research.com


On Mon, 23 Jan 2006, Douglas Bates wrote:

 On 1/22/06, John Logsdon [EMAIL PROTECTED] wrote:
  I've just hit this problem as well and as I am slumming it on XP at the
  moment, I don't have the compilation tools to use the .tar.gz version.
 
  I also notice that the numbering format has changed.  Is this intentional?
 
 Which numbering format?  If you mean the use of 0.995 rather than 0.99
 it is because I keep finding changes that need to be made in the
 underlying format for mixed-effects representations (i.e. mer objects)
 before a 1.0 release.  The current sequence of numbers is 0.99 (99%),
 0.995 (99 1/2%), 0.9975 (99 3/4%), 0.99875 (99 7/8%), ...
 
 It is a pattern like, but not as inventive as, Donald Knuth's
 numbering sequence for TeX releases.  It has the desirable property of
 allowing for an infinite number of releases before you need to declare
 the package to be at release 1.0
 
 There will be at least a 0.9975 series of minor releases (I need to
 add another two slots to the mer object).


__
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] lines() in heatmap()

2006-01-23 Thread Paul Murrell
Hi


kaoskrew.de wrote:
 Hello!
 
 I looked for help through google and the help-files and spend several 
 hours with trial and
 error, but didn't find a correct way.
 
 It's all about lines in a heatmap to separate different data block from 
 each other to underline
 the significance of the found clusters!
 
 The heatmap is build like that:
 
 heatmap(X, Rowv=NA, Colv=NA, symm=TRUE, cexRow=0.3, cexCol=0.3)
 
 I switched the dendrograms off, because I don't want the values sorted 
 but in the way, I
 extracted them from the data.
 
 I tried to enter the lines that way:
 
 lines(c(14,14),c(0,187), col=green)
 
 That should appear as a line parallel to the x-axis, but there was no 
 line at all.
 I also tried several other ways, which didn't work at all. (The Matrix 
 contains
 187 values and is symmetric)


Take a look at the 'add.expr' argument to heatmap.  Here's a simple example:

x  - as.matrix(mtcars)
rc - rainbow(nrow(x), start=0, end=.3)
cc - rainbow(ncol(x), start=0, end=.3)
hv - heatmap(x, col = cm.colors(256), scale=column,
   RowSideColors = rc, ColSideColors = cc, margin=c(5,10),
   xlab = specification variables, ylab= Car Models,
   main = heatmap(Mtcars data, ..., scale = \column\),
   # IMPORTANT BIT HERE
   add.expr = abline(h=5, v=2))

Paul


 Also the line should start and end at the borders of the heatmap, so if 
 there is
 a parameter to enter that, I would be glad, if you add it.
 
 Another short question:
 Does anybody have an idea, how I could switch the names of my data from 
 the heatmaps
 right side to it's left side?
 
 
 Thanks for help already,
 Tobias Zimmer
 
 __
 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

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

__
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] In which application areas is R used?

2006-01-23 Thread John Maindonald
If anyone has a list of application areas where there is
extensive use of R, I'd like to hear of it. My current
short list is:

Bioinformatics
Epidemiology
Geophysics
Agriculture and crop science

John Maindonald
Mathematical Sciences Institute, Australian National University.
[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] simple problem

2006-01-23 Thread Ronaldo Reis-Jr.
Hi,

look this:

 summary(família)
   Anacardiaceae   Annonaceae  Bombacaceae Cecropiaceae 
   2413 
Chrysobalanaceae   ClusiaceaeEuphorbiacaea  Fabacea 
   1143 
Fabaceae   Flacourtiaceae  Humiriaceaeindeterminada 
  17212 
   LauraceaeMalpighiaceaeMeliaceae   Mimosaceae 
   4461 
 Moracea MoraceaeMyrtaceaeNyctaginaceae 
   1121 
   OlacaceaeRubiaceae   SapotaceaeViolaceae 
   2131 

 summary(família)==17
   Anacardiaceae   Annonaceae  Bombacaceae Cecropiaceae 
   FALSEFALSEFALSEFALSE 
Chrysobalanaceae   ClusiaceaeEuphorbiacaea  Fabacea 
   FALSEFALSEFALSEFALSE 
Fabaceae   Flacourtiaceae  Humiriaceaeindeterminada 
TRUEFALSEFALSEFALSE 
   LauraceaeMalpighiaceaeMeliaceae   Mimosaceae 
   FALSEFALSEFALSEFALSE 
 Moracea MoraceaeMyrtaceaeNyctaginaceae 
   FALSEFALSEFALSEFALSE 
   OlacaceaeRubiaceae   SapotaceaeViolaceae 
   FALSEFALSEFALSEFALSE 

 família[summary(família)==17]
[1] Fabaceae  Rubiaceae Meliaceae
24 Levels: Anacardiaceae Annonaceae Bombacaceae ... Violaceae

Why it dont work? Only Fabaceae == 17.

Thanks
Ronaldo

--
|   // | \\   [***]
|   ( õ   õ )  [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] command in survival package

2006-01-23 Thread Marc Schwartz (via MN)
On Mon, 2006-01-23 at 10:52 -0800, Thomas Lumley wrote:
 On Mon, 23 Jan 2006, Linda Lei wrote:
 
  Thank you guys.
  But I tried the commands and I still get:
 
  aml1-aml[aml$group==1,]
  aml1
  [1] time   status x
  0 rows (or 0-length row.names)
  esf.fit - survfit(Surv(aml1$weeks,status) ~ 1)
  Error in Surv(aml1$weeks, status) : Time variable is not numeric
  In addition: Warning message:
  is.na() applied to non-(list or vector) in: is.na(time)
 
  which still looks confusing. Or are they should be applied in s-plus
  instead of R?
 
 You *still* haven't said where the aml dataset comes from, but as I said 
 before, it isn't the same as the one built in to R, so you need to load it 
 somehow.  The one in R has columns called time, status and x; you 
 appear to want one with columns weeks,status, and group, and with 
 group being numeric rather than factor.
 
 
   -thomas


I don't have the book with me (it's at home), but I suspect that the
problem here is that the 'aml' dataset provided at the aforementioned
web site: 

  http://www.crcpress.com/e_products/downloads/download.asp?cat_no=C4088

which is to be used with the code under discussion, was more than likely
not imported into an R session by Linda.

Since one needs to do a:

   library(survival) 

to utilize the R code examples, that loads that package's 'aml' dataset,
resulting in:

   aml[aml$group==1,]
[1] time   status x 
0 rows (or 0-length row.names)

since there is no 'group' column in the built in 'aml' dataset as Thomas
points out.

There is such a structure to the authors' version of the dataset:

 str(read.table(aml.txt, header = TRUE))
`data.frame':   23 obs. of  3 variables:
 $ weeks : num  9 13 13 18 23 28 31 34 45 48 ...
 $ group : num  1 1 1 1 1 1 1 1 1 1 ...
 $ status: num  1 1 0 1 1 0 1 1 0 1 ...


Thus:

  aml - read.table(aml.txt, header = TRUE)

 (aml1 - aml[aml$group==1,])
   weeks group status
1  9 1  1
2 13 1  1
3 13 1  0
4 18 1  1
5 23 1  1
6 28 1  0
7 31 1  1
8 34 1  1
9 45 1  0
1048 1  1
11   161 1  0


This bring us to the still remaining error in the authors' survival
code, which is not fully corrected in the authors' online errata:

 esf.fit - survfit(Surv(aml1$weeks,status) ~ 1)
Error in Surv(aml1$weeks, status) : object status not found


Thus, something like one of the following should be used instead:

 esf.fit - survfit(Surv(aml1$weeks, aml1$status) ~ 1)

 esf.fit - with(aml1, survfit(Surv(weeks, status) ~ 1))


 summary(esf.fit)
Call: survfit(formula = Surv(aml1$weeks, aml1$status) ~ 1)

 time n.risk n.event survival std.err lower 95% CI upper 95% CI
9 11   10.909  0.0867   0.75411.000
   13 10   10.818  0.1163   0.61921.000
   18  8   10.716  0.1397   0.48841.000
   23  7   10.614  0.1526   0.37690.999
   31  5   10.491  0.1642   0.25490.946
   34  4   10.368  0.1627   0.15490.875
   48  2   10.184  0.1535   0.03590.944


I'll pass on a note to the authors, whose e-mail addresses I have
located via Google.

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


Re: [R] In which application areas is R used?

2006-01-23 Thread RAJARSHI GUHA


On Tue, 24 Jan 2006 06:35:00 +1100, John Maindonald wrote:

 If anyone has a list of application areas where there is
 extensive use of R, I'd like to hear of it. My current
 short list is:
 
 Bioinformatics
 Epidemiology
 Geophysics
 Agriculture and crop science

Cheminformatics and QSAR

Rajarshi Guha
[EMAIL PROTECTED]
http://jijo.cjb.net

__
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] Sample rows in data frame by subsets

2006-01-23 Thread Chris Stubben
Hi,

I need to resample rows in a data frame by subsets

L3 - LETTERS[1:3]
d - data.frame(cbind(x=1, y=1:10), fac=sample(L3, 10, repl=TRUE))
x  y fac
1  1  1   A
2  1  2   A
3  1  3   A
4  1  4   A
5  1  5   C
6  1  6   C
7  1  7   B
8  1  8   A
9  1  9   C
10 1 10   A

I have seen this used to sample rows with replacement

d[sample(nrow(d), replace=T), ]

 x  y fac
7   1  7   B
2   1  2   A
1   1  1   A
3   1  3   A
2.1 1  2   A
10  1 10   A
8   1  8   A
9   1  9   C
1.1 1  1   A
8.1 1  8   A


but I would like to sample based on the original number in fac

summary(d$fac)
A B C
6 1 3


rbind(subset(d, fac==A)[sample(6, replace=T), ],
   subset(d, fac==B)[sample(1, replace=T), ],
   subset(d, fac==C)[sample(3, replace=T), ] )

 x  y fac
2   1  2   A
3   1  3   A
3.1 1  3   A
1   1  1   A
10  1 10   A
1.1 1  1   A
7   1  7   B
5   1  5   C
6   1  6   C
5.1 1  5   C


Is there an easy way to do this in one step or with a short function?  I 
have lots of dataframes to resample.

Thanks,

Chris


-- 
-
Chris Stubben

Los Alamos National Lab
BioScience Division
MS M888
Los Alamos, NM 87545

__
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] simple problem

2006-01-23 Thread Liaw, Andy
From: Ronaldo Reis-Jr.
 
 Hi,
 
 look this:
 
  summary(família)
Anacardiaceae   Annonaceae  Bombacaceae Cecropiaceae 
2413 
 Chrysobalanaceae   ClusiaceaeEuphorbiacaea  Fabacea 
1143 
 Fabaceae   Flacourtiaceae  Humiriaceaeindeterminada 
   17212 
LauraceaeMalpighiaceaeMeliaceae   Mimosaceae 
4461 
  Moracea MoraceaeMyrtaceaeNyctaginaceae 
1121 
OlacaceaeRubiaceae   SapotaceaeViolaceae 
2131 
 
  summary(família)==17
Anacardiaceae   Annonaceae  Bombacaceae Cecropiaceae 
FALSEFALSEFALSEFALSE 
 Chrysobalanaceae   ClusiaceaeEuphorbiacaea  Fabacea 
FALSEFALSEFALSEFALSE 
 Fabaceae   Flacourtiaceae  Humiriaceaeindeterminada 
 TRUEFALSEFALSEFALSE 
LauraceaeMalpighiaceaeMeliaceae   Mimosaceae 
FALSEFALSEFALSEFALSE 
  Moracea MoraceaeMyrtaceaeNyctaginaceae 
FALSEFALSEFALSEFALSE 
OlacaceaeRubiaceae   SapotaceaeViolaceae 
FALSEFALSEFALSEFALSE 
 
  família[summary(família)==17]
 [1] Fabaceae  Rubiaceae Meliaceae
 24 Levels: Anacardiaceae Annonaceae Bombacaceae ... Violaceae
 
 Why it dont work? Only Fabaceae == 17.

If you look at length(familia) and length(summary(familia) == 17) perhaps
you'll see the light...

Andy

 
 Thanks
 Ronaldo
 
 --
 |   // | \\   [***]
 |   ( õ   õ )  [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] R: fractional factorial design in R

2006-01-23 Thread statistical . model
 Yes, you're right. For, say, a 3 x 5 design, one can do this in as few as
7
runs -- but only in general by some version of one-factor-at-a-time (OFAT)
designs, which are inefficient.  It is easy, via, say model.matrix() to
write a general function to produce these. But I think it's a bad idea; more
efiicient algorithmic designs are better, IMO, which is why I suggested
AlgDesign. You and others are free to disagree, of course.

Hi Bert,
thanks for your suggestion.
However, let us say that i need a 2x2x2x3x3x3 design, which should not be
too hard.
I've loaded AlgDesign, and i am aware now that gen.factorial allows me to
create a full desing. But how to create a main-effects-only factorial design
(orthogonal)?
I am still not able to produce what i need. The function
model.matrix.formula is not very clear... :(

Could you please indicate which syntax should i use? I'd really appreciate
your help.

Thanks in advance,

Roberto Furlan
University of Turin, Italy



La mia Cartella di Posta in Arrivo è protetta con SPAMfighter
188 messaggi contenenti spam sono stati bloccati con successo.
Scarica gratuitamente SPAMfighter!

__
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] In which application areas is R used?

2006-01-23 Thread stubben
Population biology

It's dominated by matlab, but I see R used more and more.

http://popstudies.stanford.edu/summer_course.html


Chris


-- 
-
Chris Stubben

Los Alamos National Lab
BioScience Division
MS M888
Los Alamos, NM 87545

__
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] Can one write a procedure in R like for instance in Maple ?

2006-01-23 Thread Liaw, Andy
Thomas Lumley has some notes that might be very helpful for you:

http://faculty.washington.edu/tlumley/Rcourse/

Deepayan Sarkar also has some notes that might be of interest:

http://www.cs.wisc.edu/~deepayan/SIBS2005/

Andy

From: Baronin P. Storch von
 
 
 Dear R-wizards!
 
 I have been learning on my own how to use this fantastic 
 program.. but I agree with some people that even with the 
 manuals, the faq and so on.. when you are sitting fully 
 alone.. progress can be ... slow... very slow indeed.. In 
 fact sometimes, looking at the solutions provided by  some 
 of you- I am just flabbergasted to the point that I couldn't 
 figure out how to come up with them myself (sometimes I don't 
 even understand them :-( )
 
  But after spending around three weeks on this, and starting 
 to get fairly obsessed with it, I decided I shall ask for 
 help,'cause i can't figure out in the documentation where I 
 should look for this.
 
 In Maple when I want to automatize something boring I write a 
 procedure..
 here I am not too sure.. how to bind together a few 
 statements- most of which are functions... sounds like it 
 would make up a personnal macro..
 I am sure I am doing things in such a primitive way that the 
 R-specialists will wince.. but that's how it goes with beginners!
 
 Set up.
 
  I have 4 fairly large data base with unequal number of lines 
 (around 1200-1500), but identical number of columns (162)-years.
  
 for each column, I construct a data-frame with the 
 corresponding column of DB1, then from DB2, .. DB4.
 
 This yields a data.frame in which many data are NA- some are 
 real NAs some others are because I have to take the max of 
 the lines. In any case, the number of NAs of each of these 4 
 columns is not identical.
 
 I extract (by sorting and creating 4 new vectors) 4 vectors 
 of variable length
 -the relevant and interesting data- to whom I wish to apply 
 some standardized treatment: that is  normality with say 
 Shapiro-Wilks, Levene, etc.. Kruskal-Wallis and probably 
 other things.. 
 
 I am not showing my tasks because I do not think that I want 
 to bother the readers with this,, rather ask for general 
 remarks ( you can provide examples of your own).
 
 For each column I want to write the results in a table.. and 
 append these resulta for each column.
 
 I was fairly efficient at doing that for a particular column,
 
 but then the simple thought of  apply this list of tasks 
 162 times.. makes me.. 
 feel that there should be a way to speed up my 
 execution.. (a loop)
 
 However I have not been able to create a super function (or 
 procedure) that could tie all these statements together in a 
 sensible fashion.. because each time the data.frame created 
 is generated by a function.. and somehow i still did not 
 figure out how to write a function of functions 
 and then maybe a loop do for all values of dates =1:162 this 
 function..
 
 (all the stuff I tried failed, because I was indexing objects 
 that were also indexed.. I am vague.. but then retracing a 3 
 weeks of trials and errors errors errors errors ...\infty :-) 
 is cumbersome)
 
 
 1. Could anybody  give me suggestions where to look and maybe 
 unveil the tricks of the function of functions .. 
 
 ideally I would construct a loop executing a super function.. 
 whose results would be dumped in a file (write.table) 
 appending each time the result of the loop i..
 
 but I was not able to construct that...
  should I make a wiser use of these apply, tapply, sapply 
 marvels? I dunno.
  does something like for (i in 1:G){sapply(b(i),sw)} were 
 b(i) is the dataframe for column i, and SW is a function 
 (super function-procedure) make sense in R?
 
 I see that there are some fully esoterical paragraphs on 
 things that seem to be relevant in the manuals.. but.. 
 esoterical.. I cannot make sense of them...  vicious circle..
 
 
 Thank you in advance for any courageous that  would give me a hint..
 
  Christina
 
 __
 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] Easy, Robust and Stable GUI???

2006-01-23 Thread pat_primate (sent by Nabble.com)

I know that this isn't really a R help question, but I am a psychology student 
at TRU (tru.ca) and my psych department is going to be switching statistical 
software in the near future.  I thought this might be a good oppertunity to 
advocate for open source if an acceptable option is available.  I have looked 
around a bit and R seems to be the most stable and mature (not to mention 
powerful) open source statistical program going.  The only downfall is that the 
school has been using spss for years and would demand a similarly user friendly 
GUI based statistical program to replace it.  I have looked at a few of the R 
guis and most of them look like they are just command line interfaces in pretty 
desktop windows and not really a gui like spss.  If anyone knows of any stable, 
userfriendly and robust guis for R that would be similar to using spss please 
let me know, as I would love for my school to start embracing open source 
software.

Thanks

Pat
--
View this message in context: 
http://www.nabble.com/Easy%2C-Robust-and-Stable-GUI--t982193.html#a2543480
Sent from the R help forum at Nabble.com.

[[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] R: fractional factorial design in R

2006-01-23 Thread Berton Gunter
In general, a main effects design need not be orthogonal -- the main
effects merely need to be estimable. The trick is to estimate them with good
efficiency, etc. I think you need to consult a local statistician for help
to understand what these statistical concepts mean.

In your example you could cross the 2^(3-1) with the 3^(3-1) to produce an
orthogonal design to estimate main effects. But of course that's 72 runs,
which I don't think you would consider small. As a previous poster
commented, there are orthogonal mixed level arrays (Addleman, Kempthorne
Youden -designs are a couple of phrases to try googling on) which stem
from the 1960's. I doubt that, in general, they would satisfy your needs.

I have not used the AlgDesign package myself. I suggest you direct questions
about it to the author/maintainer, Bob Wheeler.

-- Bert Gunter
Genentech Non-Clinical Statistics
South San Francisco, CA
 
The business of the statistician is to catalyze the scientific learning
process.  - George E. P. Box
 
 

 -Original Message-
 From: [EMAIL PROTECTED] 
 [mailto:[EMAIL PROTECTED] On Behalf Of 
 [EMAIL PROTECTED]
 Sent: Monday, January 23, 2006 12:20 PM
 To: Berton Gunter; [EMAIL PROTECTED]; 
 r-help@stat.math.ethz.ch
 Subject: [R] R: fractional factorial design in R
 
  Yes, you're right. For, say, a 3 x 5 design, one can do 
 this in as few as
 7
 runs -- but only in general by some version of 
 one-factor-at-a-time (OFAT)
 designs, which are inefficient.  It is easy, via, say 
 model.matrix() to
 write a general function to produce these. But I think it's a 
 bad idea; more
 efiicient algorithmic designs are better, IMO, which is why I 
 suggested
 AlgDesign. You and others are free to disagree, of course.
 
 Hi Bert,
 thanks for your suggestion.
 However, let us say that i need a 2x2x2x3x3x3 design, which 
 should not be
 too hard.
 I've loaded AlgDesign, and i am aware now that gen.factorial 
 allows me to
 create a full desing. But how to create a main-effects-only 
 factorial design
 (orthogonal)?
 I am still not able to produce what i need. The function
 model.matrix.formula is not very clear... :(
 
 Could you please indicate which syntax should i use? I'd 
 really appreciate
 your help.
 
 Thanks in advance,
 
 Roberto Furlan
 University of Turin, Italy
 
 
 
 La mia Cartella di Posta in Arrivo è protetta con SPAMfighter
 188 messaggi contenenti spam sono stati bloccati con successo.
 Scarica gratuitamente SPAMfighter!
 


__
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] R: fractional factorial design in R

2006-01-23 Thread Ulrike Grömping
I think that there is an understandable wish to have the simple orthogonal 
plans (and be it only for non-experts to be able to analyse the results 
themselves). For mixed levels, there is e.g. the L36 that should be able to 
accomodate plans like 2x2x2x3x3x3. Unfortunately, R is not very strong in 
this arena.

If I had more time, I would think about writing a package on comfortably 
designing experiments supported e.g. by the catalogues of  Chen, J., Sun, 
D.X., and Wu, C.F.J. (1993). (A catalogue of two-level and three-level 
fractional factorial designs with small runs. International Statistical 
Review 61, 131-145.) Such a package should also provide the analysis
facilities for any design generated with it, once it has been enriched with 
observed data. (This is a bit different from the typical R spirit, where 
users are often required to be experts themselves.) If anyone is planning a 
project like this or wants to make a diploma student work on it I would be 
interested in contributing. 

For the moment, if you want to implement main effects plans of the orthogonal 
sort (e.g. a Taguchi-plan like the L36) you have to use books or tables 
published on the internet, if you don't want to use expensive software like 
SPSS - not very comfortable, but possible. For example, you can find the L36 -
 which would be able to accomodate your 2x2x2x3x3x3 - in 
http://www.itl.nist.gov/div898/handbook/pri/section3/pri33a.htm.

With kind regards,
Ulrike

In general, a main effects design need not be orthogonal -- the main
effects merely need to be estimable. The trick is to estimate them with good
efficiency, etc. I think you need to consult a local statistician for help
to understand what these statistical concepts mean.

In your example you could cross the 2^(3-1) with the 3^(3-1) to produce an
orthogonal design to estimate main effects. But of course that's 72 runs,
which I don't think you would consider small. As a previous poster
commented, there are orthogonal mixed level arrays (Addleman, Kempthorne
Youden -designs are a couple of phrases to try googling on) which stem
from the 1960's. I doubt that, in general, they would satisfy your needs.

I have not used the AlgDesign package myself. I suggest you direct questions
about it to the author/maintainer, Bob Wheeler.

-- Bert Gunter
Genentech Non-Clinical Statistics
South San Francisco, CA
 
The business of the statistician is to catalyze the scientific learning
process. - George E. P. Box


 -Original Message-
 From: r-help-bounces at stat.math.ethz.ch 
 [mailto:r-help-bounces at stat.math.ethz.ch] On Behalf Of 
 statistical.model at googlemail.com
 Sent: Monday, January 23, 2006 12:20 PM
 To: Berton Gunter; statistical.model at googlemail.com; 
 r-help at stat.math.ethz.ch
 Subject: [R] R: fractional factorial design in R
 
  Yes, you're right. For, say, a 3 x 5 design, one can do 
 this in as few as
 7
 runs -- but only in general by some version of 
 one-factor-at-a-time (OFAT)
 designs, which are inefficient. It is easy, via, say 
 model.matrix() to
 write a general function to produce these. But I think it's a 
 bad idea; more
 efiicient algorithmic designs are better, IMO, which is why I 
 suggested
 AlgDesign. You and others are free to disagree, of course.
 
 Hi Bert,
 thanks for your suggestion.
 However, let us say that i need a 2x2x2x3x3x3 design, which 
 should not be
 too hard.
 I've loaded AlgDesign, and i am aware now that gen.factorial 
 allows me to
 create a full desing. But how to create a main-effects-only 
 factorial design
 (orthogonal)?
 I am still not able to produce what i need. The function
 model.matrix.formula is not very clear... :(
 
 Could you please indicate which syntax should i use? I'd 
 really appreciate
 your help.
 
 Thanks in advance,
 
 Roberto Furlan
 University of Turin, Italy
 
 
 
 La mia Cartella di Posta in Arrivo è protetta con SPAMfighter
 188 messaggi contenenti spam sono stati bloccati con successo.
 Scarica gratuitamente SPAMfighter!
 


__
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] weighted likelihood for lme

2006-01-23 Thread Marco Geraci
Dear R users,
  I'm trying to fit a simple random intercept model with a fixed intercept. 
Suppose I want to assign a weight w_i to the i-th contribute to the 
log-likelihood, i.e.
   
  w_i * logLik_i
   
  where logLik_i is the log-likelihood for the i-th subject.
  I want to maximize the likelihood for N subjects
   
  Sum_i  {w_i * logLik_i}
   
  Here is a simple example to reproduce
   
  # require(nlme)
 foo - Orthodont
 lme(distance ~ 1, random = ~ 1|Subject, method=ML, data = foo)
Linear mixed-effects model fit by maximum likelihood
  Data: foo 
  Log-likelihood: -257.7456
  Fixed: distance ~ 1 
(Intercept) 
   24.02315 
  Random effects:
 Formula: ~1 | Subject
(Intercept) Residual
StdDev:1.888748 2.220312
  Number of Observations: 108
Number of Groups: 27 

Then I assign arbitrary weights, constant within the group. I want to give 
weight 1 to the first 5 subjects, and weight 0.5 to the others 22 (4 is the 
number of repeated measurements for each subject)

   
   foo$w - c(rep(1, 5*4), rep(0.5, 22*4))
   
  Maybe I am missing something, but I believe that
   
   lme(distance ~ 1, random = ~ 1|Subject, method=ML, data = foo, weight=~w)
   
  does not maximize the likelihood Sum_i  {w_i * logLik_i}, since 'weight' 
describes the with-in heteroscedasticity structure.
  I think I need something like the option 'iweight' (importance weight) for 
the command 'xtreg' of Stata.
   
  Any suggestion for R?
   
  Thanks in advance,
   
  Marco Geraci
   
sessionInfo()
R version 2.2.1, 2005-12-20, i386-pc-mingw32 
  attached base packages:
[1] methods   stats graphics  grDevices utils
[6] datasets  base 
  other attached packages:
nlme 
3.1-66 






-
 
 What are the most popular cars?  Find out at Yahoo! Autos
[[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] Easy, Robust and Stable GUI???

2006-01-23 Thread Achim Zeileis
On Mon, 23 Jan 2006 12:44:49 -0800 (PST) pat_primate (sent by
Nabble.com) wrote:

 I know that this isn't really a R help question, but I am a
 psychology student at TRU (tru.ca) and my psych department is going
 to be switching statistical software in the near future.  I thought
 this might be a good oppertunity to advocate for open source if an
 acceptable option is available.  I have looked around a bit and R
 seems to be the most stable and mature (not to mention powerful) open
 source statistical program going.  The only downfall is that the
 school has been using spss for years and would demand a similarly
 user friendly GUI based statistical program to replace it.  I have
 looked at a few of the R guis and most of them look like they are
 just command line interfaces in pretty desktop windows and not really
 a gui like spss.  If anyone knows of any stable, userfriendly and
 robust guis for R that would be similar to using spss please let me
 know, as I would love for my school to start embracing open source
 software.

Have you looked at John Fox's Rcmdr package?
See
  http://socserv.mcmaster.ca/jfox/Misc/Rcmdr/
and
  John Fox (2005). The R Commander: A Basic-Statistics Graphical User
  Interface to R, Journal of Statistical Software, 14(9). URL
  http://www.jstatsoft.org/

Also look at http://www.sciviews.org/_rgui/ for an overview of other
GUI projects.

Best,
Z

 Thanks
 
 Pat
 --
 View this message in context:
 http://www.nabble.com/Easy%2C-Robust-and-Stable-GUI--t982193.html#a2543480
 Sent from the R help forum at Nabble.com.
 
   [[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] Latest revision of lme4 requires 'Matrix' = 0.995.2 but that version is not available on CRAN

2006-01-23 Thread Peter Dalgaard
John Logsdon [EMAIL PROTECTED] writes:

 Doug and list
 
 No, the change as reported on my XP PC was Matrix package 0.995-1 was
 found but lme4 requires = 0.995.2.
 
 The format change was from a dash to a dot.  

As far as I remember, the version comparison logic is
separator-agnostic, so it's purely a cosmetic issue.
 
 Maybe a few more would spell SOS!

Some of the users are already going ... --- ... /  . .-.. .--.

-- 
   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] In which application areas is R used?

2006-01-23 Thread Philippe Grosjean
You could probably add:
- Fisheries modelling
- Oceanography

Although there is still resistance of other software there, R is gaining 
more and more users in these fields.
Best,

Philippe Grosjean

P.S.: if you need actual examples, just ask... ;-)

John Maindonald wrote:
 If anyone has a list of application areas where there is
 extensive use of R, I'd like to hear of it. My current
 short list is:
 
 Bioinformatics
 Epidemiology
 Geophysics
 Agriculture and crop science
 
 John Maindonald
 Mathematical Sciences Institute, Australian National University.
 [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] varphi symbol for ylab expression

2006-01-23 Thread Kilian Plank
Hi all,

it is possible to invoke certain graphical functions (e.g. curve)
with an expression argument, e.g. ylab=expression(phi). There are
some greek letters with a second script. For instance, in latex
two symbols do exist: phi and varphi. Is the second symbol also 
available in an expression()? If yes, how?

Kind regards,

Kilian

__
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] In which application areas is R used?

2006-01-23 Thread Francisco J. Zagmutt
If it hasn't been mentioned yet, and if you want to consider this as a 
separate discipline from the ones mentioned below, we also use it for 
simulation modeling and risk analysis.

Francisco


From: John Maindonald [EMAIL PROTECTED]
To: r-help@stat.math.ethz.ch
Subject: [R] In which application areas is R used?
Date: Tue, 24 Jan 2006 06:35:00 +1100 (EST)

If anyone has a list of application areas where there is
extensive use of R, I'd like to hear of it. My current
short list is:

Bioinformatics
Epidemiology
Geophysics
Agriculture and crop science

John Maindonald
Mathematical Sciences Institute, Australian National University.
[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


Re: [R] Easy, Robust and Stable GUI???

2006-01-23 Thread Philippe Grosjean
Yes, Rcmdr is certainly the closest match. Note, however, that there are 
good reasons not to replicate SPSS style of GUI. This is because driving 
an analysis using scripts has three major advantages:

- flexibility: a good, high-level programming language allows to do much 
more than even the best GUI. This is because, as soon as you have 
programmed a dialog box, you restrict possibilities to the couple of 
choices that you hardcoded in that dialog box. With R, the only limit is 
your imagination (if something does not exist, you can program it by 
yourself).

- traceability: with a GUI, how do you remember all the mouse clicks 
that led you to a given analysis? On the contrary, a script is an 
accurate record of all steps.

- comprehension: to construct a R script, you must understand the 
analysis. R forces to learn the logic behind *before* you can run that 
analysis. With a menu/dialog box interface, you can click everywhere and 
get results by chance. Statistical packages with intuitive GUIs tend 
to stimulate lazyness: here, come! Look like I am a sexy GUI! Look, I 
am sooo easy to use! And I can deliver you plenty of results, ... No, 
no, don't be afraid, you don't need to understand what you're doing. 
Just click me!.

So, all GUIs proposed for R are just ways to learn in an easier way how 
to write R scripts. Even R Commander tries hard to stimulate use of R 
scripts... and you should consider a lack of a good GUI for R as a 
sign of quality and nothing else.

Best,

Philippe Grosjean

Achim Zeileis wrote:
 On Mon, 23 Jan 2006 12:44:49 -0800 (PST) pat_primate (sent by
 Nabble.com) wrote:
 
 
I know that this isn't really a R help question, but I am a
psychology student at TRU (tru.ca) and my psych department is going
to be switching statistical software in the near future.  I thought
this might be a good oppertunity to advocate for open source if an
acceptable option is available.  I have looked around a bit and R
seems to be the most stable and mature (not to mention powerful) open
source statistical program going.  The only downfall is that the
school has been using spss for years and would demand a similarly
user friendly GUI based statistical program to replace it.  I have
looked at a few of the R guis and most of them look like they are
just command line interfaces in pretty desktop windows and not really
a gui like spss.  If anyone knows of any stable, userfriendly and
robust guis for R that would be similar to using spss please let me
know, as I would love for my school to start embracing open source
software.
 
 
 Have you looked at John Fox's Rcmdr package?
 See
   http://socserv.mcmaster.ca/jfox/Misc/Rcmdr/
 and
   John Fox (2005). The R Commander: A Basic-Statistics Graphical User
   Interface to R, Journal of Statistical Software, 14(9). URL
   http://www.jstatsoft.org/
 
 Also look at http://www.sciviews.org/_rgui/ for an overview of other
 GUI projects.
 
 Best,
 Z
 
 
Thanks

Pat
--
View this message in context:
http://www.nabble.com/Easy%2C-Robust-and-Stable-GUI--t982193.html#a2543480
Sent from the R help forum at Nabble.com.

  [[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-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] In which application areas is R used?

2006-01-23 Thread Charles Annis, P.E.
Please don't forget engineering!  (e.g. fatigue and reliability - censored
regression and survival; quantitative nondestructive evaluation - GLM)


Charles Annis, P.E.

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

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of John Maindonald
Sent: Monday, January 23, 2006 2:35 PM
To: r-help@stat.math.ethz.ch
Subject: [R] In which application areas is R used?

If anyone has a list of application areas where there is
extensive use of R, I'd like to hear of it. My current
short list is:

Bioinformatics
Epidemiology
Geophysics
Agriculture and crop science

John Maindonald
Mathematical Sciences Institute, Australian National University.
[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


Re: [R] In which application areas is R used?

2006-01-23 Thread Berton Gunter
Define extensive.

I think your answers depend on your definition. I know a bunch of folks in
pharmaceutical preclinical RD who use R for all sorts of stuff (analysis
and visualization of tox and efficacy animal studies, dose/response
modeling, PK work, IC50 determination, stability data analysis, etc.). Is
bunch a majority? I strongly doubt that it's near. Is it 5%, 10%, 30% ??
Dunno. Excel is still the Big Boy in most of these arenas I would bet. But I
would also bet that there are at least 1 or 2 folks in dozens of companies
who use R in for these things.

Is there a subtext to your query? -- i.e. are you trying to make an argument
for something?

-- Bert 
 

 -Original Message-
 From: [EMAIL PROTECTED] 
 [mailto:[EMAIL PROTECTED] On Behalf Of John Maindonald
 Sent: Monday, January 23, 2006 11:35 AM
 To: r-help@stat.math.ethz.ch
 Subject: [R] In which application areas is R used?
 
 If anyone has a list of application areas where there is
 extensive use of R, I'd like to hear of it. My current
 short list is:
 
 Bioinformatics
 Epidemiology
 Geophysics
 Agriculture and crop science
 
 John Maindonald
 Mathematical Sciences Institute, Australian National University.
 [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] (no subject)

2006-01-23 Thread Kilian Plank
Dear list members,

I have to apologize. I overlooked a remark in the docs of
mathplot. My problem is resolved.

Kind regards,

Kilian

__
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] In which application areas is R used?

2006-01-23 Thread Jim Porzak
 my favorites: customer/marketing analytics

--
HTH,
Jim Porzak
Loyalty Matrix Inc.
San Francisco, CA

[[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] exporting dates into Microsoft SQL Server

2006-01-23 Thread r user
I am running R 2.1.1 in a Windows XP environment.

I wish to use the sqlSave command to export a
dataframe into Microsoft SQL.

My dataframe is called temp and has 2 “columns”,
“monthenddate” and “value”.

Monthenddate is in 'POSIXct', format. (i.e. 'POSIXct',
format: chr  1984-01-31 1984-01-31 1984-01-31
1984-01-31 ...).

How can I export this dataframe into SQL and have the
format in SQL by one of the “standard” SQL date
formats?

I am using the following r code:

db - odbcConnect(testserver)
sqlSave(db, temp)

__
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] command in survival package

2006-01-23 Thread Marc Schwartz
 On Mon, 2006-01-23 at 10:52 -0800, Thomas Lumley wrote:
  On Mon, 23 Jan 2006, Linda Lei wrote:
  
   Thank you guys.
   But I tried the commands and I still get:
  
   aml1-aml[aml$group==1,]
   aml1
   [1] time   status x
   0 rows (or 0-length row.names)
   esf.fit - survfit(Surv(aml1$weeks,status) ~ 1)
   Error in Surv(aml1$weeks, status) : Time variable is not numeric
   In addition: Warning message:
   is.na() applied to non-(list or vector) in: is.na(time)
  
   which still looks confusing. Or are they should be applied in
 s-plus
   instead of R?
  
  You *still* haven't said where the aml dataset comes from, but as I
 said 
  before, it isn't the same as the one built in to R, so you need to
 load it 
  somehow.  The one in R has columns called time, status and x;
 you 
  appear to want one with columns weeks,status, and group, and
 with 
  group being numeric rather than factor.
  
  
  -thomas
 
 
 I don't have the book with me (it's at home), but I suspect that the
 problem here is that the 'aml' dataset provided at the aforementioned
 web site: 
 
 
 http://www.crcpress.com/e_products/downloads/download.asp?cat_no=C4088
 
 which is to be used with the code under discussion, was more than
 likely
 not imported into an R session by Linda.
 
 Since one needs to do a:
 
library(survival) 
 
 to utilize the R code examples, that loads that package's 'aml'
 dataset,
 resulting in:
 
aml[aml$group==1,]
 [1] time   status x 
 0 rows (or 0-length row.names)
 
 since there is no 'group' column in the built in 'aml' dataset as
 Thomas
 points out.
 
 There is such a structure to the authors' version of the dataset:
 
  str(read.table(aml.txt, header = TRUE))
 `data.frame': 23 obs. of  3 variables:
  $ weeks : num  9 13 13 18 23 28 31 34 45 48 ...
  $ group : num  1 1 1 1 1 1 1 1 1 1 ...
  $ status: num  1 1 0 1 1 0 1 1 0 1 ...
 
 
 Thus:
 
   aml - read.table(aml.txt, header = TRUE)
 
  (aml1 - aml[aml$group==1,])
weeks group status
 1  9 1  1
 2 13 1  1
 3 13 1  0
 4 18 1  1
 5 23 1  1
 6 28 1  0
 7 31 1  1
 8 34 1  1
 9 45 1  0
 1048 1  1
 11   161 1  0
 
 
 This bring us to the still remaining error in the authors' survival
 code, which is not fully corrected in the authors' online errata:
 
  esf.fit - survfit(Surv(aml1$weeks,status) ~ 1)
 Error in Surv(aml1$weeks, status) : object status not found
 
 
 Thus, something like one of the following should be used instead:
 
  esf.fit - survfit(Surv(aml1$weeks, aml1$status) ~ 1)
 
  esf.fit - with(aml1, survfit(Surv(weeks, status) ~ 1))

Hi all,

A quick follow up here. Prof. Kim, one of the authors for the book in
question, replied to my e-mail of earlier today.

There are two issues here:

1. The confounding of the two versions of the 'aml' data set, which has
been identified above. Linda needs to be sure to import the authors'
version of the data set to be able to follow along with the code
examples and exercises in the book. 



2. In the code that Linda posted above, in combination with my not
having the book at hand earlier today, there is a single critical line
of code missing that impacts my reply with respect to the final couple
of statements.

The three full lines of code should be:

  aml1 - aml[aml$group==1,]

  status - rep(1, 11)

  esf.fit - survfit(Surv(aml1$weeks,status) ~ 1)


The middle line, creating the local vector 'status', is why the code
that appears corrected in the errata does in fact work and why my
corrections above are not required. 

Hope those clarifications help.

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


Re: [R] In which application areas is R used?

2006-01-23 Thread John Maindonald
In this context extensive might be use of R in at least maybe 2% or 5%
of the published analyses in the area, enough to make waves and stir
awareness.

The immediate subtext is the demand of a book publisher for a list of
journals to which a new edition of a certain book might be sent for
review, and for a list of conferences where it might be given exposure.
For myself, in the medium to longer term, I am more interested in other
subtexts such as you mention, to which the answer might have relevance.

I've wondered what support there'd be for starting a database of
bibliographic information on papers where R was used for the analysis.
Authors might supply the information, or readers of a paper suggest its
addition to the database. Once well populated, this would provide a useful
indication of the range of application areas and journals where R is
finding use.  [Or has someone, somewhere, already started such a
database?]

Finance and biostatistics are obvious areas that I'd omitted.  Other areas
drawn to my attention have been telephony and electronic networks, solid
state etc manufacturing, computer system performance, oceanography and
fisheries research, risk analysis, process engineering and marketing. (I
hope my summaries are acceptably accurate).  I'm not sure what force these
other respondents have given the word extensive.
John Maindonald
Mathematical Sciences Institute
Australian National University.
[EMAIL PROTECTED]


Berton Gunter wrote:
 Define extensive.

 I think your answers depend on your definition. I know a bunch of folks
in pharmaceutical preclinical RD who use R for all sorts of stuff 
(analysis and visualization of tox and efficacy animal studies,
dose/response modeling, PK work, IC50 determination, stability data 
analysis, etc.). Is bunch a majority? I strongly doubt that it's near.
Is it 5%, 10%, 30% ?? Dunno. Excel is still the Big Boy in most of  these
arenas I would bet. But I would also bet that there are at  least 1 or 2
folks in dozens of companies who use R in for these things.

 Is there a subtext to your query? -- i.e. are you trying to make an
argument for something?

 -- Bert


 -Original Message-
 From: [EMAIL PROTECTED]
 [mailto:[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] In which application areas is R used?

2006-01-23 Thread Spencer Graves
  Might it be reasonable to connect this with the recent thread on a 
possible R Wiki?  (See, e.g., www.sciviews.org/_rgui/wiki/doku.php.) 
  Am I correct that anyone can add an entry to a Wikipedia?  If yes, we 
just need to invite people with manuscripts and publications using R to 
post an entry.

  What do you think?
  spencer graves

John Maindonald wrote:

 In this context extensive might be use of R in at least maybe 2% or 5%
 of the published analyses in the area, enough to make waves and stir
 awareness.
 
 The immediate subtext is the demand of a book publisher for a list of
 journals to which a new edition of a certain book might be sent for
 review, and for a list of conferences where it might be given exposure.
 For myself, in the medium to longer term, I am more interested in other
 subtexts such as you mention, to which the answer might have relevance.
 
 I've wondered what support there'd be for starting a database of
 bibliographic information on papers where R was used for the analysis.
 Authors might supply the information, or readers of a paper suggest its
 addition to the database. Once well populated, this would provide a useful
 indication of the range of application areas and journals where R is
 finding use.  [Or has someone, somewhere, already started such a
 database?]
 
 Finance and biostatistics are obvious areas that I'd omitted.  Other areas
 drawn to my attention have been telephony and electronic networks, solid
 state etc manufacturing, computer system performance, oceanography and
 fisheries research, risk analysis, process engineering and marketing. (I
 hope my summaries are acceptably accurate).  I'm not sure what force these
 other respondents have given the word extensive.
 John Maindonald
 Mathematical Sciences Institute
 Australian National University.
 [EMAIL PROTECTED]
 
 
 Berton Gunter wrote:
 
Define extensive.

I think your answers depend on your definition. I know a bunch of folks
 
 in pharmaceutical preclinical RD who use R for all sorts of stuff 
 (analysis and visualization of tox and efficacy animal studies,
 dose/response modeling, PK work, IC50 determination, stability data 
 analysis, etc.). Is bunch a majority? I strongly doubt that it's near.
 Is it 5%, 10%, 30% ?? Dunno. Excel is still the Big Boy in most of  these
 arenas I would bet. But I would also bet that there are at  least 1 or 2
 folks in dozens of companies who use R in for these things.
 
Is there a subtext to your query? -- i.e. are you trying to make an
 
 argument for something?
 
-- Bert



-Original Message-
From: [EMAIL PROTECTED]
[mailto:[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


Re: [R] R: fractional factorial design in R

2006-01-23 Thread Bob Wheeler
If an orthogonal main effect plan exists for the number of trials you 
specify, optFederov() in AlgDesign will more than likely find it for 
you, since such a design should be an optimal design.

Ulrike Grömping wrote:
 I think that there is an understandable wish to have the simple orthogonal 
 plans (and be it only for non-experts to be able to analyse the results 
 themselves). For mixed levels, there is e.g. the L36 that should be able to 
 accomodate plans like 2x2x2x3x3x3. Unfortunately, R is not very strong in 
 this arena.
 
 If I had more time, I would think about writing a package on comfortably 
 designing experiments supported e.g. by the catalogues of  Chen, J., Sun, 
 D.X., and Wu, C.F.J. (1993). (A catalogue of two-level and three-level 
 fractional factorial designs with small runs. International Statistical 
 Review 61, 131-145.) Such a package should also provide the analysis
 facilities for any design generated with it, once it has been enriched with 
 observed data. (This is a bit different from the typical R spirit, where 
 users are often required to be experts themselves.) If anyone is planning a 
 project like this or wants to make a diploma student work on it I would be 
 interested in contributing. 
 
 For the moment, if you want to implement main effects plans of the orthogonal 
 sort (e.g. a Taguchi-plan like the L36) you have to use books or tables 
 published on the internet, if you don't want to use expensive software like 
 SPSS - not very comfortable, but possible. For example, you can find the L36 -
  which would be able to accomodate your 2x2x2x3x3x3 - in 
 http://www.itl.nist.gov/div898/handbook/pri/section3/pri33a.htm.
 
 With kind regards,
 Ulrike
 
 
In general, a main effects design need not be orthogonal -- the main
effects merely need to be estimable. The trick is to estimate them with good
efficiency, etc. I think you need to consult a local statistician for help
to understand what these statistical concepts mean.

In your example you could cross the 2^(3-1) with the 3^(3-1) to produce an
orthogonal design to estimate main effects. But of course that's 72 runs,
which I don't think you would consider small. As a previous poster
commented, there are orthogonal mixed level arrays (Addleman, Kempthorne
Youden -designs are a couple of phrases to try googling on) which stem
 
from the 1960's. I doubt that, in general, they would satisfy your needs.
 
I have not used the AlgDesign package myself. I suggest you direct questions
about it to the author/maintainer, Bob Wheeler.

-- Bert Gunter
Genentech Non-Clinical Statistics
South San Francisco, CA

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

 
 
-Original Message-
From: r-help-bounces at stat.math.ethz.ch 
[mailto:r-help-bounces at stat.math.ethz.ch] On Behalf Of 
statistical.model at googlemail.com
Sent: Monday, January 23, 2006 12:20 PM
To: Berton Gunter; statistical.model at googlemail.com; 
r-help at stat.math.ethz.ch
Subject: [R] R: fractional factorial design in R


Yes, you're right. For, say, a 3 x 5 design, one can do 

this in as few as
7
runs -- but only in general by some version of 
one-factor-at-a-time (OFAT)
designs, which are inefficient. It is easy, via, say 
model.matrix() to
write a general function to produce these. But I think it's a 
bad idea; more
efiicient algorithmic designs are better, IMO, which is why I 
suggested
AlgDesign. You and others are free to disagree, of course.

Hi Bert,
thanks for your suggestion.
However, let us say that i need a 2x2x2x3x3x3 design, which 
should not be
too hard.
I've loaded AlgDesign, and i am aware now that gen.factorial 
allows me to
create a full desing. But how to create a main-effects-only 
factorial design
(orthogonal)?
I am still not able to produce what i need. The function
model.matrix.formula is not very clear... :(

Could you please indicate which syntax should i use? I'd 
really appreciate
your help.

Thanks in advance,

Roberto Furlan
University of Turin, Italy



La mia Cartella di Posta in Arrivo è protetta con SPAMfighter
188 messaggi contenenti spam sono stati bloccati con successo.
Scarica gratuitamente SPAMfighter!


 
 
 __
 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
 

-- 
Bob Wheeler --- http://www.bobwheeler.com/
ECHIP, Inc. --- Randomness comes in bunches.

__
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] An Appreciation of Leo Breiman (1928-2005)

2006-01-23 Thread Lisa Solomon
We are organizing three projects to honor Leo Breiman this year.  First, 
Salford Systems' Data Mining Conference will open with a special session 
devoted to his scientific contributions.  Second, we would like to 
construct Leo's scientific family tree, identifying Leo's students, 
collaborators, and others whose work has been influenced in an important 
way by Leo's research and professional activities.  Finally, we would 
like to create a small memory book of appreciative notes and thoughts, 
stories, or photos which we will collate to present to Leo's family.

Please send your contributions for the scientific genealogy or memory 
book to [EMAIL PROTECTED] 
mailto:[EMAIL PROTECTED]

Lesser known Gems in Breiman's Research:
The opening session, from 7-9PM on March 29th, will feature a discussion 
of Leo Breiman's extensive contributions to data mining, machine 
learning, and statistics.  The session will focus on some of Breiman's 
lesser known innovations that may be influential in the future.
Speakers will include:
- Richard Carson, University of California, San Diego
- Adele Cutler, Utah State University
- Jerome Friedman, Stanford University
- Richard Olshen, Stanford University
- Chuck Stone, University of California, Berkeley
- Rob Tibshirani, Stanford University

The Conference, which continues on March 30-31, will include many papers 
on CART(R), Bagging, RandomForests(tm), as well as MARS(R), TreeNet(tm), 
and other topics related to the more recent work of Jerome Friedman and 
Richard Olshen.  Applied areas include credit risk, fraud detection, 
targeted marketing, actuarial risk, bioinformatics, medical informatics, 
quality control, and other scientific applications.

For further information please email:
[EMAIL PROTECTED] 
mailto:[EMAIL PROTECTED] or call (619) 543-8880
Conference Website: http://www.salforddatamining.com

[[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] Converting from a dataset to a single column

2006-01-23 Thread Petr Pikal
Hi

?stack and ?unlist are good starting points.

HTH
Petr


On 23 Jan 2006 at 9:49, r user wrote:

Date sent:  Mon, 23 Jan 2006 09:49:40 -0800 (PST)
From:   r user [EMAIL PROTECTED]
To: rhelp r-help@stat.math.ethz.ch
Subject:[R] Converting from a dataset to a single column

 I have a dataset of 3  columns  and 5  rows .
 
 temp-data.frame(col1=c(5,10,14,56,7),col2=c(4,2,8,3,34),col3=c(28,4,5
 2,34,67))
 
 I wish to convert this to a single  column , with
 column 1 on  top  and column 3 on  bottom .
 
 i.e.
 
 5
 10
 14
 56
 7
 4
 2
 8
 3
 34
 28
 4
 52
 34
 67
 
 Are there any functions that do this, and that will
 work well on much larger datasets (e.g. 1000 rows,
 6000 columns)?
 
 __
 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

Petr Pikal
[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] mutlivariate normal and t distributions

2006-01-23 Thread torsten

On Mon, 23 Jan 2006, Spencer Graves wrote:

 Thanks for this.  I got stuck some months ago, because I needed to
 evaluate a certain special normal tail region in at least 10,000
 dimensional space, and mvtnorm could not give me adequate numerical
 precision above about 30 or 35 dimensions.  When I get time to return to
 that project, I will be particularly interested in looking at your code.

 I would strongly encourage you to submit your package to CRAN.

yes, Adelchi, you should definitely submit the package to CRAN!

 Otherwise it will be harder for people to learn about it and get it.  If
 your package contains functions or other objects with the same names as
 objects in other packages, that fact could create a conflict, though not
 insurmountable.  If you can make some effort to minimize the potential
 for name conflicts with other packages, that would be great.  However,
 even without that, I prefer accessibility.

 Of course, from a user's perspective, it would be best if you and the
 'mvtnorm' maintainer (Torsten Hothorn) could develop a consensus on the
 circumstances under which each algorithm is best and then develop a
 combined package that makes it easier for users to access the best known
 method -- and to easily switch between methods, when it may not be clear
 which is best.  However, if you and Torsten don't have time  energy for
 that, I would still encourage you to submit your package to CRAN.


we already talked about such ideas but, for the time being, having two
packages should not be a big problem.

Best,

Torsten


 Best Wishes,
 Spencer Graves

 Adelchi Azzalini wrote:

  Dear R-help list members,
 
  I have created a package 'mnormt' with facilities for the multivariate
  normal and t distributions. The core part is simply an interface to
  Fortran routines by Alan Genz for computing the integral of two
  densities over rectangular regions, using an adaptive integration
  method. Other R functions compute densities and generate random
  numbers.
 
  The starting motivation to write it was the  need to have functions
  which compute the distribution functions in a non-Monte Carlo form,
  sinse this caused me problems when these probabilities are involved in
  a minimization problem. For this reason, I could not make use of the
  CRAN package 'mvtnorm'.  Exactly to avoid superposition with the CRAN
  package, 'mnormt' is made available somehere else, in case other
  people want to use it.  The package 'mnormt' is at
 http://azzalini.stat.unipd.it/SN/Pkg-mnormt
 
  As explained, this is not uploaded to CRAN just to avoid clash with
  the existing package. However, if it is felt appropriate, I have no
  objection to upload it to CRAN.
 
  Best wishes,
 
  Adelchi Azzalini


__
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