Re: [R] Removing constants from a data frame

2004-09-20 Thread Petr Pikal


On 17 Sep 2004 at 19:17, Kjetil Brinchmann Halvorsen wrote:

 David Forrest wrote:
 
 Suppose I have
 
 x-data.frame(v1=1:4, v2=c(2,4,NA,7), v3=rep(1,4),
  v4=LETTERS[1:4],v5=rep('Z',4))
 
 or a much larger frame, and I wish to test for and remove the
 constant numeric columns.
 
 I made:
 
is.constant-function(x){identical(min(x),max(x))}
 
 and
apply(x,2,is.constant) # Works for numerics
x[,-which(apply(x,2,is.constant))]
 
 I'd really like to be able to delete the constant columns without
 losing my non-numerics.  Ignoring the character columns would be OK.
 
 Any suggestions?
 
 Dave
   
 
 what about defing is.constant as
 is.constant -  function(x) {
  if (is.numeric(x))  identical(min(x), max(x))
  else 
 FALSE }
 
 Kjetil halvorsen

Hi
Maybe this will do it

 fff-function(a) if(is.numeric(a)) diff(range(a, na.rm=T))==0 else FALSE
 x[,!mapply(fff,x)]
  v1 v2 v4 v5
1  1  2  A  Z
2  2  4  B  Z
3  3 NA  C  Z
4  4  7  D  Z

Cheers
Petr



 
 -- 
 
 Kjetil Halvorsen.
 
 Peace is the most effective weapon of mass construction.
--  Mahdi Elmandjra
 
 __
 [EMAIL PROTECTED] 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]

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


Re: [R] WARNING: terminal is not fully functional

2004-09-20 Thread Thomas Schönhoff
Hello,
A.J. Rossini schrieb:
Thomas Schönhoff [EMAIL PROTECTED] writes:

Peter Dalgaard schrieb:
Thomas Schönhoff [EMAIL PROTECTED] writes:


Hmm, by the way, is there any tutorial or something similar point to
how to use Emacs, ESS and GNU R?

There are a few, some at http://ESS.R-Project.org/
I'll put my versions up after I get settled in Basel (mid November).

Thanks for advice!
Thomas
__
[EMAIL PROTECTED] 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] compilation failed for package

2004-09-20 Thread geir.systad
Hello,
I am new to R on Linux (and to LINUX), running a 1.9.1 on a Linux MDK10.0. When 
updating or installing different packages, I get messages like this (under), the 
package doesn't install. Can anyone help me? I know this is all to little information, 
but I don't know were to start. I think there is something wrong in how or were the 
C++ or fortran compilator is installed??
Thanks, Geir S.


gcc -shared -L/usr/local/lib -o survival.so agexact.o agfit2.o agfit3.o agfit5.o 
agfit_null.o agmart2.o agmart.o agscore.o agsurv1.o agsurv2.o agsurv3.o char_date.o 
chinv2.o chinv3.o cholesky2.o cholesky3.o chsolve2.o chsolve3.o coxdetail.o coxfit2.o 
coxfit5.o coxmart.o coxph_wtest.o cox_Rcallback.o coxscho.o coxscore.o dmatrix.o 
doloop.o pyears1.o pyears2.o pyears3.o pystep.o surv_callback.o survdiff2.o survfit2.o 
survfit3.o survindex2.o survindex3.o survreg2.o survreg3.o survreg4.o survreg5.o
/usr/bin/ld: unrecognized option '--as-needed'
/usr/bin/ld: use the --help option for usage information
collect2: ld returned 1 exit status
make: *** [survival.so] Error 1
ERROR: compilation failed for package 'survival'
** Removing '/usr/lib/R/library/survival'
** Restoring previous '/usr/lib/R/library/survival'

__
[EMAIL PROTECTED] 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] Removing constants from a data frame

2004-09-20 Thread Liaw, Andy
 From: Kjetil Brinchmann Halvorsen
 
 David Forrest wrote:
 
 Suppose I have
 
 x-data.frame(v1=1:4, v2=c(2,4,NA,7), v3=rep(1,4),
  v4=LETTERS[1:4],v5=rep('Z',4))
 
 or a much larger frame, and I wish to test for and remove 
 the constant
 numeric columns.
 
 I made:
 
is.constant-function(x){identical(min(x),max(x))}
 
 and
apply(x,2,is.constant) # Works for numerics
x[,-which(apply(x,2,is.constant))]
 
 I'd really like to be able to delete the constant columns 
 without losing
 my non-numerics.  Ignoring the character columns would be OK.
 
 Any suggestions?
 
 Dave
   
 
 what about defing is.constant as
 is.constant -  function(x) {
  if (is.numeric(x))  identical(min(x), 
 max(x)) else 
 FALSE }

identical() is probably not the safest thing to use:
 x - c(1, 2, NA)
 is.constant(x)
[1] TRUE

For data such as c(1, 1, 1, NA), I should think the safest answer should be
NA, because one really doesn't know whether that last number is 1 or not.

Andy
 
 -- 
 Kjetil Halvorsen.
 
 Peace is the most effective weapon of mass construction.
--  Mahdi Elmandjra
 
 __
 [EMAIL PROTECTED] mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide! 
 http://www.R-project.org/posting-guide.html
 


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


[R] Memory Problem???

2004-09-20 Thread Perez Martin, Agustin
DeaR useRs:
 
I am working with 1 files at the same time. These files are in some
lists. When I begin to operate the memory size grows, but never exceeds the
computer’s RAM. And suddenly R reports:
 
Error: cannot allocate vector of size 23 Kb
 
Somebody know what can I do?
 
Thanks and excuse my English.
 

---



 

[[alternative HTML version deleted]]

__
[EMAIL PROTECTED] 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] Memory Problem???

2004-09-20 Thread Uwe Ligges
Perez Martin, Agustin wrote:
DeaR useRs:
 
I am working with 1 files at the same time. These files are in some
lists. When I begin to operate the memory size grows, but never exceeds the
computers RAM. And suddenly R reports:
 
Error: cannot allocate vector of size 23 Kb
Read the FAQs and see ?Memory, in partilcuar if you are under Windows.
Uwe Ligges
Somebody know what can I do?
 
Thanks and excuse my English.
 

---

 

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


[R] persiting complex R objects

2004-09-20 Thread Richard Mott
Is there a method to save a large and complex R object (either as a 
binary or text file) so that it can be loaded and reused at a later 
time? Specifically, I am creating large lists (several thousand 
elements), each element of which is either a vector or a matrix (with ~ 
2000 rows). The dimensions of the matrices are not all the same. My 
ideal would be a set of functions of the form

obj - create() # computes  the object
save(obj,filename)
obj - load(filename)
--

Richard Mott   | Wellcome Trust Centre 
tel 01865 287588   | for Human Genetics
fax 01865 287697   | Roosevelt Drive, Oxford OX3 7BN

__
[EMAIL PROTECTED] 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] findInterval in compiled code.

2004-09-20 Thread Martin Maechler
 TobyP ==   [EMAIL PROTECTED]
 on Mon, 20 Sep 2004 14:22:27 +1000 writes:

TobyP Hi all, 
TobyP I am writing some C code where I want to use the findInterval function
TobyP documented in Writing R extensions/Utility functions. i.e. the
TobyP C-version not the R version.

(so, typically this should rather go to R-devel than R-help;
 but never mind for this time.)

TobyP It all compiles but the shared library is causing seg-faults and I'm
TobyP obviously stuffing something up. 

probably

TobyP Has anyone got any examples of calling this function
TobyP they'd be will to share? I've searched through the
TobyP source of quite a few libraries and can't find any.

indeed, there aren't any in the CRAN packages.

If you don't get other feedback, do try to isolate the problem
into a very minimalistic example, and if the problem persists,
use R-devel 
and give the details {maybe a URL to download the package source} 
of your (minimalistic!) package setup.
Then, we can help you further.

Regards,
Martin Maechler

__
[EMAIL PROTECTED] 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] persiting complex R objects

2004-09-20 Thread Sean Davis
Richard,

Check out ?save and ?load.  You were correct on those.  Do you have
questions about create?  If so, you will probably have to be more
specific.

Sean

- Original Message -
From: Richard Mott [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, September 20, 2004 7:00 AM
Subject: [R] persiting complex R objects


 Is there a method to save a large and complex R object (either as a
 binary or text file) so that it can be loaded and reused at a later
 time? Specifically, I am creating large lists (several thousand
 elements), each element of which is either a vector or a matrix (with ~
 2000 rows). The dimensions of the matrices are not all the same. My
 ideal would be a set of functions of the form

 obj - create() # computes  the object
 save(obj,filename)
 obj - load(filename)

 --
 
 Richard Mott   | Wellcome Trust Centre
 tel 01865 287588   | for Human Genetics
 fax 01865 287697   | Roosevelt Drive, Oxford OX3 7BN

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


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


Re: [R] persisting complex R objects

2004-09-20 Thread Martin Maechler
 Richard == Richard Mott [EMAIL PROTECTED]
 on Mon, 20 Sep 2004 12:00:49 +0100 writes:

Richard Is there a method to save a large and complex R
Richard object (either as a binary or text file) so that it
Richard can be loaded and reused at a later time?
Richard Specifically, I am creating large lists (several
Richard thousand elements), each element of which is either
Richard a vector or a matrix (with ~ 2000 rows). The
Richard dimensions of the matrices are not all the same. My
Richard ideal would be a set of functions of the form

Richard obj - create() # computes  the object
Richard save(obj,filename)
Richard obj - load(filename)

that sounds alright.
I'd use 
save(*, filename,  compress = TRUE)
   ^^^
if dealing with largish objects.

Also note that
 attach(filename)
is an alternative that may be a bit cleaner for your situation
that's probably not used enough.

Regards,
Martin Maechler

__
[EMAIL PROTECTED] 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] Removing constants from a data frame

2004-09-20 Thread Martin Maechler
 AndyL == Liaw, Andy [EMAIL PROTECTED]
 on Mon, 20 Sep 2004 06:22:33 -0400 writes:

 From: Kjetil Brinchmann Halvorsen
 
 David Forrest wrote:
 
 Suppose I have
 
 x-data.frame(v1=1:4, v2=c(2,4,NA,7), v3=rep(1,4),
  v4=LETTERS[1:4],v5=rep('Z',4))
 
 or a much larger frame, and I wish to test for and remove 
 the constant
 numeric columns.
 
 I made:
 
is.constant-function(x){identical(min(x),max(x))}
 
 and
apply(x,2,is.constant) # Works for numerics
x[,-which(apply(x,2,is.constant))]
 
 I'd really like to be able to delete the constant columns 
 without losing
 my non-numerics.  Ignoring the character columns would be OK.
 
 Any suggestions?
 
 Dave
   
 
 what about defing is.constant as
 is.constant -  function(x) {
if (is.numeric(x))  identical(min(x), max(x)) else  FALSE }

AndyL identical() is probably not the safest thing to use:
 x - c(1, 2, NA)
 is.constant(x)
AndyL [1] TRUE

AndyL For data such as c(1, 1, 1, NA), I should think the
AndyL safest answer should be NA, because one really
AndyL doesn't know whether that last number is 1 or not.

yes.

Also note that is.numeric() is not what you want for data.frame
columns since it isn't true for factors and you may want to
remove constant factor columns as well.

Martin Maechler

__
[EMAIL PROTECTED] 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] persiting complex R objects

2004-09-20 Thread Ingmar Visser
did you look at ?save ?load ???
ingmar

On 9/20/04 1:00 PM, Richard Mott [EMAIL PROTECTED] wrote:

 Is there a method to save a large and complex R object (either as a
 binary or text file) so that it can be loaded and reused at a later
 time? Specifically, I am creating large lists (several thousand
 elements), each element of which is either a vector or a matrix (with ~
 2000 rows). The dimensions of the matrices are not all the same. My
 ideal would be a set of functions of the form
 
 obj - create() # computes  the object
 save(obj,filename)
 obj - load(filename)

__
[EMAIL PROTECTED] 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] persiting complex R objects

2004-09-20 Thread Peter Wolf
Richard Mott wrote:
Is there a method to save a large and complex R object (either as a 
binary or text file) so that it can be loaded and reused at a later 
time? Specifically, I am creating large lists (several thousand 
elements), each element of which is either a vector or a matrix (with 
~ 2000 rows). The dimensions of the matrices are not all the same. My 
ideal would be a set of functions of the form

obj - create() # computes  the object
save(obj,filename)
obj - load(filename)
Have a look at
? dump
? source
Peter Wolf
__
[EMAIL PROTECTED] 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] persiting complex R objects

2004-09-20 Thread Richard Mott
Thanks for the help; I feel rather foolish as I had not realised that 
the functions save() and load() already existed. They are not mentioned 
in the R docs (unless you know they exist and so can query them by name 
- the general docs describing how to manipulate R objects don't mention 
them)

- Richard
--

Richard Mott   | Wellcome Trust Centre 
tel 01865 287588   | for Human Genetics
fax 01865 287697   | Roosevelt Drive, Oxford OX3 7BN

__
[EMAIL PROTECTED] 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] persiting complex R objects

2004-09-20 Thread Wolski
Hi!
?save
'save' writes an external representation of R objects to the
 specified file.  The objects can be read back from the file at a
 later date by using the function 'load' (or 'data' in some cases).


?load 

   Reload the datasets written to a file with the function 'save'.


/E
*** REPLY SEPARATOR  ***

On 9/20/2004 at 12:00 PM Richard Mott wrote:

Is there a method to save a large and complex R object (either as a 
binary or text file) so that it can be loaded and reused at a later 
time? Specifically, I am creating large lists (several thousand 
elements), each element of which is either a vector or a matrix (with ~ 
2000 rows). The dimensions of the matrices are not all the same. My 
ideal would be a set of functions of the form

obj - create() # computes  the object
save(obj,filename)
obj - load(filename)

-- 

Richard Mott   | Wellcome Trust Centre 
tel 01865 287588   | for Human Genetics
fax 01865 287697   | Roosevelt Drive, Oxford OX3 7BN

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



Dipl. bio-chem. Witold Eryk Wolski @ MPI-Moleculare Genetic   
Ihnestrasse 63-73 14195 Berlin'v'
tel: 0049-30-83875219/   \   
mail: [EMAIL PROTECTED]---W-Whttp://www.molgen.mpg.de/~wolski 
  [EMAIL PROTECTED]

__
[EMAIL PROTECTED] 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] plot.Map with pattern instead of colors

2004-09-20 Thread Arne Henningsen
Hi,

I am plotting shapefiles with plot.Map (package maptools). So far I use 
different colors for the shapes depending on the a value that belongs to the 
shape. Now, I need to produce maps only in black, gray and white for 
publication. Is it possible to fill shapes with pattern (e.g. hatched) 
instead of colors? 

Details of a simplified example:
I want to show the percentage change of a variable in a map:
e.g. following levels
a) +10
b) +5% to +10%
c) -5% to +5%
d) -10% to -5%
e) -10%

Now I have following colors
a) red
b) orange
c) white
d) greenyellow
e) green3 

Printing this on a monochrome printer is - of course - stupid, because levels 
a) and e) as well as b) and d) have approximately the same grayscale. 
I could fill a) = black and e) = white, and everything inbetween with an 
appropriate grayscale, but I prefer to have areas with no change to appear 
white rather than medium gray. Therefore, I thought of doing following:
a) black
b) gray
c) white
d) hatched with thin lines
e) hatched with thick lines (or double-hatched)

Any hints and ideas are welcome!
(BTW: I use R 1.9.1 on SuSE Linux 9.0)

Thanks,
Arne

-- 
Arne Henningsen
Department of Agricultural Economics
University of Kiel
Olshausenstr. 40
D-24098 Kiel (Germany)
Tel: +49-431-880 4445
Fax: +49-431-880 1397
[EMAIL PROTECTED]
http://www.uni-kiel.de/agrarpol/ahenningsen/

__
[EMAIL PROTECTED] 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] GARCH model query

2004-09-20 Thread Costas Vorlow
Hello,
I am trying to find an easy way to estimate  the following:
y = Function(x) + lag(x,1) + garch_error_component
Any clues?
Best regards,
Costas
---
__
[EMAIL PROTECTED] 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] plot.Map with pattern instead of colors

2004-09-20 Thread Roger Bivand
On Mon, 20 Sep 2004, Arne Henningsen wrote:

 Hi,
 
 I am plotting shapefiles with plot.Map (package maptools). So far I use 
 different colors for the shapes depending on the a value that belongs to the 
 shape. Now, I need to produce maps only in black, gray and white for 
 publication. Is it possible to fill shapes with pattern (e.g. hatched) 
 instead of colors? 

Not in plot.Map(). This is supported if you convert the shapefile polygons 
to a polylist object (Map2poly()), then use plot.polylist() - but this may 
not be your choice. Within plot.Map, I would suggest using the 
RColorBrewer package and the sequential Greys palette, which 
differentiates five grey colours very well for most media.

If you run this after example(plot.Map), it should illustrate a solution:

library(RColorBrewer)
pal - brewer.pal(5, Greys)
fgs - pal[findInterval(x$att.data$BIR74, res$breaks, all.inside=TRUE)]
plot(x, fg=fgs)

for the default quantile breaks.

 
 Details of a simplified example:
 I want to show the percentage change of a variable in a map:
 e.g. following levels
 a) +10
 b) +5% to +10%
 c) -5% to +5%
 d) -10% to -5%
 e) -10%
 
 Now I have following colors
 a) red
 b) orange
 c) white
 d) greenyellow
 e) green3 
 
 Printing this on a monochrome printer is - of course - stupid, because levels 
 a) and e) as well as b) and d) have approximately the same grayscale. 
 I could fill a) = black and e) = white, and everything inbetween with an 
 appropriate grayscale, but I prefer to have areas with no change to appear 
 white rather than medium gray. Therefore, I thought of doing following:
 a) black
 b) gray
 c) white
 d) hatched with thin lines
 e) hatched with thick lines (or double-hatched)
 
 Any hints and ideas are welcome!
 (BTW: I use R 1.9.1 on SuSE Linux 9.0)
 
 Thanks,
 Arne
 
 

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

__
[EMAIL PROTECTED] 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] montecarlo simulation

2004-09-20 Thread francesca . mata
Hy!
I would like to know how run a montecarlo simulation with R.
Thank you
Francesca Matalucci

__
Accesso Internet Gratis per utenti Excite! Attivalo subito!
http://www.excite.it/hitech/accesso

Il Mio Excite. Personalizza la tua Home page Excite come vuoi tu!
http://www.excite.it

AAA/Relazioni. Sfoglia gli annunci e trova la tua anima gemella
http://www.excite.it/relazioni

__
[EMAIL PROTECTED] 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] asypow.noncent: how does it work?

2004-09-20 Thread david_foreman
I am trying to do power calculations for the proportional odds model using the asypow 
library.

The code
 
noncenta90b10-asypow.noncent(theta.ha=a9010,info.mat=infomatrixa90b10,constraints=constrt)

returns

Error in max(..., na.rm = na.rm) : invalid mode of argument.

the various arguments I've used are:
 a9010
   [,1]
[1,] -1.7357568
[2,] -0.1928619
specifying the theta.ha array as a row not a column makes no difference


 infomatrixa90b10
 [,1] [,2]
[1,]  0.967005807 -0.004699262
[2,] -0.004699262  0.903852346
  
 constrt
 [,1] [,2] [,3]   
[1,] 1  a  -1.92861865194525
[2,] 1  b  0


I'm probably missing something very simple, but I can't see what it is.  Can anyone 
help?


___
Most doctors use http://www.Doctors.net.uk e-mail.
Move to a free professional address with spam and virus protection.

__
[EMAIL PROTECTED] 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] asypow.noncent: how does it work?

2004-09-20 Thread Uwe Ligges
[EMAIL PROTECTED] wrote:
I am trying to do power calculations for the proportional odds model using the asypow 
library.
The code
 
noncenta90b10-asypow.noncent(theta.ha=a9010,info.mat=infomatrixa90b10,constraints=constrt)

returns
Error in max(..., na.rm = na.rm) : invalid mode of argument.
the various arguments I've used are:
 a9010
   [,1]
[1,] -1.7357568
[2,] -0.1928619
specifying the theta.ha array as a row not a column makes no difference

infomatrixa90b10
 [,1] [,2]
[1,]  0.967005807 -0.004699262
[2,] -0.004699262  0.903852346
  

constrt
 [,1] [,2] [,3]   
[1,] 1  a  -1.92861865194525
[2,] 1  b  0

I don't think you can specify a character matrix as constraints -- for 
sure the package maintainer knows better.

Uwe Ligges

I'm probably missing something very simple, but I can't see what it is.  Can anyone 
help?
___
Most doctors use http://www.Doctors.net.uk e-mail.
Move to a free professional address with spam and virus protection.
__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] Re: What is nu-regression for svm?

2004-09-20 Thread David Meyer
Look up the reference given at the help-page, it tells you exactly what
nu-regression does.

best,
-d

 Date: Fri, 17 Sep 2004 11:24:03 +0100
 From: [EMAIL PROTECTED]
 Subject: [R] What is nu-regression for svm?
 To: [EMAIL PROTECTED]
 Message-ID: [EMAIL PROTECTED]
 Content-Type: text/plain; charset=ISO-8859-1
 
 
 Does anyone knows what is the nu-regression option for the type
 parameter in svm (from package e1071)? I cannot find any explanation
 on that and I have a reasonable understanding on svm fundamentals.
 
 Thanks
 
 Joao Moreira

 
- 
David Meyer
Department of Information Systems

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/Wer_sind_wir/meyer/

__
[EMAIL PROTECTED] 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/web interface

2004-09-20 Thread Warfield Jr., Joseph D.
I am trying to develop an interactive software and would like to know how I
can hook up R to the web.

Thanks
Joe Warfield

__
[EMAIL PROTECTED] 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] montecarlo simulation

2004-09-20 Thread Christian Schulz
imho one easy example:

n - 50
reps  - 1000
ms  - single(reps)
set.seed(378216)
for(i in 1:reps) {
x - exp(rnorm(n))
ms[i] - median(x)
}

hist(ms)

regards, christian


Am Montag, 20. September 2004 14:30 schrieb [EMAIL PROTECTED]:
 Hy!
 I would like to know how run a montecarlo simulation with R.
 Thank you
 Francesca Matalucci

 __
 Accesso Internet Gratis per utenti Excite! Attivalo subito!
 http://www.excite.it/hitech/accesso

 Il Mio Excite. Personalizza la tua Home page Excite come vuoi tu!
 http://www.excite.it

 AAA/Relazioni. Sfoglia gli annunci e trova la tua anima gemella
 http://www.excite.it/relazioni

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

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


RE: [R] R/web interface

2004-09-20 Thread Fowler, Mark
Some possibilities are RWeb, RPad and Rcgi. I only have experience with RWeb
myself. A decent collection of relevant links for this subject is:

http://biostat.mc.vanderbilt.edu/twiki/bin/view/Main/StatCompCourse

[The 2nd block of the page, titled 'WWW Statistical Computing Applications
using R']

   Mark Fowler
   Marine Fish Division
   Bedford Inst of Oceanography
   Dept Fisheries  Oceans
   Dartmouth NS Canada
   [EMAIL PROTECTED]



-Original Message-
From: Warfield Jr., Joseph D. [mailto:[EMAIL PROTECTED] 
Sent: September 20, 2004 10:00 AM
To: '[EMAIL PROTECTED]'
Subject: [R] R/web interface


I am trying to develop an interactive software and would like to know how I
can hook up R to the web.

Thanks
Joe Warfield

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

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


Re: [R] persisting complex R objects

2004-09-20 Thread Martin Maechler
 Richard == Richard Mott [EMAIL PROTECTED]
 on Mon, 20 Sep 2004 12:29:30 +0100 writes:

Richard Thanks for the help; I feel rather foolish as I had
Richard not realised that the functions save() and load()
Richard already existed. 
aha!

Richard They are not mentioned in the R
Richard docs (unless you know they exist and so can query
Richard them by name - the general docs describing how to
Richard manipulate R objects don't mention them)

which ones (don't mention them) did you mean?

In any case,   help.search(save)  would have helped you, too.
That's another function that is still not used often enough it
seems.

Regards,
Martin

__
[EMAIL PROTECTED] 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] Getting the real names of variables within functions

2004-09-20 Thread adelmaas
Greetings.
These days I find myself writing a lot of functions to handle routine 
things.  One of these  is a function to create a scatterplot of 
variables and draw a lowessed line so I can get some idea if there's 
any relationship between them.

lowessed.plot - function(x, y)
{   plot(x, y)
lines(lowess(x, y))
}
However, there's a slight problem:  the plot axes come out labeled x 
and y, which isn't what I want.  I want the plot axes labeled with 
the names of the variables I passed into lowessed.plot for x and y.  Is 
there any way to do that?  Thanks in advance for any help anyone can 
provide.

Aaron
-
Aaron Solomon (ben Saul Joseph) Adelman
E-mail:  [EMAIL PROTECTED]
Web site:  http://people.musc.edu/~adelmaas/
AOL Instant Messenger  Yahoo! Messenger:  Hiergargo  (YM account 
now sometimes with the Worlds first statistical Webcam, Morans Eye)
AIM chat-room (preferred):  Adelmania

__
[EMAIL PROTECTED] 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] Getting the real names of variables within functions

2004-09-20 Thread Dimitris Rizopoulos
Hi Aaron,
try to use:
plot( x, y, xlab=deparse(substitute(x)), 
ylab=deparse(substitute(y)) )

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/16/396887
Fax: +32/16/337015
Web: http://www.med.kuleuven.ac.be/biostat/
http://www.student.kuleuven.ac.be/~m0390867/dimitris.htm
- Original Message - 
From: [EMAIL PROTECTED]
To: list [EMAIL PROTECTED]
Sent: Monday, September 20, 2004 4:00 PM
Subject: [R] Getting the real names of variables within functions


Greetings.
These days I find myself writing a lot of functions to handle 
routine things.  One of these  is a function to create a scatterplot 
of variables and draw a lowessed line so I can get some idea if 
there's any relationship between them.

lowessed.plot - function(x, y)
{ plot(x, y)
lines(lowess(x, y))
}
However, there's a slight problem:  the plot axes come out labeled 
x and y, which isn't what I want.  I want the plot axes labeled 
with the names of the variables I passed into lowessed.plot for x 
and y.  Is there any way to do that?  Thanks in advance for any help 
anyone can provide.

Aaron
-
Aaron Solomon (ben Saul Joseph) Adelman
E-mail:  [EMAIL PROTECTED]
Web site:  http://people.musc.edu/~adelmaas/
AOL Instant Messenger  Yahoo! Messenger:  Hiergargo  (YM 
account now sometimes with the Worlds first statistical Webcam, 
Morans Eye)
AIM chat-room (preferred):  Adelmania

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

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


Re: [R] Getting the real names of variables within functions

2004-09-20 Thread Duncan Murdoch
On Mon, 20 Sep 2004 10:00:19 -0400, [EMAIL PROTECTED] wrote :

Greetings.

These days I find myself writing a lot of functions to handle routine 
things.  One of these  is a function to create a scatterplot of 
variables and draw a lowessed line so I can get some idea if there's 
any relationship between them.

lowessed.plot - function(x, y)
{  plot(x, y)
   lines(lowess(x, y))
}

However, there's a slight problem:  the plot axes come out labeled x 
and y, which isn't what I want.  I want the plot axes labeled with 
the names of the variables I passed into lowessed.plot for x and y.  Is 
there any way to do that?  Thanks in advance for any help anyone can 
provide.

You could do this with

plot(x, y, xlab=deparse(substitute(x)), ylab=deparse(substitute(y)))

But it's better to add two arguments to the function with those as
default values, then pass them on to plot(); that way you can change
the labels if you want.  And add dots for other customization.


For example,

lowessed.plot - function(x, y, xlab=deparse(substitute(x)),
ylab=deparse(substitute(y)), ...)
{   plot(x, y, xlab=xlab, ylab=ylab, ...)
lines(lowess(x, y))
}

Duncan Murdoch

__
[EMAIL PROTECTED] 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] Getting the real names of variables within functions

2004-09-20 Thread adelmaas
It works great now.  Thanks, guys!
Aaron
On 20  2004, at 10:10, Duncan Murdoch wrote:
On Mon, 20 Sep 2004 10:00:19 -0400, [EMAIL PROTECTED] wrote :
Greetings.
These days I find myself writing a lot of functions to handle routine
things.  One of these  is a function to create a scatterplot of
variables and draw a lowessed line so I can get some idea if there's
any relationship between them.
lowessed.plot - function(x, y)
{   plot(x, y)
lines(lowess(x, y))
}
However, there's a slight problem:  the plot axes come out labeled x
and y, which isn't what I want.  I want the plot axes labeled with
the names of the variables I passed into lowessed.plot for x and y.  
Is
there any way to do that?  Thanks in advance for any help anyone can
provide.
You could do this with
plot(x, y, xlab=deparse(substitute(x)), ylab=deparse(substitute(y)))
But it's better to add two arguments to the function with those as
default values, then pass them on to plot(); that way you can change
the labels if you want.  And add dots for other customization.
For example,
lowessed.plot - function(x, y, xlab=deparse(substitute(x)),
ylab=deparse(substitute(y)), ...)
{   plot(x, y, xlab=xlab, ylab=ylab, ...)
lines(lowess(x, y))
}
Duncan Murdoch
-
Aaron Solomon (ben Saul Joseph) Adelman
E-mail:  [EMAIL PROTECTED]
Web site:  http://people.musc.edu/~adelmaas/
AOL Instant Messenger  Yahoo! Messenger:  Hiergargo
AIM chat-room (preferred):  Adelmania
__
[EMAIL PROTECTED] 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] montecarlo simulation

2004-09-20 Thread Sean Davis
Francesca,

Do help.search(monte carlo).  That will be a good start.

Sean

- Original Message -
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, September 20, 2004 8:30 AM
Subject: [R] montecarlo simulation


 Hy!
 I would like to know how run a montecarlo simulation with R.
 Thank you
 Francesca Matalucci

 __
 Accesso Internet Gratis per utenti Excite! Attivalo subito!
 http://www.excite.it/hitech/accesso

 Il Mio Excite. Personalizza la tua Home page Excite come vuoi tu!
 http://www.excite.it

 AAA/Relazioni. Sfoglia gli annunci e trova la tua anima gemella
 http://www.excite.it/relazioni

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


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


Re: [R] R/web interface

2004-09-20 Thread Sean Davis
Joe,

You can use CGI scripts to do the coordination between R and HTML served to
the browser.  There is a new R package:

http://www.rpad.org/Rpad/

that might be of use, also.

Sean

- Original Message -
From: Warfield Jr., Joseph D. [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, September 20, 2004 9:00 AM
Subject: [R] R/web interface


 I am trying to develop an interactive software and would like to know how
I
 can hook up R to the web.

 Thanks
 Joe Warfield

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


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


[R] montecarlo simulation

2004-09-20 Thread Vito Ricci
Ciao Francesca,

here are some examples or R code using montecarlo
simulation concernig parameters estimates of sever
random variables:


Estimate of parameter theta of a uniform variable with
ML method
Stima del parametro theta di una v.a. unif(0,theta)
con metodo
dei momenti e confronto con la stima di massima
verosimiglianza (M.V.)


theta-5
n-50
x-runif(n,0,theta)
est.theta-2*mean(x) ## stima con metodo dei momenti
var.theta-(est.theta^3)/(3*n) ## stima della varianza
di theta
mlest.theta-max(x) ## stima di theta con il metodo
della M.V.
acc1-(theta-est.theta)/theta
acc2-(theta-mlest.theta)/theta
est.theta-mlest.theta

Simulazione di una v.a. uniforme (0,t), stima di theta
con metodo dei
momenti e della M.V. e stampa dei relativi grafici

t-2.5 ## valore parametro
n-20  ## dimensione campionaria
k-200 ## numero di campioni da simulare
X-matrix(runif(n*k,0,t),nrow=n)
est.tmom-2*apply(X,2,mean)
est.tml-apply(X,2,max)
hist(est.tmom,nclass=10)
hist(est.tml, nclass=10,add=T,col=red)
var.x-apply(X,2,var) ## varianza della v.a.
var.mom-var(est.tmom)## varianza della stima com
metodo dei momenti
var.ml-var(est.tml)  ## varianza della stima com
metodo della M.V.

medie.stime-c(mean(est.tml),mean(est.tmom))
var.stime-c(var.ml,var.mom)
tabella-data.frame(medie.stime,var.stime,metodo-c(Stima
ML,Stima Momenti))
names(tabella)[3]-Metodo
tabella

Weibull simulation

n-50
k-500
X-matrix(rweibull(n*k,shape=10,scale=5),nrow=n)
mediana-apply(X,2,median)
avg.med-mean(mediana)
var.med-var(mediana)
hist(mediana,freq=T)
media-apply(X,2,mean)
avg.media-mean(media)
var.media-var(media)
hist(media,freq=T)
tabella-data.frame(c(avg.med,avg.media),c(var.med,var.media))
names(tabella)-c(statistica,varianza)
qqnorm(mediana)
qqnorm(media)
shapiro.test(mediana)
shapiro.test(media)
qqplot(mediana,media)


Beta pdf simulation
Simulazione di una variabile beta

N-1000 ##numero osservazioni totali
n-50 ##numero di elementi per campione
k-N/n ##numero dei campioni
for (i in 1:n)
{
X-matrix(rbeta(N,10,20),nrow=n)
}

n-20
k-200
X-matrix(rbeta(n*k,10,20),nrow=n)

Estimate of parameters of a beta pdf with ML method
using nlm()
Stima dei parametri di una v.a. Beta con metodo della
massima verosimiglianza 
usando la funzione nlm() per un campione di ampiezza
n=100 e dei relativi errori standard

 x-rbeta(100,10,20)
 f-function(p)
100*log(beta(p[1],p[2]))+(1-p[1])*sum(log(x))+(1-p[2])*sum(log(1-x))
 out-nlm(f,p=c(20,20),hessian=TRUE)


Estimate of parameters of a Gamma pdf with ML method
using nlm().
Stima di massima verosimiglianza dei parametri di una
v.a. Gamma da cui è stato estratto un campione di
ampiezza n=200 con l'uso della funzione nlm()

x-rgamma(200,10,5)
f-function(p)
(-200*p[1]*log(p[2])+200*log(gamma(p[1]))+(1-p[1])*sum(log(x))+p[2]*sum(x))
out-nlm(f,p=c(15,10),hessian=TRUE)
out

Best
Vito



Hy!
I would like to know how run a montecarlo simulation
with R.
Thank you
Francesca Matalucci

=
Diventare costruttori di soluzioni

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



___

http://it.seriea.fantasysports.yahoo.com/

__
[EMAIL PROTECTED] 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] adding function to a Package

2004-09-20 Thread Stephen Henderson
As a shortcut I have previously added my own functions to a Package (ipred)
under R-1.8.1,  changing the NAMESPACE file to accomodate this then
reinstalling. This doesn't now seem possible in R-1.9.0 is this correct?-- I
am getting an error saying:

files NAMESPACE, R/ipred have the wrong MD5 checksums

after I try to reinstall (which I can understand). Is there a quick way
round this avoiding having to build my own Package?

Thanks
Stephen


**
This email and any files transmitted with it are confidentia...{{dropped}}

__
[EMAIL PROTECTED] 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] Multiple operations on list

2004-09-20 Thread Stephane DRAY
Hello,
suppose I have a list with matrices:
a=list(x1=matrix(rnorm(10),5,2),x2=matrix(rnorm(10),5,2),x3=matrix(rnorm(10),5,2))
I want to compute for all combination of xi and xj (x1,x2 x1,x3 and x2,x3) 
a value.
This value is given for the pair x1,x2 by trace(x1%*%t(x1)%*%x2%*%t(x2)) / 
trace(x1%*%t(x1))*trace(x2%*%t(x2))

I know that product matrices t(xi)%*%xi can be obtained by:
aa=lapply(a,crossprod)
but I do not know how to mix the values in aa to obtain the desired values.
Is there a way to do it without for loop ?
Thanks in advances,
sincerely
Stéphane DRAY
-- 

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

Web  http://www.steph280.freesurf.fr/
__
[EMAIL PROTECTED] 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] Multiple operations on list

2004-09-20 Thread Wolski
Hi!

Not sure if I got your point. 
But if it is to compute apply a function
to all pairs (x1,x2);(x1,x3);(x2,x3) where x1,x2,x3 are stored in a list you can take 
look at the sources 
of  function listdist which computes an object of class dist from a list, in the 
package pairseqsim available from bioconducor, to get an idea how to do this.

/E

*** REPLY SEPARATOR  ***

On 20.09.2004 at 13:24 Stephane DRAY wrote:

Hello,

suppose I have a list with matrices:

a=list(x1=matrix(rnorm(10),5,2),x2=matrix(rnorm(10),5,2),x3=matrix(rnorm(10),5,2))

I want to compute for all combination of xi and xj (x1,x2 x1,x3 and x2,x3) 
a value.
This value is given for the pair x1,x2 by trace(x1%*%t(x1)%*%x2%*%t(x2)) / 
trace(x1%*%t(x1))*trace(x2%*%t(x2))

I know that product matrices t(xi)%*%xi can be obtained by:

aa=lapply(a,crossprod)

but I do not know how to mix the values in aa to obtain the desired
values.

Is there a way to do it without for loop ?

Thanks in advances,

sincerely

Stéphane DRAY
--
 

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

Tel : (514) 343-6111 poste 1233 Fax : (514) 343-2293
E-mail : [EMAIL PROTECTED]
--
 

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

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

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


RE: [R] Multiple operations on list

2004-09-20 Thread Berton Gunter
Stephane:

1. apply() functions ARE (implicit) loops.
2. ?outer might be useful, but I suspect would be even more inefficient

... so I think the answer is, no, you must loop either explicitly or
implicitly.

However, my guess is that whatever you're trying to do is either built into
R or can be done much more efficiently. Explicit matrix multiplication is
almost always avoidable in statistics.

-- 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 Stephane DRAY
 Sent: Monday, September 20, 2004 10:25 AM
 To: [EMAIL PROTECTED]
 Subject: [R] Multiple operations on list
 
 Hello,
 
 suppose I have a list with matrices:
 
 a=list(x1=matrix(rnorm(10),5,2),x2=matrix(rnorm(10),5,2),x3=ma
 trix(rnorm(10),5,2))
 
 I want to compute for all combination of xi and xj (x1,x2 
 x1,x3 and x2,x3) 
 a value.
 This value is given for the pair x1,x2 by 
 trace(x1%*%t(x1)%*%x2%*%t(x2)) / 
 trace(x1%*%t(x1))*trace(x2%*%t(x2))
 
 I know that product matrices t(xi)%*%xi can be obtained by:
 
 aa=lapply(a,crossprod)
 
 but I do not know how to mix the values in aa to obtain the 
 desired values.
 
 Is there a way to do it without for loop ?
 
 Thanks in advances,
 
 sincerely
 
 Stéphane DRAY
 --
  
 
 Département des Sciences Biologiques
 Université de Montréal, C.P. 6128, succursale centre-ville
 Montréal, Québec H3C 3J7, Canada
 
 Tel : (514) 343-6111 poste 1233 Fax : (514) 343-2293
 E-mail : [EMAIL PROTECTED]
 --
  
 
 Web  
 http://www.steph280.freesurf.fr/
 
 __
 [EMAIL PROTECTED] mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide! 
 http://www.R-project.org/posting-guide.html
 
__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

[R] ?glmm with correlation structure?

2004-09-20 Thread Hank Stevens
Hi folks,
I am looking for the package that will allow me to do a generalized 
(poisson) linear mixed model with spatial correlation structure. If 
gls() in nlme does this, I don't understand how to implement different 
families. If glmmPQL() in MASS does this, I don't understand what 
correlation models it accepts. It does not appear to accept the same 
models as gls(), but I may be doing something wrong.
Is there a mixed model package or function I am overlooking?
Thanks,
Hank

Martin Henry H. Stevens
338 Pearson Hall
Department of Botany
Ecology Graduate Program
Miami University
Oxford, OH 45056 USA
tel: 513-529-4206
fax: 513-529-4243
http://www.cas.muohio.edu/botany/bot/henry.html
http://www.units.muohio.edu/ecology/
http://www.cas.muohio.edu/botany/
__
[EMAIL PROTECTED] 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] Multiple operations on list

2004-09-20 Thread Gabor Grothendieck


You could do it with a double sapply like this:

tr - function(x) sum(diag(x))
sapply(a, function(x1) sapply(a, function(x2) 
  tr(x1%*%t(x1)%*%x2%*%t(x2)) / (tr(x1%*%t(x1))*tr(x2%*%t(x2)

Date:   Mon, 20 Sep 2004 13:24:49 -0400
From:   Stephane DRAY [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject:[R] Multiple operations on list

Hello,

suppose I have a list with matrices:

a=list(x1=matrix(rnorm(10),5,2),x2=matrix(rnorm(10),5,2),x3=matrix(rnorm(10),5,2))

I want to compute for all combination of xi and xj (x1,x2 x1,x3 and x2,x3)
a value.
This value is given for the pair x1,x2 by trace(x1%*%t(x1)%*%x2%*%t(x2)) /
trace(x1%*%t(x1))*trace(x2%*%t(x2))

I know that product matrices t(xi)%*%xi can be obtained by:

aa=lapply(a,crossprod)

but I do not know how to mix the values in aa to obtain the desired values.

Is there a way to do it without for loop ?

Thanks in advances,

sincerely

Stéphane DRAY
--

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

Tel : (514) 343-6111 poste 1233 Fax : (514) 343-2293
E-mail : [EMAIL PROTECTED]

__
[EMAIL PROTECTED] 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] Nnet: Returning the response

2004-09-20 Thread Liaw, Andy
I don't think so.  ?nnet does not mention any `y=' arugment for that purpose
(and in fact `y' is used by the default method to specify the response for
training, not as a flag for returning values).

Andy

 From: Rui Dantas
 
 Hello list.
 Maybe this is a simple question but I can't find the answer anywhere.
 
 With lm I use the parameter y=TRUE to have the response 
 returned in $y. Of course, namely because of NA's in the data 
 frame, this might not include all the values in the original 
 column. For example:
 
  data(airquality)
  length(airquality$Day)
 [1] 153
  my.lm - lm(Day~.,data=airquality,y=TRUE)
  length(my.lm$y)
 [1] 111
 
 When using nnet, is there a way to have the response returned 
 in a similar way?
 
 Thanks in advance,
 Rui Dantas
 
 
   [[alternative HTML version deleted]]
 
 __
 [EMAIL PROTECTED] mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide! 
 http://www.R-project.org/posting-guide.html
 


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


[R] ASA Stat. Computing and Stat. Graphics 2005 Student Paper competition

2004-09-20 Thread jose . pinheiro
The Statistical Computing and Statistical Graphics Sections of the ASA
are co-sponsoring a student paper competition on the topics of
Statistical Computing and Statistical Graphics.  Students are
encouraged to submit a paper in one of these areas, which might be
original methodological research, some novel computing or graphical
application in statistics, or any other suitable contribution (for
example, a software-related project).  The selected winners will
present their papers in a topic-contributed session at the 2005 Joint
Statistical Meetings.  The Sections will pay registration fees for the
winners as well as a substantial allowance for transportation to the
meetings and lodging. Enclosed below is the full text of the award 
announcement.
More details can be found at the Stat. Computing Section website at
http://www.statcomputing.org. 



Best Regards,

--José Pinheiro

Awards Chair
ASA Statistical Computing Section   Statistical Computing and Statistical Graphics Sections
   American Statistical Association
Student Paper Competition 2005

The Statistical Computing and Statistical Graphics Sections of the ASA
are co-sponsoring a student paper competition on the topics of
Statistical Computing and Statistical Graphics.  Students are
encouraged to submit a paper in one of these areas, which might be
original methodological research, some novel computing or graphical
application in statistics, or any other suitable contribution (for
example, a software-related project).  The selected winners will
present their papers in a topic-contributed session at the 2005 Joint
Statistical Meetings.  The Sections will pay registration fees for the
winners as well as a substantial allowance for transportation to the
meetings and lodging (which in most cases covers these expenses
completely).

Anyone who is a student (graduate or undergraduate) on or after
September 1, 2004 is eligible to participate.  An entry must include
an abstract, a six page manuscript (including figures, tables and
references), a C.V., and a letter from a faculty member familiar with
the student's work.  The applicant must be the first author of the
paper.  The faculty letter must include a verification of the
applicant's student status and, in the case of joint authorship,
should indicate what fraction of the contribution is attributable to
the applicant.  We prefer that electronic submissions of papers be in
Postscript or PDF.  All materials must be in English.

All application materials MUST BE RECEIVED by 5:00 PM EST, Monday,
December 20, 2004 at the address below.  They will be reviewed by the
Student Paper Competition Award committee of the Statistical Computing
and Graphics Sections.  The selection criteria used by the committee
will include innovation and significance of the contribution.  Award
announcements will be made in late January, 2005.

Additional important information on the competition can be accessed on
the website of the Statistical Computing Section,
www.statcomputing.org.  A current pointer to the website is available
from the ASA website at www.amstat.org. Inquiries and application
materials should be emailed or mailed to:

Student Paper Competition
c/o Dr. José Pinheiro 
Biostatistics, Novartis Pharmaceuticals 
One Health Plaza, Room 419/2115 
East Hanover, NJ 07936
[EMAIL PROTECTED]

__
[EMAIL PROTECTED] 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] installing on alpha

2004-09-20 Thread Alexa Sorant
I am trying to install R-1.9.1 on an alpha (Tru64 unix) platform.  I had no 
problem previously installing R-1.4.0, but cannot get the new installation 
to work.  First I ran configure specifying an alternate installation 
directory:
./configure --prefix=/appl/R-1.9.1
then ran make (note that this is NOT gmake, which may make the 
difference).  The error message I get is:
Make:  cannot open /share/make/vars.mk.  Stop.
The file share/make/vars.mk is there and readable, but share is a 
subdirectory of the main installation directory.  Upon examining Makefile 
and associated files, I found a statement in Makeconf
include $(top_srcdir)/share/make/vars.mk
which I suspected was the problem -- perhaps the definition of top_srcdir 
not is carrying over from the Makefile that references Makeconf.  (One 
reason I suspect this statement is that it is new since the version of R 
that I installed easily, as well as the early reference to this particular 
file.)

I have tried a bunch of ways of modifying this statement, including an 
explicit path in this statement.  I think that did work, but a similar 
problem then occurred at a later point that I haven't yet located.

Has anyone gotten this installation to work on this platform?
Alexa J. M. Sorant
NIH/NHGRI
333 Cassell Drive Suite 2000
Baltimore, MD 21224
[EMAIL PROTECTED]
(410) 550-7512 voice
(410) 550-7513 fax
__
[EMAIL PROTECTED] 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] unable to load shared library /home/hpc1367/runs/taper/taper.so

2004-09-20 Thread hpc1367
I am trying to load a .so file and get the following error message:

 dyn.load(taper.so,local=F)
Error in dyn.load(x, as.logical(local), as.logical(now)) :
unable to load shared library
/home/hpc1367/runs/taper/taper.so:
  ld.so.1: /usr/local/lib/R/bin/R.bin: fatal: relocation error: file
/home/hpc1367/runs/taper/taper.so: symbol f90_init: referenced symbol
not found

also tried with default local=T and got same error.

my makefile (used to produce the .so) is included below

F90S = taper.f90
OBJS = taper.o
LIBS = -lsocket -lnsl -lintl
OPT = -fast
MODS = -M/opt/NAG/fnsol04dbl/nag_mod_dir
NAG = /opt/NAG/fnsol04dbl/libnagfl90.a

STATNAG = /opt/NAG/flsol20dal/libnag.a

taper.o : taper.f90
f95 -c -dalign  $(OPT) $(MODS) taper.f90

taper.so: taper.f90
f95 -o taper.so -G -dalign $(OPT) $(MODS) taper.f90

taper.x : taper.o
f95 -o taper.x -dalign $(OPT) $(MODS) $(LIBS) taper.o $(OBJS)
$(NAG)

please, help
thank you very much
stoyan

__
[EMAIL PROTECTED] 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] Multiple operations on list

2004-09-20 Thread Liaw, Andy
Hope this does what you want:

 library(gregmisc)
 cmb - combinations(length(aa), 2)
 apply(cmb, 1, function(i) sum(diag(aa[[i[1]]] %*% aa[[i[2]]])) /
+   (sum(diag(aa[[i[1]]])) * sum(diag(aa[[i[2]]]
[1] 0.5363973 0.3336318 0.6593545

Andy


 From: Stephane DRAY
 
 Hello,
 
 suppose I have a list with matrices:
 
 a=list(x1=matrix(rnorm(10),5,2),x2=matrix(rnorm(10),5,2),x3=ma
 trix(rnorm(10),5,2))
 
 I want to compute for all combination of xi and xj (x1,x2 
 x1,x3 and x2,x3) 
 a value.
 This value is given for the pair x1,x2 by 
 trace(x1%*%t(x1)%*%x2%*%t(x2)) / 
 trace(x1%*%t(x1))*trace(x2%*%t(x2))
 
 I know that product matrices t(xi)%*%xi can be obtained by:
 
 aa=lapply(a,crossprod)
 
 but I do not know how to mix the values in aa to obtain the 
 desired values.
 
 Is there a way to do it without for loop ?
 
 Thanks in advances,
 
 sincerely
 
 Stéphane DRAY
 --
  
 
 Département des Sciences Biologiques
 Université de Montréal, C.P. 6128, succursale centre-ville
 Montréal, Québec H3C 3J7, Canada
 
 Tel : (514) 343-6111 poste 1233 Fax : (514) 343-2293
 E-mail : [EMAIL PROTECTED]
 --
  
 
 Web  
 http://www.steph280.freesurf.fr/
 
 
 __
 [EMAIL PROTECTED] mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide! 
 http://www.R-project.org/posting-guide.html
 


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


[R] unable to download

2004-09-20 Thread #AMELIA ANWAR#
Hi,
I am currently trying to install packages from BioConductor to R. However, I received 
a error stating: unable to connect to 'www.bioconductor.org' on port 80
May I know what is wrong and how may I correct it?? If possible give a step by step 
procedures on how can I do it...
Thanks alot,
Amelia
 
PS: Please reply ASAP as I am currently doing a Final Year Project on microarray 
analysis and already beyond scheduled.

__
[EMAIL PROTECTED] 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] unable to download

2004-09-20 Thread Jeff Gentry
 I am currently trying to install packages from BioConductor to R.

Then you probably want to post to the bioconductor mailing list instead of
the R mailing list.

 However, I received a error stating: unable to connect to
 'www.bioconductor.org' on port 80 May I know what is wrong and how

There are lots of things that could be wrong, but since the site actually
is currently active they are most likely to be related to your end.

 may I correct it?? If possible give a step by step procedures on how
 can I do it... Thanks alot, Amelia

The first step is to see if install functionality (install.packages,
download.packages, the pulldown if you're using Windows) work for
non-bioconductor software.  If not, then the second step is to see
question 2.17 in the R for Windows FAQ.

-J

__
[EMAIL PROTECTED] 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] unable to download

2004-09-20 Thread Austin, Matt
You may need to supply some additional information about your setup.  

What operating system and version are you using?
How are you connecting to the internet?  
Can you download packages from other sources (such as CRAN)?
Exactly what procedure are you using to download the packages?
Have you tried to download individual packages and install locally?

Asking for help ASAP because you are running late is not considerate to
those willing to provide help, because most of us are already behind on our
own projects.

--Matt

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of #AMELIA ANWAR#
Sent: Monday, September 20, 2004 19:40 PM
To: [EMAIL PROTECTED]
Subject: [R] unable to download 


Hi,
I am currently trying to install packages from BioConductor to R. However, I
received a error stating: unable to connect to 'www.bioconductor.org' on
port 80
May I know what is wrong and how may I correct it?? If possible give a step
by step procedures on how can I do it...
Thanks alot,
Amelia
 
PS: Please reply ASAP as I am currently doing a Final Year Project on
microarray analysis and already beyond scheduled.

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

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


[R] how to take this experiment with R?

2004-09-20 Thread rongguiwong
i want to generate 30 independent variables and 1 dependent variable,each has 
50 draws from a unit normal distribution.
then, searching for the independent variables that together would do the best 
job for fitting the denpendent variabe.

my way to generate the data is.
x-data.frame(matrix(rnorm(1550),c(50,31)))
but is there more better way to do it?

i want to use the followling is to search the model.
model-step(lm(X1~X2+X3+X4.))
but i don't know the to express the formula with lm function.i think there is 
a way the express it efficently.
i try ?lm .but on result be found.

any help is welcome!

__
[EMAIL PROTECTED] 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] how to take this experiment with R?

2004-09-20 Thread Gabor Grothendieck



You can express your model like this:

   lm(X1 ~., x)

?formula gives some help on formulas although the . notation
above does not seem to be referred to there.


Date:   Tue, 21 Sep 2004 11:52:04 +0800
From:   rongguiwong [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject:[R] how to take this experiment with R?

i want to generate 30 independent variables and 1 dependent variable,each has
50 draws from a unit normal distribution.
then, searching for the independent variables that together would do the best
job for fitting the denpendent variabe.

my way to generate the data is.
x-data.frame(matrix(rnorm(1550),c(50,31)))
but is there more better way to do it?

i want to use the followling is to search the model.
model-step(lm(X1~X2+X3+X4.))
but i don't know the to express the formula with lm function.i think there is
a way the express it efficently.
i try ?lm .but on result be found.

any help is welcome!

__
[EMAIL PROTECTED] 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't understand R

2004-09-20 Thread Erin L. Leisz
hi.  i really need help using this program.  computer language is a foreign 
language to me, and thus, i cannot make heads nor tails of the user manuals 
from the website.  i need to locate step-by-step examples of simple 
problems such as graph f(x)+g(x) and f(g(x)) for the domain 0x2 and 
graph 2H(x), H(x)+1, H(x+1)  i do know how to define the functions, but 
that's it.  is there any help you could provide me?  i would appreciate 
some help asap.  thank you very much
erin leisz

__
[EMAIL PROTECTED] 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] how to take this experiment with R?

2004-09-20 Thread rongguiwong
ÔÚ 2004Äê9ÔÂ21ÈÕ ÐÇÆÚ¶þ 12:10£¬Gabor Grothendieck дµÀ£º
it works.
but i come across anather problem.
i just wnat to select 3 of the best indepent variables.
but the reslut from  step(lm(X1 ~., x)) is :

Step:  AIC= -37.64
 X1 ~ X2 + X3 + X4 + X8 + X10 + X11 + X13 + X14 + X15 + X18 +
X21 + X22 + X25 + X26 + X27 + X29 + X30 + X31
 
   Df Sum of Sq RSS AIC
none   11.014 -37.642
- X81 0.559  11.574 -37.165
- X27   1 0.867  11.881 -35.853
- X21 0.971  11.986 -35.416
- X18   1 0.978  11.992 -35.390
- X31   1 1.122  12.136 -34.793
- X10   1 1.400  12.414 -33.659
- X15   1 1.563  12.578 -33.005
- X29   1 1.608  12.622 -32.828
- X13   1 1.805  12.819 -32.055
- X30   1 1.880  12.894 -31.763
- X41 2.368  13.382 -29.906
- X14   1 2.495  13.509 -29.433
- X31 2.983  13.997 -27.659
- X22   1 2.999  14.013 -27.600
- X21   1 3.377  14.391 -26.271
- X25   1 4.323  15.338 -23.086
- X11   1 6.775  17.789 -15.672
- X26   1 7.232  18.246 -14.403

 You can express your model like this:



lm(X1 ~., x)



 ?formula gives some help on formulas although the . notation

 above does not seem to be referred to there.





 Date: Tue, 21 Sep 2004 11:52:04 +0800

 From: rongguiwong [EMAIL PROTECTED]

 To:   [EMAIL PROTECTED]

 Subject:  [R] how to take this experiment with R?



 i want to generate 30 independent variables and 1 dependent variable,each
 has

 50 draws from a unit normal distribution.

 then, searching for the independent variables that together would do the
 best

 job for fitting the denpendent variabe.



 my way to generate the data is.

 x-data.frame(matrix(rnorm(1550),c(50,31)))

 but is there more better way to do it?



 i want to use the followling is to search the model.

 model-step(lm(X1~X2+X3+X4.))

 but i don't know the to express the formula with lm function.i think there
 is

 a way the express it efficently.

 i try ?lm .but on result be found.



 any help is welcome!





 ___
 No banners. No pop-ups. No kidding.

__
[EMAIL PROTECTED] 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] how to take this experiment with R?

2004-09-20 Thread Gabor Grothendieck


Suppose you just wanted variables 2,4 and 7 (which are in columns
3, 5 and 8, respectively).  Then you could do this:

   lm(X1 ~ X2 + X4 + X7, x)
or
   lm(X1 ~., x[,c(2,4,7)+1])


Date:   Tue, 21 Sep 2004 12:27:38 +0800
From:   rongguiwong [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject:Re: [R] how to take this experiment with R?

ÔÚ 2004Äê9ÔÂ21ÈÕ ÐÇÆÚ¶þ 12:10£¬Gabor Grothendieck дµÀ£º
it works.
but i come across anather problem.
i just wnat to select 3 of the best indepent variables.
but the reslut from step(lm(X1 ~., x)) is :

Step: AIC= -37.64
X1 ~ X2 + X3 + X4 + X8 + X10 + X11 + X13 + X14 + X15 + X18 +
X21 + X22 + X25 + X26 + X27 + X29 + X30 + X31

Df Sum of Sq RSS AIC
none 11.014 -37.642
- X8 1 0.559 11.574 -37.165
- X27 1 0.867 11.881 -35.853
- X2 1 0.971 11.986 -35.416
- X18 1 0.978 11.992 -35.390
- X31 1 1.122 12.136 -34.793
- X10 1 1.400 12.414 -33.659
- X15 1 1.563 12.578 -33.005
- X29 1 1.608 12.622 -32.828
- X13 1 1.805 12.819 -32.055
- X30 1 1.880 12.894 -31.763
- X4 1 2.368 13.382 -29.906
- X14 1 2.495 13.509 -29.433
- X3 1 2.983 13.997 -27.659
- X22 1 2.999 14.013 -27.600
- X21 1 3.377 14.391 -26.271
- X25 1 4.323 15.338 -23.086
- X11 1 6.775 17.789 -15.672
- X26 1 7.232 18.246 -14.403

 You can express your model like this:



 lm(X1 ~., x)



 ?formula gives some help on formulas although the . notation

 above does not seem to be referred to there.





 Date:  Tue, 21 Sep 2004 11:52:04 +0800

 From:  rongguiwong [EMAIL PROTECTED]

 To:  [EMAIL PROTECTED]

 Subject:  [R] how to take this experiment with R?



 i want to generate 30 independent variables and 1 dependent variable,each
 has

 50 draws from a unit normal distribution.

 then, searching for the independent variables that together would do the
 best

 job for fitting the denpendent variabe.



 my way to generate the data is.

 x-data.frame(matrix(rnorm(1550),c(50,31)))

 but is there more better way to do it?



 i want to use the followling is to search the model.

 model-step(lm(X1~X2+X3+X4.))

 but i don't know the to express the formula with lm function.i think there
 is

 a way the express it efficently.

 i try ?lm .but on result be found.



 any help is welcome!


__
[EMAIL PROTECTED] 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] how to take this experiment with R?

2004-09-20 Thread Austin, Matt
My mistake, you can't use the structure I proposed with lm() in combination
with step().

If what was suggested earlier by Gabor was not what you wanted, and instead
you want the 'best' three variable model, then it may be easier to use the
leaps package.  


 library(leaps)
 x - data.frame(matrix(rnorm(1550),c(50,31)))
 model - regsubsets(y=x[,1], x=x[,2:31])
 m1-summary(model, matrix=TRUE, matrix.logical=TRUE)
 apply(m1$outmat, 1, which)[3]
$3  ( 1 )
X10 X14 X15 
  9  13  14 

 lm.fit(x=as.matrix(x[,as.vector(unlist(apply(m1$outmat, 1,
which)[3])+1)]), y=x[,1])
$coefficients
   X10X14X15 
-0.2694923 -0.4055546 -0.2692063 


--Matt
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of Gabor Grothendieck
Sent: Monday, September 20, 2004 21:57 PM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: Re: [R] how to take this experiment with R?




Suppose you just wanted variables 2,4 and 7 (which are in columns
3, 5 and 8, respectively).  Then you could do this:

   lm(X1 ~ X2 + X4 + X7, x)
or
   lm(X1 ~., x[,c(2,4,7)+1])


Date:   Tue, 21 Sep 2004 12:27:38 +0800
From:   rongguiwong [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject:Re: [R] how to take this experiment with R?

ÔÚ 2004Äê9ÔÂ21ÈÕ ÐÇÆÚ¶þ 12:10£¬Gabor Grothendieck дµÀ£º
it works.
but i come across anather problem.
i just wnat to select 3 of the best indepent variables.
but the reslut from step(lm(X1 ~., x)) is :

Step: AIC= -37.64
X1 ~ X2 + X3 + X4 + X8 + X10 + X11 + X13 + X14 + X15 + X18 +
X21 + X22 + X25 + X26 + X27 + X29 + X30 + X31

Df Sum of Sq RSS AIC
none 11.014 -37.642
- X8 1 0.559 11.574 -37.165
- X27 1 0.867 11.881 -35.853
- X2 1 0.971 11.986 -35.416
- X18 1 0.978 11.992 -35.390
- X31 1 1.122 12.136 -34.793
- X10 1 1.400 12.414 -33.659
- X15 1 1.563 12.578 -33.005
- X29 1 1.608 12.622 -32.828
- X13 1 1.805 12.819 -32.055
- X30 1 1.880 12.894 -31.763
- X4 1 2.368 13.382 -29.906
- X14 1 2.495 13.509 -29.433
- X3 1 2.983 13.997 -27.659
- X22 1 2.999 14.013 -27.600
- X21 1 3.377 14.391 -26.271
- X25 1 4.323 15.338 -23.086
- X11 1 6.775 17.789 -15.672
- X26 1 7.232 18.246 -14.403

 You can express your model like this:



 lm(X1 ~., x)



 ?formula gives some help on formulas although the . notation

 above does not seem to be referred to there.





 Date:  Tue, 21 Sep 2004 11:52:04 +0800

 From:  rongguiwong [EMAIL PROTECTED]

 To:  [EMAIL PROTECTED]

 Subject:  [R] how to take this experiment with R?



 i want to generate 30 independent variables and 1 dependent variable,each
 has

 50 draws from a unit normal distribution.

 then, searching for the independent variables that together would do the
 best

 job for fitting the denpendent variabe.



 my way to generate the data is.

 x-data.frame(matrix(rnorm(1550),c(50,31)))

 but is there more better way to do it?



 i want to use the followling is to search the model.

 model-step(lm(X1~X2+X3+X4.))

 but i don't know the to express the formula with lm function.i think there
 is

 a way the express it efficently.

 i try ?lm .but on result be found.



 any help is welcome!


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

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