Re: [R] KalmanLike: missing exogenous factor?

2004-10-12 Thread Prof Brian Ripley
On Mon, 11 Oct 2004, Heng Sun wrote:

 From the help document on KalmanLike, KalmanRun, etc.,
 I see the linear Gaussian state space model is 
 
 a - T a + R e
 y = Z' a + eta
 
 following the book of Durbin and Koopman.
 
 In practice, it is useful to run Kalman
 filtering/smoothing/forecasting with exogenous factor:
 
 a - T a + L b + R e
 y = Z' a + M b + eta
 
 where b is some known vector (a function of time).
 
 Some other software like S-plus and Mathematica
 include the above exogenous factor. SsfPack by
 Koopman, etal. also has the factor built in the model
 to accommodate practical uses.
 
 So what is the rationale for R to leave off the
 exogenous factor? Is there a feasible way to convert
 the general model to the simple model in R?

What is the rationale for your raising this?

KalmanLike, KalmanRun, etc were written for R 1.5.0 as part of the ts 
package (see my article in R-news), and the ts applications (see the See 
Also section) do not need a so-called `exogenous factor' (which is not a 
`factor').   R does not pretend to have facilities for whatever subject 
area you mean (but do not say) by `in practice'.  That's what addon
packages are for (and some do touch on this area).

We have no idea who [EMAIL PROTECTED]' is: it is courteous to use a 
signature and give your affiliation.

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

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


Re: [R] plotting directly to the printer

2004-10-12 Thread Prof Brian Ripley
On Mon, 11 Oct 2004, T. Murlidharan Nair wrote:

 How do I send the plots directly to the printer ?

On what operating system?

On Windows, see the rw-FAQ Q2.9.

On Linux/Unix, see ?dev.print and the print.it argument in ?postscript.

Please do read the posting guide and supply enough information for us to 
answer your questions.

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

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


[R] Statistical analysis of a large database

2004-10-12 Thread Victoria Landsman
Deall all, 
We need to perform a statistical analysis of a large database (40,000 entries with 
approximately 500 fields in each entry) currently handled in Oracle. The data contains 
categorical variables only. 
At the current stage we suggest classification and clustering analysis. 
We are planning to perform the analysis in R  and would be very grateful for any 
recommendations/suggestions/references regarding the packages/tools appropriate for 
this task. 
Thank you in advance for your attention, 
Vicky Landsman.  
[[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] plotting with multiple files

2004-10-12 Thread Prof Brian Ripley
On Mon, 11 Oct 2004, T. Murlidharan Nair wrote:

 I need to generate plots from several multiple file and I am doing this 

I presume you are making plots from *data* in those files rather than R 
scripts, but you did not say.

 by reading it as a list using c(file1, file2.).
 Since I need to either print the plots or save it as an plot image while 
 generating  the plots in a loop, has anyone
 done this before. 

Yes.  (I have no idea what you really want to know here, so am answering 
the question you actually asked.  Please read the posting guide and its 
references and try to ask smarter questions.)

 Also is there a getchar() equivalent in R, I mean just 
 to wait for an input from the console so that
 I can print before it plots the next plot.

?readline, par(ask=TRUE).

However, whilst the console is waiting for input, *you* can print, but you 
cannot run R commands to print.

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

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


RE: [R] dot density maps

2004-10-12 Thread Johannes SCHNITZLER
Dear Roger, 

Thank you very much for the reply.

And now I have to a apologize for my late response.
I was quite a while out of the office. 

This is exactly what I was looking for. I think it will be of great help
to have this implemented in a package.

Johannes 

-Original Message-
From: Roger Bivand [mailto:[EMAIL PROTECTED] 
Sent: Thursday, September 30, 2004 8:42 PM
To: Johannes SCHNITZLER
Cc: [EMAIL PROTECTED]
Subject: Re: [R] dot density maps

On Wed, 22 Sep 2004, Johannes SCHNITZLER wrote:

...
 I'm looking for the possibility to draw points (randomly positioned or
 positioned according to a grid) into the polygons instead of filling
the
 polygons with colors.
 

I apologize for not replying earlier. I think that you can combine the 
polylist class from the maptools package with the csr function in the 
splancs package to position points randomly (the gridpts() finction can 
be used instead of csr() to give grid points):

.
.

Could you indicate whether this function is any use, and if you would
like 
it added to some suitable package?

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

-- 
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] Statistical analysis of a large database

2004-10-12 Thread Vito Ricci
Hi,

for your analysis use the package:

ROracle Oracle database interface for R

http://microarrays.unife.it/CRAN/src/contrib/Descriptions/ROracle.html

see also:

Diego Kuonen, Introduction au data mining avec R :
vers la reconquête du `knowledge discovery in
databases' par les statisticiens. Bulletin of the
Swiss Statistical Society, 40:3-7, 2001.
http://www.statoo.com/en/publications/2001.R.SSS.40/

Diego Kuonen and Reinhard Furrer, Data mining avec R
dans un monde libre. Flash Informatique Spécial Été,
pages 45-50, sep 2001.
http://sawww.epfl.ch/SIC/SA/publications/FI01/fi-sp-1/sp-1-page45.html


R Development Core Team, R Data Import/Export,
versione 1.9.0, aprile 2004, pagg. 11-18
http://cran.r-project.org/doc/manuals/R-data.pdf

Brian D. Ripley, Datamining: Large Databases and
Methods, in Proceedings  of “useR! 2004 - The R User
Conference”, maggio 2004
http://www.ci.tuwien.ac.at/Conferences/useR-2004/Keynotes/Ripley.pdf

Brian D. Ripley, Using Databases with R, R News,
Gennaio 2001, pagg. 18-20
http://cran.r-project.org/doc/Rnews/Rnews_2001-1.pdf

B. D. Ripley, R. M. Ripley,  Applications of R Clients
and Servers in Proceedings of the Distributed
Statistical Computing 2001 Workshop, 2001, Vienna
University of Technology.
http://www.ci.tuwien.ac.at/Conferences/DSC-2001/Proceedings/Ripley.pdf


Torsten Hothorn, David A. James, Brian D. Ripley,  R/S
Interfaces to Databases  in Proceedings of the
Distributed Statistical Computing 2001 Workshop,
2001,Vienna University of Technology.
http://www.ci.tuwien.ac.at/Conferences/DSC-2001/Proceedings/HothornJamesRipley.pdf

Luís Torgo, Data Mining with R. Learning by case
studies, Maggio 2003
http://www.liacc.up.pt/~ltorgo/DataMiningWithR/

I hope I give you a little help.
Best
Vito




You wrote:

Deall all, 
We need to perform a statistical analysis of a large
database (40,000 entries with approximately 500 fields
in each entry) currently handled in Oracle. The data
contains categorical variables only. 
At the current stage we suggest classification and
clustering analysis. 
We are planning to perform the analysis in R  and
would be very grateful for any
recommendations/suggestions/references regarding the
packages/tools appropriate for this task. 
Thank you in advance for your attention, 
Vicky Landsman


=
Diventare costruttori di soluzioni

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


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

__
[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] Statistical analysis of a large database

2004-10-12 Thread Prof Brian Ripley
I believe this is a reply to a posting -- since this is by no means the 
first time this has happened, please

- use the Reply function of your mailer, or at least use Re: in the 
subject line and include the relevant part of the original posting, and
- send the reply to the questioner, as well as possibly to the list.

On Tue, 12 Oct 2004, Vito Ricci wrote:

[...]

 Luís Torgo, Data Mining with R. Learning by case
 studies, Maggio 2003
 http://www.liacc.up.pt/~ltorgo/DataMiningWithR/

Please note that that reference is not about large datasets, nor about 
`data mining' in the generally used sense.  It has two studies, one 
incomplete, on linear regression (with 200 samples) and on time series.

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

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


[R] lm#contrasts#one level in factor: bug or feature

2004-10-12 Thread Ritter, Christian C MCIL-CTANL/S
(R.1.9.1; win2000)

Since it's about the tenth time I had to write an if around this to catch the error 
...
Let's look at the line 

myfit-lm(res~groupvar,data=Data)

Here res is of numeric type and groupvar is a factor. On first sight, it would be 
logical that if groupvar had only one (single) level we would get:

Error in contrasts-(`*tmp*`, value = contr.treatment) : contrasts 
can be applied only to factors with 2 or more levels

But then again, it's also inconsistent: Normally redundant variables on the right of 
the ~ (variables which are constant or linearly dependent on previous variables) don't 
lead to Error. They just get a NA as a coefficient estimate. A factor with a 
single level is of this type, it is just a constant. Obviously (to me) lm (or 
model.matrix.default) should not try to calculate contrasts on it and it's coefficient 
should be NA. Shouldn't it? 

Why is this not unimportant? Imagine you make a model of the above type for a data set 
with more than one level in groupvar. Then you select subsets and refit. It shouldn't 
die with error if you select a subset with only one level of groupvar. 

 Chris.


[[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] 64-bit R on Intel Xeon EM64T running fine

2004-10-12 Thread Roger D. Peng
This is good news.  As far as I know R has built for quite some time 
now on a number of 64 bit platforms (Linux on AMD Opteron/Athlon64, 
Solaris/Sparc) but I can't recall seeing a build on Intel with the 64 
bit extensions.  By the way, did you happen to run `make check' just 
for kicks?

-roger
Michael Seewald wrote:
Dear mailing-list members,
In the days of cheap RAM and microarray applications feasting on memory,
64-bit computers become more and more useful - to actually make use of memory
beyond the magic 4GB border. I would like to report the success of running
64-bit R on an Intel Xeon EM64T machine under Linux. Just like on an AMD
Opteron, R v2.0.0 compiles fine (and out of the box) and is happily allocating
memory until RAM and swap reach their limit.
Hardware:
- HP xw6200 workstation
- dual Intel Xeon 3.4GHz with hyper-threading enabled
- 4GB RAM, 4GB swap
System: either
- Fedora Core 2 x86_64 bit Linux
or
- Red Hat Enterprise Linux Workstation 3.0 x86_64 bit
R:
- v2.0.0
Really, no problems at all during setup, a big thank you to the R developers
making this possible!
Best wishes,
Michael
__
[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] Diagnosing trouble with R-2.0, Fedora Core 2, and Rcmdf

2004-10-12 Thread John Fox
Dear Paul,

I'm currently out of town, limiting a bit my ability to answer these
questions definitively, but I'll give it a shot (hoping that my memory
isn't faulty):

On Mon, 11 Oct 2004 13:08:39 -0500
 Paul Johnson [EMAIL PROTECTED] wrote:
 Greetings, R-help!
 
 On 2 Fedora Core 2 Linux systems, i've completely erased the previous
 R and all packages and then installed R-2.0 and installed fresh
 packages.
 
 In using Rcmdr, I see some trouble and I wonder if other people see
 this and if it is due to the tcl/tk, or R, or Rcmdr.  (If readers
 have not yet tried Rcmdr, I recommend it not just because of the GUI
 it provides, but also because Prof. Fox has created several very
 handy commands, like scatter3d, which make it possible to use
 advanced packages like rgl. Rcmdr provides several very handy wrapper
 commands that just work and users don't have to fuss over so many
 details! And, if you are new at R, you can use pull down menus and
 then Rcmdr displays the commands that correspond with those menu
 options. Very educational!)
 
 In no particular order, here are the issues I see with R-2.0 and
 Rcmdr
 
 1. In the panel to select a dataset from a package (nenu: Data/Data
 in packages), I can type in the name of a dataset, but the GUI will
 not let me choose the name of a package from which to select a
 dataset. Nothing happens when I pick a package name.  (With previous
 R/Rcmdr, I did not have this trouble).
 

The problem is that the Rcmdr code doesn't quote the name of the
package. I believe that I've fixed this problem, but haven't posted the
fixed version either to my web site or to CRAN.

 2. When using Rcmdr, some of the output from commands shows in the
 Rcmdr bottom window, but some is sent to the xterm in which R was
 started. For example, with a scatter3d() command, if I add the option
 model.summary=T, the model summary shows in the xterm.  But some
 other models show results in the bottom pane of Rcmdr.  And, it seems
 to me, there are some commands in which I've noticed some of the
 output going to the Rcmdr bottom buffer and  some to the xterm.
 

As I recall, I've fixed this problem as well, but perhaps not in a
completely general way. Again, I haven't yet released the fixed
version.

 3. When I want to exit Rcmdr and choose the pull down exit from
 Commander and R, I get a Segmentation Fault that closes Rcmdr and R.
 

This I haven't seen before.

 4. 3d plots do not display on the screen until I click in the rgl
 window that displays the graph.  This might be a video card/AGP
 driver problem, I suppose.  These systems have the NVidia FX5200
 cards and the NVidia proprietary X driver.  If other users don't see
 the same on other kinds of systems, I guess that will tell me where
 the problem lies.
 

I believe that I've noticed this problem on a Quantian system.

 5. At random times, I get an error tcl/tk window popping up with a
 message about MASS and categorical variables.  It says
 

This reflects the first problem, and is produced by the way that the
Rcmdr initially suppresses and then reports warnings.

I'll check further when I return home.

Sorry for the problems.

John

 Error in data(package=parse(text=packageName));
 'MASS' must be character string or NULL
 
 It says that over and over, sometimes it has other package names, as
 in:
 
 Error in data(package=parse(text=packageName));
 'relimp' must be character string or NULL
 
 These seem to be harmless?
 -- 
 Paul E. Johnson   email: [EMAIL PROTECTED]
 Dept. of Political Sciencehttp://lark.cc.ku.edu/~pauljohn
 1541 Lilac Lane, Rm 504
 University of Kansas  Office: (785) 864-9086
 Lawrence, Kansas 66044-3177   FAX: (785) 864-5700
 
 __
 [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


John Fox
Department of Sociology
McMaster University
Hamilton, Ontario, Canada
http://socserv.mcmaster.ca/jfox/

__
[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] 64-bit R on Intel Xeon EM64T running fine

2004-10-12 Thread Prof Brian Ripley
On Tue, 12 Oct 2004, Roger D. Peng wrote:

 This is good news.  As far as I know R has built for quite some time 
 now on a number of 64 bit platforms (Linux on AMD Opteron/Athlon64, 
 Solaris/Sparc

and Alpha and Irix and HP-UX and AIX as far as I understand.

) but I can't recall seeing a build on Intel with the 64 
 bit extensions.  

As I understand it, this is an Intel `clone' of AMD64, so the only
news would be if there were any problems: in almost all cases the
executable code is identical to that compiled for AMD64 and in the GNU
classification it is also x86_64-unknown-linux-gnu.

I would even expect a Goto BLAS to work, if not as well as on the specific 
Opteron it is tuned for.  (Fast BLASes are an essential part of making the 
most of 64-bit processors on large problems.)

 Michael Seewald wrote:
  Dear mailing-list members,
  
  In the days of cheap RAM and microarray applications feasting on memory,
  64-bit computers become more and more useful - to actually make use of memory
  beyond the magic 4GB border. I would like to report the success of running
  64-bit R on an Intel Xeon EM64T machine under Linux. Just like on an AMD
  Opteron, R v2.0.0 compiles fine (and out of the box) and is happily allocating
  memory until RAM and swap reach their limit.
  
  Hardware:
  - HP xw6200 workstation
  - dual Intel Xeon 3.4GHz with hyper-threading enabled
  - 4GB RAM, 4GB swap
  
  System: either
  - Fedora Core 2 x86_64 bit Linux
  or
  - Red Hat Enterprise Linux Workstation 3.0 x86_64 bit
  
  R:
  - v2.0.0
  
  Really, no problems at all during setup, a big thank you to the R developers
  making this possible!

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

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


[R] tclk, tcltk

2004-10-12 Thread Jean Eid
I have been having problems with these two 'libraries' since I installed
2.0.0.
I have built a package with couple of functions so that I can load it at
startup every time R is booted. The problem is that I have the following
error every time I call the library

Loading required package: tclk
Error: package 'tclk' could not be loaded
In addition: Warning message:
There is no package called 'tclk' in: library(pkg, character.only = TRUE, logical = 
TRUE, lib.loc = lib.loc)


However I can load tcltk library now (thanks to Dirk for helping me with
this). I can load the functions I have in the library and everything works
fine.

I cannot find any information on this except the following thread which
was not resolved.
http://tolstoy.newcastle.edu.au/R/help/04/01/0410.html

Any help or ideas are greatly appreciated.

P.S. what is the difference between tclk and tcltk? and why calling the
installed library is requiring tclk? I just made up a dummy package with a
function

fun-function(x) x^2

just to test and the same thing happens (Loading required package: tclk
...).

This is on a Linux debian unstable with the kernel  2.4.20-bf2.4-xfs

Thank you for all the help.

jean

__
[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] Sweave and xtable

2004-10-12 Thread Doran, Harold
Dear List:

I have some coded embedded within a LaTeX document where I subset a
dataframe and use xtable to place it in my appendix. However, one of the
tables is rather large and seems to extend beyond the page length.

Is there a nice way to use Sweave to continue this table onto the next
page? I could easily break this up in tex into two tables, but I imagine
there is a better way of doing so.

Thanks,

Harold

[[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] tclk, tcltk

2004-10-12 Thread Prof Brian Ripley
What is package `tclk'?  I think you have a typo somewhere in your code.
At a guess you have

Depends: tclk

in a DESCRIPTION file for one of your packages.


On Tue, 12 Oct 2004, Jean Eid wrote:

 I have been having problems with these two 'libraries' since I installed
 2.0.0.
 I have built a package with couple of functions so that I can load it at
 startup every time R is booted. The problem is that I have the following
 error every time I call the library
 
 Loading required package: tclk
 Error: package 'tclk' could not be loaded
 In addition: Warning message:
 There is no package called 'tclk' in: library(pkg, character.only = TRUE, logical = 
 TRUE, lib.loc = lib.loc)
 
 
 However I can load tcltk library now (thanks to Dirk for helping me with
 this). I can load the functions I have in the library and everything works
 fine.
 
 I cannot find any information on this except the following thread which
 was not resolved.
 http://tolstoy.newcastle.edu.au/R/help/04/01/0410.html

It was resolved, and in any case it was about installing 64-bit Tcl/Tk on 
Solaris, something that was (and is) covered in the R Installation manual.

 Any help or ideas are greatly appreciated.
 
 P.S. what is the difference between tclk and tcltk? and why calling the
 installed library is requiring tclk? I just made up a dummy package with a
 function
 
 fun-function(x) x^2
 
 just to test and the same thing happens (Loading required package: tclk
 ...).
 
 This is on a Linux debian unstable with the kernel  2.4.20-bf2.4-xfs

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

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


Re: [R] tclk, tcltk

2004-10-12 Thread Jean Eid
Thanks to Brian. I was looking everywhere except the typo. I guess the
previous build (1.9.1) ignored the dependece error.

Thanks again,

jean

On Tue, 12 Oct 2004, Prof Brian Ripley wrote:

 What is package `tclk'?  I think you have a typo somewhere in your code.
 At a guess you have

 Depends: tclk

 in a DESCRIPTION file for one of your packages.


 On Tue, 12 Oct 2004, Jean Eid wrote:

  I have been having problems with these two 'libraries' since I installed
  2.0.0.
  I have built a package with couple of functions so that I can load it at
  startup every time R is booted. The problem is that I have the following
  error every time I call the library
 
  Loading required package: tclk
  Error: package 'tclk' could not be loaded
  In addition: Warning message:
  There is no package called 'tclk' in: library(pkg, character.only = TRUE, logical 
  = TRUE, lib.loc = lib.loc)
 
 
  However I can load tcltk library now (thanks to Dirk for helping me with
  this). I can load the functions I have in the library and everything works
  fine.
 
  I cannot find any information on this except the following thread which
  was not resolved.
  http://tolstoy.newcastle.edu.au/R/help/04/01/0410.html

 It was resolved, and in any case it was about installing 64-bit Tcl/Tk on
 Solaris, something that was (and is) covered in the R Installation manual.

  Any help or ideas are greatly appreciated.
 
  P.S. what is the difference between tclk and tcltk? and why calling the
  installed library is requiring tclk? I just made up a dummy package with a
  function
 
  fun-function(x) x^2
 
  just to test and the same thing happens (Loading required package: tclk
  ...).
 
  This is on a Linux debian unstable with the kernel  2.4.20-bf2.4-xfs

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



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


Re: [R] Sweave and xtable

2004-10-12 Thread Frank E Harrell Jr
Doran, Harold wrote:
Dear List:
I have some coded embedded within a LaTeX document where I subset a
dataframe and use xtable to place it in my appendix. However, one of the
tables is rather large and seems to extend beyond the page length.
Is there a nice way to use Sweave to continue this table onto the next
page? I could easily break this up in tex into two tables, but I imagine
there is a better way of doing so.
Thanks,
Harold
If xtable will not do that, you can use latex( ) in the Hmisc package 
with its longtable=TRUE argument.

--
Frank E Harrell Jr   Professor and Chair   School of Medicine
 Department of Biostatistics   Vanderbilt University
__
[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 hclust - canberra dist + median linkage

2004-10-12 Thread Martin Maechler
 Dan == Dan Bolser [EMAIL PROTECTED]
 on Mon, 11 Oct 2004 16:21:53 +0100 (BST) writes:

Dan Gives strange results.

Dan I get 'weird' dendrograms with canberra / binary distance metric and
Dan median / centroid cluster methods.

it doesn't depend on the metric: 
Both 'median' and 'centroid' methods are known to *not*
guarantee ``monotone distance measures'', or equivalently to
possibly lead to dendrograms with so called ``inversions''.
We should add this to help page for hclust().

Probably for this reason, agnes() from the cluster package
doesn't have these two methods [explicitly] -- though it now
allows general parameter Lance-William formula methods which can
also lead to inversions.

Dan Is this just my data?

evidently not.  Though the problem does not appear for all data
sets...

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


[R] A question in R

2004-10-12 Thread Yayira har
I started to learn the R language, but I didn't suceed to use an external file.
 
Let say that I have an excel file called test1.xls in the directory 
C:/program files/R/rw2000/external_files that looks like that:
 
name  mark
  yair  80
 yosi  70  ...
 
In the appropriate directory I wrote this:
 
x-read.delim(test1.xls)
 
or this:
 
x-read.csv(test1.xls)
 
but I got:
 
[1] X..
0 rows (or 0-length row.names)
 
way cannot I read the file? what is the appropriate command for reading an excel file?

I looked at the site of R-project but I didn't find a suitable comand.

__



[[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] A question in R

2004-10-12 Thread Kevin Bartz
Yayira har wrote:
I started to learn the R language, but I didn't suceed to use an external file.
 
Let say that I have an excel file called test1.xls in the directory 
C:/program files/R/rw2000/external_files that looks like that:
 
name  mark
  yair  80
 yosi  70  ...
 
In the appropriate directory I wrote this:
 
x-read.delim(test1.xls)
 
or this:
 
x-read.csv(test1.xls)
 
but I got:
 
[1] X..
0 rows (or 0-length row.names)
 
way cannot I read the file? what is the appropriate command for reading an excel file?

I looked at the site of R-project but I didn't find a suitable comand.
__

[[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
Hi Yayiya,
R looks less than fondly on Excel files. The easiest solution for you 
will be to export your Excel file to a tab-delimited text format (Save 
- (.txt) Tab-delimited Text), and then use read.delim as you did. Does 
that make sense?

Kevin
__
[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] A question in R

2004-10-12 Thread Sundar Dorai-Raj

Yayira har wrote:
I started to learn the R language, but I didn't suceed to use an external file.
 
Let say that I have an excel file called test1.xls in the directory 
C:/program files/R/rw2000/external_files that looks like that:
 
name  mark
  yair  80
 yosi  70  ...
 
In the appropriate directory I wrote this:
 
x-read.delim(test1.xls)
 
or this:
 
x-read.csv(test1.xls)
 
but I got:
 
[1] X..
0 rows (or 0-length row.names)
 
way cannot I read the file? what is the appropriate command for reading an excel file?

I looked at the site of R-project but I didn't find a suitable comand.
Is the file an Excel file (probably from the extension) or can you open 
the file in notepad and read the text? If not, you need to save the file 
as csv or txt from within Excel and import the file into R as you tried 
above. You may also want to read the R Data Import/Export manual which 
is available from the r-project.org website.

--sundar
__
[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] A question in R

2004-10-12 Thread Prof Brian Ripley
Take a look at the `R Data Import/Export' manual.

Hint: if test1.xls is an Excel worksheet, it is not a tab-delimited file.

On Tue, 12 Oct 2004, Yayira har wrote:

 I started to learn the R language, but I didn't suceed to use an external file.
  
 Let say that I have an excel file called test1.xls in the directory 
 C:/program files/R/rw2000/external_files that looks like that:
  
 name  mark
   yair  80
  yosi  70  ...
  
 In the appropriate directory I wrote this:
  
 x-read.delim(test1.xls)
  
 or this:
  
 x-read.csv(test1.xls)
  
 but I got:
  
 [1] X..
 0 rows (or 0-length row.names)
  
 way cannot I read the file? what is the appropriate command for reading an excel 
 file?
 
 I looked at the site of R-project but I didn't find a suitable comand.
 
 __
 
 
 
   [[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
 
 

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

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


Re: [R] A question in R

2004-10-12 Thread Yves Magliulo
hi,

check R-data import/export document at this link

cran.r-project.org/doc/manuals/R-data.pdf

let me give you an advice for further questions : it's easiest to find
answer to your question searching directly with google
 
-- 
--
Yves Magliulo [EMAIL PROTECTED]
RD Engineer, CLIMPACT

Tel.   : +33 (0) 1 44 27 34 31
Fax.   : +33 (0) 1 44 27 49 96 
Universite Pierre et Marie Curie
Boite 101 - Tour 45 - 5eme etage - Couloir 45/46
4 place Jussieu, 75252 Paris CEDEX 05, France
Le mar 12/10/2004 à 17:56, Kevin Bartz a écrit :
 Yayira har wrote:
  I started to learn the R language, but I didn't suceed to use an external file.
   
  Let say that I have an excel file called test1.xls in the directory 
  C:/program files/R/rw2000/external_files that looks like that:
   
  name  mark
yair  80
   yosi  70  ...
   
  In the appropriate directory I wrote this:
   
  x-read.delim(test1.xls)
   
  or this:
   
  x-read.csv(test1.xls)
   
  but I got:
   
  [1] X..
  0 rows (or 0-length row.names)
   
  way cannot I read the file? what is the appropriate command for reading an excel 
  file?
  
  I looked at the site of R-project but I didn't find a suitable comand.
  
  __
  
  
  
  [[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
  
 
 Hi Yayiya,
 
 R looks less than fondly on Excel files. The easiest solution for you 
 will be to export your Excel file to a tab-delimited text format (Save 
 - (.txt) Tab-delimited Text), and then use read.delim as you did. Does 
 that make sense?
 
 Kevin
 
 __
 [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] need help on GAM

2004-10-12 Thread Liu Song

Get some question about the function gam.
Suppose I have a semiparametric model,
Y~x1+x2+s(z1).
Using gam, how could I get the estimates for the parametric part and 
nonparametric part respectively?

And another question: we could find the coefficients for both 
parametric term and nonparametric term, what do these coefficients
for the nonparametric term stand for, the coefficients for the base 
functions?
 
Thank you!

Song

Song Liu
School of Statistics
313 FordH
224 Church St. SE
Minneapolis,MN 55455

__
[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] need help on GAM

2004-10-12 Thread Prof Brian Ripley
Please read the posting guide and do give sufficient details for your 
questions to be answered.

On Tue, 12 Oct 2004, Liu Song wrote:

 Get some question about the function gam.

There are at least two functions gam() available for R, but none in
standard R.  Which package are you talking about?  This is covered in the
R FAQ, BTW.

 Suppose I have a semiparametric model,
 Y~x1+x2+s(z1).
 Using gam, how could I get the estimates for the parametric part and 
 nonparametric part respectively?

What do you mean by those terms?  In the gam() in package gam, s(z1) is 
split into a linear and non-linear part, but all the terms *are* 
parametric (a smoothing spline is a parametric function of its argument).

 And another question: we could find the coefficients for both 
 parametric term and nonparametric term, what do these coefficients
 for the nonparametric term stand for, the coefficients for the base 
 functions?

By definition, non-parametric terms do not have parameters aka 
coefficients.

I suggest you ask for local advice on the statistical background to your 
questions, which you do need to understand before getting to using them in 
R.

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

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


Re: [R] need help on GAM

2004-10-12 Thread Gabor Grothendieck
Prof Brian Ripley ripley at stats.ox.ac.uk writes:
:  And another question: we could find the coefficients for both 
:  parametric term and nonparametric term, what do these coefficients
:  for the nonparametric term stand for, the coefficients for the base 
:  functions?
: 
: By definition, non-parametric terms do not have parameters aka 
: coefficients.

This is definitely a candidate for the fortunes package.

__
[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] locfit confidence intervals

2004-10-12 Thread Suresh Krishna
hi,
after
m=locfit(y~x,..., family=binomial)
plot(m,band=local) gives me a plot of locfit's result with a confidence 
interval around it. i would like to get the actual values that are being 
used to plot the lines in this figure.

i tried using predict, but the standard error it returns when i supply the 
se=T argument, appears not to be the same as the CI produced by plot (it is 
much larger...in my one case).  i have tried all the different type=.. 
options, but none of them matches the CI produced by plot.

i only recently started using both R and local regression methods and am 
still feeling my way around, so even though I have gone through the FAQs 
and the online manuals and the archives of this group and the Loader book, 
I have been unable to make much progress. any help would be very appreciated !!

thanks, suresh
__
[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] need help on GAM

2004-10-12 Thread Simon Wood

 Get some question about the function gam.
 Suppose I have a semiparametric model,
 Y~x1+x2+s(z1).
 Using gam, how could I get the estimates for the parametric part and 
 nonparametric part respectively?
For a gam object (called, b,say) fitted using the mgcv `gam' then coef(b) 
will extract the coefficients for both the strictly parametric and smooth 
components of the model, labelled appropriately. summary(b) is also 
helpful. Often it is most useful to extract estimates of the smooths 
evaluated at a specified set of covariate values by using the gam `predict' 
method with type=terms. 
 
 And another question: we could find the coefficients for both 
 parametric term and nonparametric term, what do these coefficients
 for the nonparametric term stand for, the coefficients for the base 
 functions?
For mgcv gam objects the coefficients of the smooths are indeed the 
coefficients of the basis functions of the smooths.

best,
Simon

_
 Simon Wood [EMAIL PROTECTED]www.stats.gla.ac.uk/~simon/
  Department of Statistics, University of Glasgow, Glasgow, G12 8QQ
   Direct telephone: (0)141 330 4530  Fax: (0)141 330 4814

__
[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] constrained optimization using nlm/optim?

2004-10-12 Thread Jeff D. Hamann
I'm looking for an example of a simple R script that impliments a
contrained nonlinear function using nlm or optim. I'm not exactly sure how
to impliment the constraints within the objective function that is passed
to nlm/optim.

obj.func - function( p ) {

   x(p) - unconstrained obj function value

   if( constraint1  something ) {
  obj.func - x(p)
   } else {
  obj.func - some super huge number
  }

}

p - c(0.1,2.4, 5)

nlm( obj.func, p, and a bunch of other arguments )

Any suggestions would be very helpful...

Jeff.



-- 
Jeff D. Hamann
Forest Informatics, Inc.
PO Box 1421
Corvallis, Oregon 97339-1421
phone 541-754-1428
fax 541-752-0288
[EMAIL PROTECTED]
http://www.forestinformatics.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


Re: [R] locfit confidence intervals

2004-10-12 Thread Prof Brian Ripley
Why not use predict(se=TRUE, band=local)?  That's what plot.locfit does,
via preplot.locfit.

I'm afraid the only real way to answer questions like this is to read the 
sources.

On Tue, 12 Oct 2004, Suresh Krishna wrote:

 
 hi,
 
 after
 
 m=locfit(y~x,..., family=binomial)
 plot(m,band=local) gives me a plot of locfit's result with a confidence 
 interval around it. i would like to get the actual values that are being 
 used to plot the lines in this figure.
 
 i tried using predict, but the standard error it returns when i supply the 
 se=T argument, appears not to be the same as the CI produced by plot (it is 
 much larger...in my one case).  i have tried all the different type=.. 
 options, but none of them matches the CI produced by plot.
 
 i only recently started using both R and local regression methods and am 
 still feeling my way around, so even though I have gone through the FAQs 
 and the online manuals and the archives of this group and the Loader book, 
 I have been unable to make much progress. any help would be very appreciated !!
 
 thanks, suresh
 
 __
 [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
 
 

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

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


[R] problem with lapack.so under Debian Sid

2004-10-12 Thread Christian Fiebach
Dear list,
I am sorry to bother you with this.
I just upgraded yesterday to R 2.0.0 (using apt-get under Debian Sid), and
now have problems running e.g., summary(lm(...))
the lm is calculated, but the summary statement gives me the following 
error:

Error in La.chol2inv(x, size) : lapack routines cannot be loaded
In addition: Warning message:
unable to load shared library /usr/lob/R/modules/lapack.so:
  /usr/lib/Pentium4_SSE2_512KB/liblapack.so.3: undefined symbol: ieeeck_
I searched through the archives, but unfortunately I am just not 
LINUX-knowledgeable
enough to understand the discussions concerning the algebra libraries.

Following an older mail to this list, I did
ldd /usr/lib/R/modules/lapack.so
everything looks fine except probably for the first line, which reads
libR.so = not found
I would appreciate any hints on how to fix this problem!
Thanks a lot.
Christian
--
Christian Fiebach, PhD
Department of Psychology 
Helen Wills Institute of Neuroscience
132 Barker Hall, MC# 3190
University of California, Berkeley
CA 94720-3190 Berkeley, USA
fon:  510-642-2839
fax:  510-642-3192
web:  http://fiebach.org
email: mailto:[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] graph question

2004-10-12 Thread Dean Sonneborn
I would like to produce a graph which plots a log scale variable on the 
y-axis but have the tick marks on the y-axis  be the non log transformed 
values that are round like .5, 1, 2, 3, 4 etc. Has anyone done something 
like this in the past? How did you implement it in the code?

Thanks,
Dean
__
[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] Course***R/S-plus Fundamentals and Programming Techniques In New York and Chicago

2004-10-12 Thread elvis
XLSolutions Corporation (www.xlsolutions-corp.com) is proud to 
announce  2-day R/S-plus Fundamentals and Programming 
Techniques.

New York, NY --- November 18th-19th
Chicago, IL -- November 11th-12th
 


Reserve your seat now at the early bird rates! Payment due AFTER 
the class.


Course Description:
This two-day beginner to intermediate R/S-plus course focuses on a 
broad spectrum of topics, from reading raw data to a comparison of R 
and S. We will learn the essentials of data manipulation, graphical 
visualization and R/S-plus programming. We will explore statistical 
data analysis tools,including graphics with data sets. How to enhance 
your plots. We will perform basic statistics and fit linear regression
models. Participants are encouraged to bring data for interactive 
sessions


With the following outline:
- An Overview of R and S
- Data Manipulation and Graphics
- Using Lattice Graphics
- A Comparison of R and S-Plus
- How can R Complement SAS?
- Writing Functions
- Avoiding Loops
- Vectorization
- Statistical Modeling
- Project Management
- Techniques for Effective use of R and S
- Enhancing Plots
- Using High-level Plotting Functions
- Building and Distributing Packages (libraries)


Email us for group discounts.
Email Sue Turner: [EMAIL PROTECTED]
Phone: 206-686-1578
Visit us: www.xlsolutions-corp.com/training.htm
Please let us know if you and your colleagues are interested in this 
classto take advantage of group discount. Register now to secure your 
seat! Interested in R/Splus Advanced course? email us.


Cheers,
Elvis Miller, PhD
Manager Training.
XLSolutions Corporation
206 686 1578
www.xlsolutions-corp.com
[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] constrained optimization using nlm/optim?

2004-10-12 Thread Patrick Burns
You want the penalty for the constraint to depend on how
much the constraint is broken -- unlike your sample code.
Page 336 of S Poetry has an example.
Patrick Burns
Burns Statistics
[EMAIL PROTECTED]
+44 (0)20 8525 0696
http://www.burns-stat.com
(home of S Poetry and A Guide for the Unwilling S User)
Jeff D. Hamann wrote:
I'm looking for an example of a simple R script that impliments a
contrained nonlinear function using nlm or optim. I'm not exactly sure how
to impliment the constraints within the objective function that is passed
to nlm/optim.
obj.func - function( p ) {
  x(p) - unconstrained obj function value
  if( constraint1  something ) {
 obj.func - x(p)
  } else {
 obj.func - some super huge number
 }
}
p - c(0.1,2.4, 5)
nlm( obj.func, p, and a bunch of other arguments )
Any suggestions would be very helpful...
Jeff.

 

__
[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] problem with lapack.so under Debian Sid

2004-10-12 Thread Prof Brian Ripley
On Tue, 12 Oct 2004, Christian Fiebach wrote:

 Dear list,
 
 I am sorry to bother you with this.
 
 I just upgraded yesterday to R 2.0.0 (using apt-get under Debian Sid), and
 now have problems running e.g., summary(lm(...))
 
 the lm is calculated, but the summary statement gives me the following 
 error:
 
 Error in La.chol2inv(x, size) : lapack routines cannot be loaded
 In addition: Warning message:
 unable to load shared library /usr/lob/R/modules/lapack.so:
/usr/lib/Pentium4_SSE2_512KB/liblapack.so.3: undefined symbol: ieeeck_
 
 I searched through the archives, but unfortunately I am just not 
 LINUX-knowledgeable
 enough to understand the discussions concerning the algebra libraries.
 
 Following an older mail to this list, I did
 ldd /usr/lib/R/modules/lapack.so
 everything looks fine except probably for the first line, which reads
 libR.so = not found

Use R CMD ldd /usr/lib/R/modules/lapack.so to get an accurate picture.

I think you need to ask this on a Debian list.  The R developers do not 
recommend the use of an external Lapack library (and the Debian ones have 
had `patches' that were incorrect before now).  (See the discussion in the 
R-admin manual.)  In this case I guess that it has not been linked against 
the right set of external libraries for your particular machine.

 I would appreciate any hints on how to fix this problem!

Should work if you build R from the sources with the default options.

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

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


Re: [R] constrained optimization using nlm/optim?

2004-10-12 Thread Roger D. Peng
My guess is that approach will not work particularly well with nlm(), 
which expects the objective function to be smooth.  You might have 
better luck using the Nelder-Mead method in optim().

-roger
Jeff D. Hamann wrote:
I'm looking for an example of a simple R script that impliments a
contrained nonlinear function using nlm or optim. I'm not exactly sure how
to impliment the constraints within the objective function that is passed
to nlm/optim.
obj.func - function( p ) {
   x(p) - unconstrained obj function value
   if( constraint1  something ) {
  obj.func - x(p)
   } else {
  obj.func - some super huge number
  }
}
p - c(0.1,2.4, 5)
nlm( obj.func, p, and a bunch of other arguments )
Any suggestions would be very helpful...
Jeff.

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

2004-10-12 Thread Prof Brian Ripley
On Tue, 12 Oct 2004, Dean Sonneborn wrote:

 I would like to produce a graph which plots a log scale variable on the 
 y-axis but have the tick marks on the y-axis  be the non log transformed 
 values that are round like .5, 1, 2, 3, 4 etc. Has anyone done something 
 like this in the past? How did you implement it in the code?

plot(c(0.5, 5), 1:2, log=x, xaxt=n)
axis(1, at=c(0.5, 1:4))

Take a look at `An Introduction to R' and ?axis.

BTW, please try to use a more precise subject line. Something like
`Adding a custom axis to log-scale plots'?

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

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


Re: [R] 64-bit R on Intel Xeon EM64T running fine

2004-10-12 Thread Murad Nayal


Roger D. Peng wrote:
 
 This is good news.  As far as I know R has built for quite some time
 now on a number of 64 bit platforms (Linux on AMD Opteron/Athlon64,
 Solaris/Sparc) 


Ill add SGI/IRIX 64 bit platform to the list. I've been running a 64
bit-compiled R on an SGI octane 2 for over a year now without a problem.
R sessions often allocate around 8 GB of memory.


but I can't recall seeing a build on Intel with the 64
 bit extensions.  By the way, did you happen to run `make check' just
 for kicks?
 
 -roger
 
 Michael Seewald wrote:
  Dear mailing-list members,
 
  In the days of cheap RAM and microarray applications feasting on memory,
  64-bit computers become more and more useful - to actually make use of memory
  beyond the magic 4GB border. I would like to report the success of running
  64-bit R on an Intel Xeon EM64T machine under Linux. Just like on an AMD
  Opteron, R v2.0.0 compiles fine (and out of the box) and is happily allocating
  memory until RAM and swap reach their limit.
 
  Hardware:
  - HP xw6200 workstation
  - dual Intel Xeon 3.4GHz with hyper-threading enabled
  - 4GB RAM, 4GB swap
 
  System: either
  - Fedora Core 2 x86_64 bit Linux
  or
  - Red Hat Enterprise Linux Workstation 3.0 x86_64 bit
 
  R:
  - v2.0.0
 
  Really, no problems at all during setup, a big thank you to the R developers
  making this possible!
 
  Best wishes,
  Michael
 
  __
  [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

-- 
Murad Nayal M.D. Ph.D.
Department of Biochemistry and Molecular Biophysics
College of Physicians and Surgeons of Columbia University
630 West 168th Street. New York, NY 10032
Tel: 212-305-6884   Fax: 212-305-6926

__
[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] bandwidths for bivariate density estimation

2004-10-12 Thread Emili Tortosa-Ausina
Hi,

I am using the KernSmooth package to estimate nonparametrically bivariate 
density functions. However, it seems that the bandwidths (one for each 
co-ordinate direction) have to be selected manually. This does not apply 
for the univariate case, for which dpik (included in KernSmooth) uses 
up-to-date plug-in rules.

Does anyone know about a package, or function, which estimates bandwidths 
for the BIVARIATE case, following, for instance, the plug-in methods 
suggested by Wand and Jones?

I will appreciate your help a lot.

Thanks,

Emili

References:

Wand, M. P. and Jones, M. C. (1995). Kernel Smoothing. Chapman and Hall, 
London.

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


[R] bandwidths for bivariate density estimation

2004-10-12 Thread Emili Tortosa-Ausina
Hi,

I am using the KernSmooth package to estimate nonparametrically bivariate 
density functions. However, it seems that the bandwidths (one for each 
co-ordinate direction) have to be selected manually. This does not apply 
for the univariate case, for which dpik (included in KernSmooth) uses 
up-to-date plug-in rules.

Does anyone know about a package, or function, which estimates bandwidths 
for the BIVARIATE case, following, for instance, the plug-in methods 
suggested by Wand and Jones?

I will appreciate your help a lot.

Thanks,

Emili

References:

Wand, M. P. and Jones, M. C. (1995). Kernel Smoothing. Chapman and Hall, 
London.

[[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] plot hclust - canberra dist + median linkage

2004-10-12 Thread Dan Bolser
On Tue, 12 Oct 2004, Martin Maechler wrote:

 Dan == Dan Bolser [EMAIL PROTECTED]
 on Mon, 11 Oct 2004 16:21:53 +0100 (BST) writes:

Dan Gives strange results.

Dan I get 'weird' dendrograms with canberra / binary distance metric and
Dan median / centroid cluster methods.

it doesn't depend on the metric: 
Both 'median' and 'centroid' methods are known to *not*
guarantee ``monotone distance measures'', or equivalently to
possibly lead to dendrograms with so called ``inversions''.
We should add this to help page for hclust().

Cool, I could do with more to read about these methods. It might be worth
noteing that no bootstrap exists for the method (implemented in R that
is).

How can I quickly run a test on a sub-set of x? (i.e. quick bootstrap by
hand)?

Cheers,
Dan.

Probably for this reason, agnes() from the cluster package
doesn't have these two methods [explicitly] -- though it now
allows general parameter Lance-William formula methods which can
also lead to inversions.

Dan Is this just my data?

evidently not.  Though the problem does not appear for all data
sets...

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] problem with lapack.so under Debian Sid

2004-10-12 Thread Dirk Eddelbuettel
On Tue, Oct 12, 2004 at 10:46:09AM -0700, Christian Fiebach wrote:
 Dear list,
 
 I am sorry to bother you with this.
 
 I just upgraded yesterday to R 2.0.0 (using apt-get under Debian Sid), and
 now have problems running e.g., summary(lm(...))
 
 the lm is calculated, but the summary statement gives me the following 
 error:
 
 Error in La.chol2inv(x, size) : lapack routines cannot be loaded
 In addition: Warning message:
 unable to load shared library /usr/lob/R/modules/lapack.so:
   /usr/lib/Pentium4_SSE2_512KB/liblapack.so.3: undefined symbol: ieeeck_

Is that the liblapack, i.e. do you actually have a Pentium IV ?  It could be
that this isn;t R specific, but related to the choice Debian gives with
respect to lapack and blas libraries.  You could try to downgrade to the
refblas3 and lapack3 packages.  

We should probably continue this off-list.

Dirk


 I searched through the archives, but unfortunately I am just not 
 LINUX-knowledgeable
 enough to understand the discussions concerning the algebra libraries.
 
 Following an older mail to this list, I did
 ldd /usr/lib/R/modules/lapack.so
 everything looks fine except probably for the first line, which reads
 libR.so = not found
 
 I would appreciate any hints on how to fix this problem!
 
 Thanks a lot.
 
 Christian
 
 
 -- 
 Christian Fiebach, PhD
 
 Department of Psychology 
 Helen Wills Institute of Neuroscience
 132 Barker Hall, MC# 3190
 University of California, Berkeley
 CA 94720-3190 Berkeley, USA
 fon:  510-642-2839
 fax:  510-642-3192
 web:  http://fiebach.org
 email: mailto:[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

-- 
Those are my principles, and if you don't like them... well, I have others.
-- Groucho Marx

__
[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] lm#contrasts#one level in factor: bug or feature

2004-10-12 Thread Thomas Lumley
On Tue, 12 Oct 2004, Ritter, Christian C MCIL-CTANL/S wrote:
(R.1.9.1; win2000)
Since it's about the tenth time I had to write an if around this to catch the error 
...
Let's look at the line
myfit-lm(res~groupvar,data=Data)
Here res is of numeric type and groupvar is a factor. On first sight, it 
would be logical that if groupvar had only one (single) level we would 
get:

	Error in contrasts-(`*tmp*`, value = contr.treatment) : 
contrasts can be applied only to factors with 2 or more levels

But then again, it's also inconsistent: Normally redundant variables on 
the right of the ~ (variables which are constant or linearly dependent 
on previous variables) don't lead to Error. They just get a NA as a 
coefficient estimate. A factor with a single level is of this type, it 
is just a constant.  Obviously (to me) lm (or model.matrix.default) 
should not try to calculate contrasts on it and it's coefficient should 
be NA. Shouldn't it?
No, a factor with k levels isn't just a set of k linearly dependent 
variables (otherwise a factor would always give an NA coefficient for one 
level).  A factor specifies a set of contrasts (usually k-1 of them) that 
go into the model matrix.  In that sense a factor with 1 level should 
specify zero columns of the model matrix, rather than giving an error.

Why is this not unimportant? Imagine you make a model of the above type 
for a data set with more than one level in groupvar. Then you select 
subsets and refit. It shouldn't die with error if you select a subset 
with only one level of groupvar.

Possibly, but your results are likely to be pretty meaningless.  If the 
subset does not have *all* the levels of the factor then the contrasts 
will change and the variable will be coded differently, possibly giving 
coefficients with different meanings.

In the case of contr.treatment, for example, if the lowest level of the 
factor is missing then all the other levels are recoded as contrasts to 
the next lowest level.

-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] covariate selection?

2004-10-12 Thread Ian Fiske
Hello,
I am hoping someone can help me with the following multivariate issue:  
I have a model consisting of about 50 covariates.  I would like to 
reduce this to about 5 covariate for the reduced model by combining 
cofactors that are strongly correlated.  Is there a package or function 
that would help me with this in R?  I appreciate any suggestions.

Thanks,
Ian
__
[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] Why I can't retrieve GO identifier correctly?

2004-10-12 Thread szhan
Hello, R experts,
I tried to retrieve all biological process GO terms at level 3 starting
biological process as level 1 using the code as bellows:

1 library(GO)
2 library(GOstats)
3 level2-getGOChildren(GO:0008150)$GO:0008150$Children
4 for ( i in 1:length(level2)) {
5level3 - getGOChildren(level2[i])$level2[i]$Children
6for ( j in 1:length(level3)){
7   level3term - getGOTerm(as.character(level3[j]))$BP$level3[j]
8   level3term
9}
10 }
What is the difference between line 3 and line5? In the line 3 I retrieved the
GO identifiers at level 2 successfullly but in the line 5 I got nothing. How to
correct the line 5 to retrieve the GO terms at level 3 correctly?
Thank you in advance!
Josh

__
[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] covariate selection?

2004-10-12 Thread Martínez Ovando Juan Carlos
Hello Ian,

?princomp

If your covariates are scalars, and the following documents:

http://www.jstatsoft.org/v07/i01/drdoc.pdf

http://www.bioconductor.org/workshops/Milan/PDF/Lab12.pdf


Best wishes. 

Saludos,
 
Juan Carlos Martínez Ovando
Banco de México
Av. 5 de Mayo No. 18
Piso 5 Sección D
Col. Centro
06059  México, D. F.
Tel. +52 55 52.37.20.00 ext. 3594
Fax. +52 55 52.37.27.03
e-mail: [EMAIL PROTECTED]
 

-Mensaje original-
De: Ian Fiske [mailto:[EMAIL PROTECTED] 
Enviado el: Martes, 12 de Octubre de 2004 04:08 PM
Para: [EMAIL PROTECTED]
Asunto: [R] covariate selection?

Hello,

I am hoping someone can help me with the following multivariate issue:  
I have a model consisting of about 50 covariates.  I would like to 
reduce this to about 5 covariate for the reduced model by combining 
cofactors that are strongly correlated.  Is there a package or function 
that would help me with this in R?  I appreciate any suggestions.

Thanks,
Ian

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

2004-10-12 Thread Kevin Wang
Hi,

On Tue, 12 Oct 2004, Kevin Bartz wrote:

 R looks less than fondly on Excel files. The easiest solution for you
 will be to export your Excel file to a tab-delimited text format (Save
 - (.txt) Tab-delimited Text), and then use read.delim as you did. Does
 that make sense?

The alternative (tricky but more convinient in the long run) is to use the
read.xls() function from gregmisc bundle.

Cheers,

Kevin


Ko-Kang Kevin Wang
PhD Student
Centre for Mathematics and its Applications
Building 27, Room 1004
Mathematical Sciences Institute (MSI)
Australian National University
Canberra, ACT 0200
Australia

Homepage: http://wwwmaths.anu.edu.au/~wangk/
Ph (W): +61-2-6125-2431
Ph (H): +61-2-6125-7407
Ph (M): +61-40-451-8301

__
[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] Why I can't retrieve GO identifier correctly?

2004-10-12 Thread Peter Dalgaard
[EMAIL PROTECTED] writes:

 Hello, R experts,
 I tried to retrieve all biological process GO terms at level 3 starting
 biological process as level 1 using the code as bellows:
 
 1 library(GO)
 2 library(GOstats)
 3 level2-getGOChildren(GO:0008150)$GO:0008150$Children
 4 for ( i in 1:length(level2)) {
 5level3 - getGOChildren(level2[i])$level2[i]$Children
 6for ( j in 1:length(level3)){
 7   level3term - getGOTerm(as.character(level3[j]))$BP$level3[j]
 8   level3term
 9}
 10 }
 What is the difference between line 3 and line5? In the line 3 I retrieved the
 GO identifiers at level 2 successfullly but in the line 5 I got nothing. How to
 correct the line 5 to retrieve the GO terms at level 3 correctly?
 Thank you in advance!
 Josh

I think you'll have better luck with that question if you take it to
the Bioconductor list.


-- 
   O__   Peter Dalgaard Blegdamsvej 3  
  c/ /'_ --- Dept. of Biostatistics 2200 Cph. N   
 (*) \(*) -- University of Copenhagen   Denmark  Ph: (+45) 35327918
~~ - ([EMAIL PROTECTED]) FAX: (+45) 35327907

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


Re: [R] covariate selection?

2004-10-12 Thread Ian Fiske
Thanks Juan.  I thought that was what I was looking for, but really, I 
want to know which of the original covariates could best be used to take 
advantage of their colinearity without creating new variables.  I think 
PCA creates new variables.  SAS and SPSS can do what I'm talking about, 
but I would like to use R for this.

Thanks,
Ian

Martínez Ovando Juan Carlos wrote:
Hello Ian,
?princomp
If your covariates are scalars, and the following documents:
http://www.jstatsoft.org/v07/i01/drdoc.pdf
http://www.bioconductor.org/workshops/Milan/PDF/Lab12.pdf
Best wishes. 

Saludos,
Juan Carlos Martínez Ovando
Banco de México
Av. 5 de Mayo No. 18
Piso 5 Sección D
Col. Centro
06059  México, D. F.
Tel. +52 55 52.37.20.00 ext. 3594
Fax. +52 55 52.37.27.03
e-mail: [EMAIL PROTECTED]
-Mensaje original-
De: Ian Fiske [mailto:[EMAIL PROTECTED] 
Enviado el: Martes, 12 de Octubre de 2004 04:08 PM
Para: [EMAIL PROTECTED]
Asunto: [R] covariate selection?

Hello,
I am hoping someone can help me with the following multivariate issue:  
I have a model consisting of about 50 covariates.  I would like to 
reduce this to about 5 covariate for the reduced model by combining 
cofactors that are strongly correlated.  Is there a package or function 
that would help me with this in R?  I appreciate any suggestions.

Thanks,
Ian
__
[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] problem with lapack.so under Debian Sid

2004-10-12 Thread Douglas Bates
On Tue, 12 Oct 2004, Christian Fiebach wrote:
 

Dear list,
I am sorry to bother you with this.
I just upgraded yesterday to R 2.0.0 (using apt-get under Debian Sid), and
now have problems running e.g., summary(lm(...))
the lm is calculated, but the summary statement gives me the following 
error:

Error in La.chol2inv(x, size) : lapack routines cannot be loaded
In addition: Warning message:
unable to load shared library /usr/lob/R/modules/lapack.so:
  /usr/lib/Pentium4_SSE2_512KB/liblapack.so.3: undefined symbol: ieeeck_
I searched through the archives, but unfortunately I am just not 
LINUX-knowledgeable
enough to understand the discussions concerning the algebra libraries.

Following an older mail to this list, I did
ldd /usr/lib/R/modules/lapack.so
everything looks fine except probably for the first line, which reads
libR.so = not found
   

So does that mean that you have one of the Debian packages atlas3-base 
or atlas3-3dnow or atlas3-sse or atlas3-sse2 or lapack3 installed?  You 
should have had at least one of those installed to be able to install 
the r-base-core Debian package.

In the output from ldd /usr/lib/R/modules/lapack.so, does liblapack.so.3 
get resolved to /usr/lib/liblapack.so.3 and, if so, what is that file?  
It is probably a link to /usr/lib/liblapack-3.so which, in turn, is a 
link to /etc/alternatives/liblapack-3.so.  Check that the file linked as 
/etc/alternatives/liblapack-3.so actually exists.

__
[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] covariate selection?

2004-10-12 Thread Spencer Graves
 Have you considered stepwise regression, e.g., step or stepAIC 
in library(MASS)?  The documentation for both contain examples. 

 hope this helps. 
 spencer graves

Ian Fiske wrote:
Hello,
I am hoping someone can help me with the following multivariate 
issue:  I have a model consisting of about 50 covariates.  I would 
like to reduce this to about 5 covariate for the reduced model by 
combining cofactors that are strongly correlated.  Is there a package 
or function that would help me with this in R?  I appreciate any 
suggestions.

Thanks,
Ian
__
[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

--
Spencer Graves, PhD, Senior Development Engineer
O:  (408)938-4420;  mobile:  (408)655-4567
__
[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] covariate selection?

2004-10-12 Thread Martínez Ovando Juan Carlos
Hello Ian,

Sorry. I don't really understand your problem, which is of model selection. That's 
right? 

You could use some criteria based in likelihood. For instante Akaike (AIC) or Schwarz 
criteria (BIC), see: 

?AIC

?mle.aic

(The best model is determined minimizing AIC or BIC).

I hope this help you.

Greetings,
 
Juan Carlos 

-Mensaje original-
De: Ian Fiske [mailto:[EMAIL PROTECTED] 
Enviado el: Martes, 12 de Octubre de 2004 05:17 PM
Para: Martínez Ovando Juan Carlos
CC: [EMAIL PROTECTED]
Asunto: Re: [R] covariate selection?

Thanks Juan.  I thought that was what I was looking for, but really, I 
want to know which of the original covariates could best be used to take 
advantage of their colinearity without creating new variables.  I think 
PCA creates new variables.  SAS and SPSS can do what I'm talking about, 
but I would like to use R for this.

Thanks,
Ian



Martínez Ovando Juan Carlos wrote:

Hello Ian,

?princomp

If your covariates are scalars, and the following documents:

http://www.jstatsoft.org/v07/i01/drdoc.pdf

http://www.bioconductor.org/workshops/Milan/PDF/Lab12.pdf


Best wishes. 

Saludos,
 
Juan Carlos Martínez Ovando
Banco de México
Av. 5 de Mayo No. 18
Piso 5 Sección D
Col. Centro
06059  México, D. F.
Tel. +52 55 52.37.20.00 ext. 3594
Fax. +52 55 52.37.27.03
e-mail: [EMAIL PROTECTED]
 

-Mensaje original-
De: Ian Fiske [mailto:[EMAIL PROTECTED] 
Enviado el: Martes, 12 de Octubre de 2004 04:08 PM
Para: [EMAIL PROTECTED]
Asunto: [R] covariate selection?

Hello,

I am hoping someone can help me with the following multivariate issue:  
I have a model consisting of about 50 covariates.  I would like to 
reduce this to about 5 covariate for the reduced model by combining 
cofactors that are strongly correlated.  Is there a package or function 
that would help me with this in R?  I appreciate any suggestions.

Thanks,
Ian

__
[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] covariate selection?

2004-10-12 Thread Christian Mora
Hi Ian
Have you tried help.search(pca)?
Christian

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Martínez Ovando
Juan Carlos
Sent: Tuesday, October 12, 2004 7:56 PM
To: Ian Fiske
Cc: [EMAIL PROTECTED]
Subject: RE: [R] covariate selection?


Hello Ian,

Sorry. I don't really understand your problem, which is of model
selection. That's right? 

You could use some criteria based in likelihood. For instante Akaike
(AIC) or Schwarz criteria (BIC), see: 

?AIC

?mle.aic

(The best model is determined minimizing AIC or BIC).

I hope this help you.

Greetings,
 
Juan Carlos 

-Mensaje original-
De: Ian Fiske [mailto:[EMAIL PROTECTED] 
Enviado el: Martes, 12 de Octubre de 2004 05:17 PM
Para: Martínez Ovando Juan Carlos
CC: [EMAIL PROTECTED]
Asunto: Re: [R] covariate selection?

Thanks Juan.  I thought that was what I was looking for, but really, I 
want to know which of the original covariates could best be used to take

advantage of their colinearity without creating new variables.  I think 
PCA creates new variables.  SAS and SPSS can do what I'm talking about, 
but I would like to use R for this.

Thanks,
Ian



Martínez Ovando Juan Carlos wrote:

Hello Ian,

?princomp

If your covariates are scalars, and the following documents:

http://www.jstatsoft.org/v07/i01/drdoc.pdf

http://www.bioconductor.org/workshops/Milan/PDF/Lab12.pdf


Best wishes.

Saludos,
 
Juan Carlos Martínez Ovando
Banco de México
Av. 5 de Mayo No. 18
Piso 5 Sección D
Col. Centro
06059  México, D. F.
Tel. +52 55 52.37.20.00 ext. 3594
Fax. +52 55 52.37.27.03
e-mail: [EMAIL PROTECTED]
 

-Mensaje original-
De: Ian Fiske [mailto:[EMAIL PROTECTED]
Enviado el: Martes, 12 de Octubre de 2004 04:08 PM
Para: [EMAIL PROTECTED]
Asunto: [R] covariate selection?

Hello,

I am hoping someone can help me with the following multivariate issue:
I have a model consisting of about 50 covariates.  I would like to 
reduce this to about 5 covariate for the reduced model by combining 
cofactors that are strongly correlated.  Is there a package or function

that would help me with this in R?  I appreciate any suggestions.

Thanks,
Ian

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

__
[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] read 4-jan-02 as date

2004-10-12 Thread bogdan romocea
Thank you everyone. Indeed, I had read the data via
read.csv and the date column was a factor. Everything works
fine if I convert to character first.

Regards,
b.


--- Sundar Dorai-Raj [EMAIL PROTECTED] wrote:

 
 
 bogdan romocea wrote:
 
  Dear R users,
  
  I have a column with dates (character) in a data frame:
  12-Jan-01 11-Jan-01 10-Jan-01 9-Jan-01  8-Jan-01 
 5-Jan-01
  and I need to convert them to (Julian) dates so that I
 can
  sort the whole data frame by date. I thought it would
 be
  very simple, but after checking the documentation and
 the
  list I still don't have something that works.
  
  1. as.Date returns the error below. What am I doing
 wrong?
  As far as I can see the character strings are in
 standard
  format.
  d$Date - as.Date(d$Date, format=%d-%b-%y)
  Error in fromchar(x) : character string is not in a
  standard unambiguous format
  
  2. as.date {Survival} produces this error,
  d$Date - as.date(d$Date, order = dmy)
  Error in as.date(d$Date, order = dmy) : Cannot coerce
 to
  date format
  
  3. Assuming all else fails, is there a text function
  similar to SCAN in SAS? Given a string like 9-Jan-01
 and
  - as separator, I'd like a function that can read the
  first, second and third values (9, Jan, 01), so that I
 can
  get Julian dates with mdy.date {survival}.
  
  Thanks in advance,
  b.
  
 
 If you're reading this from a file (via read.table, for
 example), then 
 your date column is probably a factor. Convert to
 character first.
 
   x
 [1] 12-Jan-01 11-Jan-01 10-Jan-01 9-Jan-01  8-Jan-01 
 5-Jan-01
 Levels: 10-Jan-01 11-Jan-01 12-Jan-01 5-Jan-01 8-Jan-01
 9-Jan-01
  
   Date(x, format=%d-%b-%y)
 Error in fromchar(x) : character string is not in a
 standard unambiguous 
 format
  
   sort(as.Date(as.character(x), format=%d-%b-%y))
 [1] 2001-01-05 2001-01-08 2001-01-09 2001-01-10
 2001-01-11
 [6] 2001-01-12
 
 
 --sundar
 


__
[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] 64-bit R on Intel Xeon EM64T running fine

2004-10-12 Thread Liaw, Andy
This article might be of interest to some:
http://www.linux-mag.com/2004-07/athlon_01.html

Regarding 64-bit build of R, I can confirm Irix, Alpha and AIX, although
some w/o readline/jpeg/png/X support, partially because of difficulties
linking against 64-bit version of those libraries.

Best,
Andy

 From: Prof Brian Ripley
 
 On Tue, 12 Oct 2004, Roger D. Peng wrote:
 
  This is good news.  As far as I know R has built for quite 
 some time 
  now on a number of 64 bit platforms (Linux on AMD Opteron/Athlon64, 
  Solaris/Sparc
 
 and Alpha and Irix and HP-UX and AIX as far as I understand.
 
 ) but I can't recall seeing a build on Intel with the 64 
  bit extensions.  
 
 As I understand it, this is an Intel `clone' of AMD64, so the only
 news would be if there were any problems: in almost all cases the
 executable code is identical to that compiled for AMD64 and in the GNU
 classification it is also x86_64-unknown-linux-gnu.
 
 I would even expect a Goto BLAS to work, if not as well as on 
 the specific 
 Opteron it is tuned for.  (Fast BLASes are an essential part 
 of making the 
 most of 64-bit processors on large problems.)
 
  Michael Seewald wrote:
   Dear mailing-list members,
   
   In the days of cheap RAM and microarray applications 
 feasting on memory,
   64-bit computers become more and more useful - to 
 actually make use of memory
   beyond the magic 4GB border. I would like to report the 
 success of running
   64-bit R on an Intel Xeon EM64T machine under Linux. Just 
 like on an AMD
   Opteron, R v2.0.0 compiles fine (and out of the box) and 
 is happily allocating
   memory until RAM and swap reach their limit.
   
   Hardware:
   - HP xw6200 workstation
   - dual Intel Xeon 3.4GHz with hyper-threading enabled
   - 4GB RAM, 4GB swap
   
   System: either
   - Fedora Core 2 x86_64 bit Linux
   or
   - Red Hat Enterprise Linux Workstation 3.0 x86_64 bit
   
   R:
   - v2.0.0
   
   Really, no problems at all during setup, a big thank you 
 to the R developers
   making this possible!
 
 -- 
 Brian D. Ripley,  [EMAIL PROTECTED]
 Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
 University of Oxford, Tel:  +44 1865 272861 (self)
 1 South Parks Road, +44 1865 272866 (PA)
 Oxford OX1 3TG, UKFax:  +44 1865 272595
 
 __
 [EMAIL PROTECTED] mailing list
 https://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] Diagnosing trouble with R-2.0, Fedora Core 2, and Rcmdf

2004-10-12 Thread John Fox
Dear Paul,

I've now had a chance to check into these problems further:

 -Original Message-
 From: [EMAIL PROTECTED] 
 [mailto:[EMAIL PROTECTED] On Behalf Of Paul Johnson
 Sent: Monday, October 11, 2004 1:09 PM
 To: r help
 Subject: [R] Diagnosing trouble with R-2.0, Fedora Core 2, and Rcmdf
 
 Greetings, R-help!
 
 On 2 Fedora Core 2 Linux systems, i've completely erased the 
 previous R and all packages and then installed R-2.0 and 
 installed fresh packages.
 
 In using Rcmdr, I see some trouble and I wonder if other 
 people see this and if it is due to the tcl/tk, or R, or 
 Rcmdr.  (If readers have not yet tried Rcmdr, I recommend it 
 not just because of the GUI it provides, but also because 
 Prof. Fox has created several very handy commands, like 
 scatter3d, which make it possible to use advanced packages like rgl. 
 Rcmdr provides several very handy wrapper commands that just 
 work and users don't have to fuss over so many details! And, 
 if you are new at R, you can use pull down menus and then 
 Rcmdr displays the commands that correspond with those menu 
 options. Very educational!)
 
 In no particular order, here are the issues I see with R-2.0 and Rcmdr
 
 1. In the panel to select a dataset from a package (nenu: 
 Data/Data in packages), I can type in the name of a dataset, 
 but the GUI will not let me choose the name of a package from 
 which to select a dataset. Nothing happens when I pick a 
 package name.  (With previous R/Rcmdr, I did not have this trouble).
 

I had in fact fixed this in the development version of the package (Rcmdr
0.9-12). I've now posted that to my web site, at
http://socserv.socsci.mcmaster.ca/jfox/Misc/Rcmdr/index.html. I'd like to
do some more testing before sending this version to CRAN.

 2. When using Rcmdr, some of the output from commands shows 
 in the Rcmdr bottom window, but some is sent to the xterm in 
 which R was started. For example, with a scatter3d() command, 
 if I add the option model.summary=T, the model summary shows 
 in the xterm.  But some other models show results in the 
 bottom pane of Rcmdr.  And, it seems to me, there are some 
 commands in which I've noticed some of the output going to 
 the Rcmdr bottom buffer and  some to the xterm.
 

I did in fact try to deal with this problem. The solution that I employed
didn't work for scatter3d() with model.summary=TRUE, since the printed
summaries were produced as side effects by scatter3d(). That's a bad
practice, and I've fixed it; now scatter3d() returns a list of summaries,
and the Rcmdr can cope with that. (As you know, it's not my intention that
model.summary=TRUE be set from the Rcmdr GUI, but it's better to have it
work if you enter this from the script editor.)

You imply, however, that there are other cases of this problem. It would
help to know what they are -- assuming that they're not fixed in the
development version now on my web site.

 3. When I want to exit Rcmdr and choose the pull down exit 
 from Commander and R, I get a Segmentation Fault that closes 
 Rcmdr and R.
 

I haven't been able to duplicate this problem, to this point testing only
under Windows XP. Does this occur only when an rgl graphics device is open?
(The Rcmdr should close the rgl device before it exits.)

 4. 3d plots do not display on the screen until I click in the 
 rgl window that displays the graph.  This might be a video 
 card/AGP driver problem, I suppose.  These systems have the 
 NVidia FX5200 cards and the NVidia proprietary X driver.  If 
 other users don't see the same on other kinds of systems, I 
 guess that will tell me where the problem lies.
 

As I said, I believe that I've seen this problem before under Quantian. It
would help to know whether it's peculiar to the Rcmdr, scatter3d(), or rgl.

 5. At random times, I get an error tcl/tk window popping up 
 with a message about MASS and categorical variables.  It says
 
 Error in data(package=parse(text=packageName));
 'MASS' must be character string or NULL
 
 It says that over and over, sometimes it has other package 
 names, as in:
 
 Error in data(package=parse(text=packageName));
 'relimp' must be character string or NULL
 
 These seem to be harmless?

This should go away now that problem 1 is fixed.

Regards,
 John

 -- 
 Paul E. Johnson   email: [EMAIL PROTECTED]
 Dept. of Political Sciencehttp://lark.cc.ku.edu/~pauljohn
 1541 Lilac Lane, Rm 504
 University of Kansas  Office: (785) 864-9086
 Lawrence, Kansas 66044-3177   FAX: (785) 864-5700
 
 __
 [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] covariate selection?

2004-10-12 Thread Kjetil Brinchmann Halvorsen
Ian Fiske wrote:
Hello,
I am hoping someone can help me with the following multivariate 
issue:  I have a model consisting of about 50 covariates.  I would 
like to reduce this to about 5 covariate for the reduced model by 
combining cofactors that are strongly correlated.  Is there a package 
or function that would help me with this in R?  I appreciate any 
suggestions.

Thanks,
Ian
__
[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


have a look at package leaps, and also consider ridge regression.
--
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


RE: [R] covariate selection?

2004-10-12 Thread Austin, Matt
I like Kjetil's suggestion of a shrinkage estimator.  Perhaps this would be
a good time to experiment with Trevor Hastie's 'lars' package.

If you have a lot of correlated inputs I might suggest using Andy Liaw's
randomforest package.  I have found this technique to be very valuable in
this setting.  The partial dependency plots are a good way to explore the
functional relationships of the variables.

--Matt

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of Kjetil Brinchmann
Halvorsen
Sent: Tuesday, October 12, 2004 17:16 PM
To: Ian Fiske
Cc: [EMAIL PROTECTED]
Subject: Re: [R] covariate selection?


Ian Fiske wrote:

 Hello,

 I am hoping someone can help me with the following multivariate 
 issue:  I have a model consisting of about 50 covariates.  I would 
 like to reduce this to about 5 covariate for the reduced model by 
 combining cofactors that are strongly correlated.  Is there a package 
 or function that would help me with this in R?  I appreciate any 
 suggestions.

 Thanks,
 Ian

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


have a look at package leaps, and also consider ridge regression.

-- 

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


RE: [R] tclk, tcltk

2004-10-12 Thread Liaw, Andy
From NEWS of R-2.0.0:

o   library() now checks the version dependence (if any) of
required packages mentioned in the Depends: field of the
DESCRIPTION file.

This is not done in R-1.9.1 and prior, I believe (or it wouldn't be in
NEWS).

Andy

 From: Jean Eid
 
 Thanks to Brian. I was looking everywhere except the typo. I guess the
 previous build (1.9.1) ignored the dependece error.
 
 Thanks again,
 
 jean
 
 On Tue, 12 Oct 2004, Prof Brian Ripley wrote:
 
  What is package `tclk'?  I think you have a typo somewhere 
 in your code.
  At a guess you have
 
  Depends: tclk
 
  in a DESCRIPTION file for one of your packages.
 
 
  On Tue, 12 Oct 2004, Jean Eid wrote:
 
   I have been having problems with these two 'libraries' 
 since I installed
   2.0.0.
   I have built a package with couple of functions so that I 
 can load it at
   startup every time R is booted. The problem is that I 
 have the following
   error every time I call the library
  
   Loading required package: tclk
   Error: package 'tclk' could not be loaded
   In addition: Warning message:
   There is no package called 'tclk' in: library(pkg, 
 character.only = TRUE, logical = TRUE, lib.loc = lib.loc)
  
  
   However I can load tcltk library now (thanks to Dirk for 
 helping me with
   this). I can load the functions I have in the library and 
 everything works
   fine.
  
   I cannot find any information on this except the 
 following thread which
   was not resolved.
   http://tolstoy.newcastle.edu.au/R/help/04/01/0410.html
 
  It was resolved, and in any case it was about installing 
 64-bit Tcl/Tk on
  Solaris, something that was (and is) covered in the R 
 Installation manual.
 
   Any help or ideas are greatly appreciated.
  
   P.S. what is the difference between tclk and tcltk? and 
 why calling the
   installed library is requiring tclk? I just made up a 
 dummy package with a
   function
  
   fun-function(x) x^2
  
   just to test and the same thing happens (Loading required 
 package: tclk
   ...).
  
   This is on a Linux debian unstable with the kernel  
 2.4.20-bf2.4-xfs
 
  --
  Brian D. Ripley,  [EMAIL PROTECTED]
  Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
  University of Oxford, Tel:  +44 1865 272861 (self)
  1 South Parks Road, +44 1865 272866 (PA)
  Oxford OX1 3TG, UKFax:  +44 1865 272595
 
 
 
 __
 [EMAIL PROTECTED] mailing list
 https://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] KalmanLike: missing exogenous factor?

2004-10-12 Thread Heng Sun
Prof Ripley,

Thanks for explanation. I now understand where
KalmanLike fits. 

I should not use exogenous factor. It should be
called exogenous variable or inputs or known
effects. My study on how trading sizes impact on
stock prices has trading sizes as this exogenous
variable. As you said, this should belong to some
package. I did internet searches and found something
similar but not covering my case.

The restrictive access to web makes subscription from
my work place not convenient. Sorry.

Heng Sun
Senior Quantitative Analyst
Depository Trust and Clearing Corporation
New York, USA 10041
Tel: 212-755-5754


--- Prof Brian Ripley [EMAIL PROTECTED] wrote:

 On Mon, 11 Oct 2004, Heng Sun wrote:
 
  From the help document on KalmanLike, KalmanRun,
 etc.,
  I see the linear Gaussian state space model is 
  
  a - T a + R e
  y = Z' a + eta
  
  following the book of Durbin and Koopman.
  
  In practice, it is useful to run Kalman
  filtering/smoothing/forecasting with exogenous
 factor:
  
  a - T a + L b + R e
  y = Z' a + M b + eta
  
  where b is some known vector (a function of time).
  
  Some other software like S-plus and Mathematica
  include the above exogenous factor. SsfPack by
  Koopman, etal. also has the factor built in the
 model
  to accommodate practical uses.
  
  So what is the rationale for R to leave off the
  exogenous factor? Is there a feasible way to
 convert
  the general model to the simple model in R?
 
 What is the rationale for your raising this?
 
 KalmanLike, KalmanRun, etc were written for R 1.5.0
 as part of the ts 
 package (see my article in R-news), and the ts
 applications (see the See 
 Also section) do not need a so-called `exogenous
 factor' (which is not a 
 `factor').   R does not pretend to have facilities
 for whatever subject 
 area you mean (but do not say) by `in practice'. 
 That's what addon
 packages are for (and some do touch on this area).
 
 We have no idea who [EMAIL PROTECTED]' is: it is
 courteous to use a 
 signature and give your affiliation.
 
 -- 
 Brian D. Ripley, 
 [EMAIL PROTECTED]
 Professor of Applied Statistics, 
 http://www.stats.ox.ac.uk/~ripley/
 University of Oxford, Tel:  +44 1865
 272861 (self)
 1 South Parks Road, +44 1865
 272866 (PA)
 Oxford OX1 3TG, UKFax:  +44 1865
 272595
 


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


RE: [R] graph question

2004-10-12 Thread Wiener, Matthew
Dean --

I believe just setting log = y in your plot command should do this.

For example:

 plot(runif(100, 1, 100), runif(100, 1, 100), log = xy)
gives me tick marks at 2, 5, 10, 20, 50, and 100.  (YMMV because of the
random numbers.)

Hope this helps,

Matt Wiener

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Dean Sonneborn
Sent: Tuesday, October 12, 2004 2:02 PM
To: [EMAIL PROTECTED]
Subject: [R] graph question


I would like to produce a graph which plots a log scale variable on the 
y-axis but have the tick marks on the y-axis  be the non log transformed 
values that are round like .5, 1, 2, 3, 4 etc. Has anyone done something 
like this in the past? How did you implement it in the code?

Thanks,
Dean

__
[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] diagonal matrix construction

2004-10-12 Thread Chris Ryan
Hi, 
 
I have worked long and hard and looked in the manuals and am having a hard time 
constructing a diagonal matrix.  I can get the diagonals out of a matrix but can't 
construct the matrix with just the diagonals.  I have been on the web site and manuals 
and I think that it says to use:
 
dsj - diag (three = 1, nrow, ncol = 7)   three is the name of 
my matrix and dsj is where I'm trying to put it but it comes back:  
 
unused argument(s) (three ...)
every time that I try it.  
 
Am I doing something wrong in trying to make this matrix?
 
Thank you very much for your time, Chris Ryan
 
 
Christopher W. Ryan
Black Bear Project Leader
West Virginia Division of Natural Resources
Capitol Complex, Bldg 3, Rm 824
Charleston, WV 25305

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


[R] data(eurodist) and PCA ??

2004-10-12 Thread Dan Bolser


If I perform PCA on the 'eurodist' data, should I get an accurate
geographic layout of the cities with biplot?

(barring inversions, i.e. their is no way to define north.. but you get
the idea...)

I have a complex distance matrix, and I am thinking about how to cluster
it and how to visualize the quality of the resulting clusters. 

If I could 'see' the clusters in space I could understand how / what the
cluster algorithms were doing. 

Can I use PCA over the distance matrix to to do that?

Sorry for the dumb questions.

Dan.

__
[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] diagonal matrix construction

2004-10-12 Thread Gabor Grothendieck
Chris Ryan chrisryan at wvdnr.gov writes:

: 
: Hi, 
: 
: I have worked long and hard and looked in the manuals and am having a hard 
time constructing a diagonal
: matrix.  I can get the diagonals out of a matrix but can't construct the 
matrix with just the diagonals.  I
: have been on the web site and manuals and I think that it says to use:
: 
: dsj - diag (three = 1, nrow, ncol = 7)   three is 
the name of my matrix and dsj is where I'm trying to put it but it
: comes back:  
: 
: unused argument(s) (three ...)
: every time that I try it.  
: 
: Am I doing something wrong in trying to make this matrix?
: 
: Thank you very much for your time, Chris Ryan
:

Looking at ?diag we see that diag takes 3 arguments: 'x', 'nrow' and 'ncol'.
'three' is not one of them so it is correctly telling you that you specified
an unused argument.

diag(nrow = 7) # will create a 7x7 identity matrix.
diag(1, 7)  # same using positional rather than named arguments
diag(, 7)  # same since x defaults to 1

Look at the examples at the bottom of the ?diag page and try them out 
by running

example(diag)

at the R prompt or by just typing them in to get more insight.  Also
you might consider rereading the Introduction to R manual where it 
is covered on page 22.

__
[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] diagonal matrix construction

2004-10-12 Thread Spencer Graves
 Did you try working the examples in the diag documentation, one 
of which is as follows: 

  diag(10,3,4) # guess what?
[,1] [,2] [,3] [,4]
[1,]   10000
[2,]0   1000
[3,]00   100
(R 1.9.1 for Windows). 

 The R syntax expects three in that context to be an argument of 
the function diag.  If you want a 7x7 identity matrix, try diag(7).  
If you want something else, please study the examples in the 
documentation for diag.  If that is not adequate, let us know. 

 hope this helps.  spencer graves
Chris Ryan wrote:
Hi, 

I have worked long and hard and looked in the manuals and am having a hard time 
constructing a diagonal matrix.  I can get the diagonals out of a matrix but can't 
construct the matrix with just the diagonals.  I have been on the web site and manuals 
and I think that it says to use:
dsj - diag (three = 1, nrow, ncol = 7)   three is the name of my matrix and dsj is where I'm trying to put it but it comes back:  

unused argument(s) (three ...)
every time that I try it.  

Am I doing something wrong in trying to make this matrix?
Thank you very much for your time, Chris Ryan
Christopher W. Ryan
Black Bear Project Leader
West Virginia Division of Natural Resources
Capitol Complex, Bldg 3, Rm 824
Charleston, WV 25305
[[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
 

--
Spencer Graves, PhD, Senior Development Engineer
O:  (408)938-4420;  mobile:  (408)655-4567
__
[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] debugging non-visible functions

2004-10-12 Thread Murad Nayal


Hi,

I would like to step-through a non-visible function. but apparently I
don't know enough about namespaces to get that to work:

 methods(predict) 
 ... deleted lines ... 
[27] predict.rpart* predict.smooth.spline*
[31] predict.survreg.penal*

Non-visible functions are asterisked


 debug(predict.rpart)
Error: Object predict.rpart not found


 getAnywhere(predict.rpart)
A single object matching 'predict.rpart' was found
It was found in the following places
  registered S3 method for predict from namespace rpart
  namespace:rpart
with value

function (object, newdata = list(), type = c(vector, prob, 
class, matrix), ...) 
{
... deleted code ...
}
environment: namespace:rpart


 debug(predict.rpart,pos=package:rpart)
Error: Object predict.rpart not found


how can I 'debug' non-visible functions, like predict.rpart?

many thanks
Murad Nayal

__
[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] debugging non-visible functions

2004-10-12 Thread Gabor Grothendieck
Murad Nayal mn216 at columbia.edu writes:

: 
: Hi,
: 
: I would like to step-through a non-visible function. but apparently I
: don't know enough about namespaces to get that to work:
: 
:  methods(predict) 
:  ... deleted lines ... 
: [27] predict.rpart* predict.smooth.spline*
: [31] predict.survreg.penal*
: 
: Non-visible functions are asterisked
: 
: 
:  debug(predict.rpart)
: Error: Object predict.rpart not found
: 
: 
:  getAnywhere(predict.rpart)
: A single object matching 'predict.rpart' was found
: It was found in the following places
:   registered S3 method for predict from namespace rpart
:   namespace:rpart
: with value
: 
: function (object, newdata = list(), type = c(vector, prob, 
: class, matrix), ...) 
: {
: ... deleted code ...
: }
: environment: namespace:rpart
: 
: 
:  debug(predict.rpart,pos=package:rpart)
: Error: Object predict.rpart not found
: 
: 
: how can I 'debug' non-visible functions, like predict.rpart?
: 

From the ?debug page we see that that only one argument can
be given to debug, the function name, so there is no two
argument form as per your example above.

What you can do is that you can debug it like this:

   require(rpart)
   debug(rpart:::predict.rpart)

Also note that even if its not visible it may still have a help
page, which in this case it does:

   ?predict.rpart

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