[R] import data from splus

2004-08-09 Thread Mehrez Samaali
Dear Sir,
I am using R for the first time and I am looking for a function or a 
command that allows to import Splus data into R. I have already heard about 
functions called readSdata and readSfiles in the Rstreams package. I 
did not find the last new version of this package on the CRAN and its old 
one did not work on R 1.8.0 (the vesrion that I am using).
Would you please mention me the updated package that I should install and 
possibly the suitable function to apply.

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


Re: [R] Time zones

2004-08-09 Thread Prof Brian Ripley
It depends on your OS, which you haven't told us.  And OSes tend to hide 
the information quite effectively.

On a Unix/Linux system, try 'man tzset'.  That reads named timeszones from
a directory, nowadays /usr/share/zoneinfo or /usr/share/lib/zoneinfo or
something like that.

On Windows, the C runtime has rules like (from the _tzset entry in MSDN)

  TZ=tzn[+|-]hh[:mm[:ss] ][dzn]

  tzn
  Three-letter time-zone name, such as PST. You must specify the correct 
  offset from local time to UTC.

  hh
  Difference in hours between UTC and local time. Optionally signed.

  mm
  Minutes. Separated from hh by a colon (:).

  ss
  Seconds. Separated from mm by a colon (:).

  dzn
  Three-letter daylight-saving-time zone such as PDT. If daylight saving 
  time is never in effect in the locality, set TZ without a value for dzn. 
  The C run-time library assumes the United States's rules for 
  implementing the calculation of Daylight Saving Time (DST). 

so it seems EST5EDT would be correct (but I didn't find a list of 
names).

Did you try EST5EDT to see if it seemed to work?


On Mon, 9 Aug 2004, David Scott wrote:

 I am analysing some data collected over a number of months from Allentown, 
 PA, which is just north of Philadelphia. I am using as.POSIXct for dates 
 and times, and I need to get the timezone specification correct.
 
 Going on the documentation for DateTimeClasses, I believe one way to 
 specify the correct time zone is
 
 tz=EST5EDT
 
 I would be grateful for any advice on this. I ask because I haven't been 
 able to find a list of all the possible time zones or formats that can be 
 used. I have done a bit of googling without to much success.


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

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


Re: [R] returns the value of a polynomial of degree n evaluated at x.

2004-08-09 Thread Prof Brian Ripley
See package polynom on CRAN.

On Mon, 9 Aug 2004, McClatchie, Sam (PIRSA-SARDI) wrote:

 Is there a function in R that is similar to polyval in matlab? (y =
 polyval(p,x) returns the value of a polynomial of degree n evaluated at x.
 The input argument p is a vector of length n+1 whose elements are the
 coefficients in descending powers of the polynomial to be evaluated).
 http://www.mathworks.com/access/helpdesk/help/techdoc/ref/polyval.html 
  
 I have possibly missed it in the R help files, so please excuse me if I
 have. Polynomial evaluation yielded no result in a search of help, and the
 functions poly() and locpoly() don't seem to be what I am after.

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

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


Re: [R] import data from splus

2004-08-09 Thread Prof Brian Ripley
Please read the `R Data Import/Export' Manual that ships with R.  You are
looking for package foreign.

On Mon, 9 Aug 2004, Mehrez Samaali wrote:

 I am using R for the first time and I am looking for a function or a 
 command that allows to import Splus data into R. I have already heard about 
 functions called readSdata and readSfiles in the Rstreams package. 

Those functions were made obselete by package foreign in April 2001.  
However did a first-time user hear about them?

 I did not find the last new version of this package on the CRAN

It's in the Archive.

 and its old one did not work on R 1.8.0 (the vesrion that I am using).

That's already rather old, but does have package foreign.

 Would you please mention me the updated package that I should install and 
 possibly the suitable function to apply.

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

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


[R] ess settings

2004-08-09 Thread Jin Shusong
Dear R users,

  I downloaded an ess-5.2.2 package and hope to use emacs as
front to work with R.  I modified ~/.emacs and start R by
M-x R.   But I found when I quited  the R session, it still asked me to
save the work space or not.  I added inferior-R-args with
--save args.  But it seemed that it had no effect.   Can
you tell me how to pass the arguments other than
--no-readline to R.  Thanks a lot.
Below is the part for ess settings.

(setq load-path (cons ~/.emacs.d/lisp/ess-5.2.2/lisp load-path))
(require 'ess-site)
(setq ess-default-style  GNU)
(setq inferior-ess-program R)
(setq inferior-R-program-name ~/.local/bin/R)   ; unix systems
(setq inferior-R-args --save --no-readline)
(setq ess-pre-run-hook
  '((lambda ()  (setq ess-directory ~/study/R/)
(setq ess-ask-for-ess-directory nil)
)))
-- 


   Yours  Sincerely

   Jin

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


[R] displaying computation outputs inside for loops

2004-08-09 Thread Dewez Thomas
Dear R-users,

I am puzzled by for loops and am kind of ashamed to ask because it is so
simple. There must be something I am missing in the way they are executed.

Basically, I would like to iterate a given number of time and generate a
bunch of stats (that's what loops are designed for, right?). Before doing
this I simply want to test simple procedure and see if they work (ie got the
syntax right - my main problem as I am new to R - and produce expected
results).

Even for something as basic as
for (i in 1:3) {i}

I get no screen output. Shouldn't R systematically display i for every loop
just like I am requesting with invoking i? When checking at the end of the
looping, i is indeed assigned to 5 but I cannot get intermediate values.

Further testing shows that i takes all the values in turn.
 for (i in 1:3) {str(i)}
 int 1
 int 2
 int 3

but summary(i) doesn't display anything. Isn't there something weird with
this? Am I expecting something wrong and for loops just don't work that way,
unless using str() command? I tried print() and other descriptive commands
but to no avail.

A quick explanation would be grately appreciated

Thomas
***
Le contenu de cet e-mail et de ses pièces jointes est destin...{{dropped}}

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


Re: [R] displaying computation outputs inside for loops

2004-08-09 Thread Dimitris Rizopoulos
Hi Thomas,

is this what you would like to get,

for(i in 1:3){
  x - rnorm(5)
  cat(the values of `x' are:, format(x), \n)
  cat(computation, i, finished\n\n)
}

for(i in 1:3) print(i)


I hope this helps.

Best,
Dimitris


Dimitris Rizopoulos
Doctoral Student
Biostatistical Centre
School of Public Health
Catholic University of Leuven

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


- Original Message - 
From: Dewez Thomas [EMAIL PROTECTED]
To: 'R mailing list' [EMAIL PROTECTED]
Sent: Monday, August 09, 2004 11:15 AM
Subject: [R] displaying computation outputs inside for loops


 Dear R-users,

 I am puzzled by for loops and am kind of ashamed to ask because it
is so
 simple. There must be something I am missing in the way they are
executed.

 Basically, I would like to iterate a given number of time and
generate a
 bunch of stats (that's what loops are designed for, right?). Before
doing
 this I simply want to test simple procedure and see if they work (ie
got the
 syntax right - my main problem as I am new to R - and produce
expected
 results).

 Even for something as basic as
 for (i in 1:3) {i}

 I get no screen output. Shouldn't R systematically display i for
every loop
 just like I am requesting with invoking i? When checking at the
end of the
 looping, i is indeed assigned to 5 but I cannot get intermediate
values.

 Further testing shows that i takes all the values in turn.
  for (i in 1:3) {str(i)}
  int 1
  int 2
  int 3

 but summary(i) doesn't display anything. Isn't there something weird
with
 this? Am I expecting something wrong and for loops just don't work
that way,
 unless using str() command? I tried print() and other descriptive
commands
 but to no avail.

 A quick explanation would be grately appreciated

 Thomas
 ***
 Le contenu de cet e-mail et de ses pièces jointes est
destin...{{dropped}}

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

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


[R] Installing RMySQL on Windows XP for R 1.9.1

2004-08-09 Thread Robert Wania
Hi,

I'm thankful for any help on installing RMySQL on Windows XP for R 1.9.1

The thread
http://tolstoy.newcastle.edu.au/R/help/04/01/1021.html
already tried to discuss the matter. It concludes that Windows Sources for Packages 
are alike the Linux ones.

So I extracted the files from the RMySQL_*.tar.gz from
http://stat.bell-labs.com/RS-DBI/download/index.html
and stuffed them into a zip-file which was willingly taken by the install routine of 
my RGui. It said the well known updating HTML
package descriptions but when using library(RMySQL) the error Error in 
testRversion(descfields) : This package has not been
installed properly. See the Note in ?library. Obviously the note wasn't very helpful 
and so I ask you for any help.

Regards
Robert

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


[R] linear regression

2004-08-09 Thread Donald Lehmann
Dear Consultant
I've done linear regression successfully on R a few times before.  But this 
time it keeps telling me:-

Error in lm.fit(x, y, offset = offset, singular.ok = singular.ok, ...) :
0 (non-NA) cases
The model is:-
fm1 - lm(TS.CM ~ AGE + SEX + HFE.Y.01 + TFC2B.01 + HFE.Y.01*TFC2B.01, data 
= IRONresults, subset = DIAG2.1D == 0)
summary (fm1)

TS.CM is a continuous variable (%s), sex is coded 0 = women, 1 = men, 
DIAG2.1D is coded 0 = non-demented, 1 = ALzheimer's disease and the genes, 
HFE.Y.01  TFC2B.01, are coded 0 = non-carrier and 1 = carrier

I've tried recoding the data to use 1  2, instead of 0  1, and I've 
removed the rows with missing data.  I've also tried putting ...lm(formula 
= TS.CM ~ ...  But I always get the same error message

What am I doing wrong?
A related question: what's the minimum no of data points for regression 
analysis to work?  We have only 23 cases carrying both genes out of 447 and 
only 8 out of 264 in the above subset (ie non-demented).  I seem to 
remember hearing somewhere that you needed a minimum of ~30 (?), so 
probably this wouldn't work anyway.  Still, I'd like to know what I was 
doing wrong!

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


RE: [R] Installing RMySQL on Windows XP for R 1.9.1

2004-08-09 Thread Henrik Bengtsson
Hi, I cannot help you install RMySQL on Windows, but most likely RMySQL
contains non-R code too, such as C code, that requires compilation and then
your gunzip-untar-rezip approach will not work. 

For your information, you can use the RODBC package instead. I recently
downloaded and installed a MySQL server on my Windows XP *Pro* machine. Then
I use the RODBC package (on CRAN and installs directly on Windows) to
connect to it. In order for this to work you have to have an ODBC service
running on your machine. You will find one for most Windows versions called
MyODBC on the mysql.com download pages (links at the right margin). When it
works you will be connected to you db from R by 

library(RODBC)
channel - odbcConnect(MyDatabase, uid=root)   # or some other username
df - sqlQuery(select * from myTable)

See also ?RODBC. I just did the above two days ago from scratch and it was
pretty easy. I won't time to help you more now since I'm writing up my
thesis...

Cheers

Henrik Bengtsson


 -Original Message-
 From: [EMAIL PROTECTED] 
 [mailto:[EMAIL PROTECTED] On Behalf Of Robert Wania
 Sent: Monday, August 09, 2004 11:34 AM
 To: [EMAIL PROTECTED]
 Subject: [R] Installing RMySQL on Windows XP for R 1.9.1
 
 
 Hi,
 
 I'm thankful for any help on installing RMySQL on Windows XP 
 for R 1.9.1
 
 The thread http://tolstoy.newcastle.edu.au/R/help/04/01/1021.html
 already tried to discuss the matter. It concludes that 
 Windows Sources for Packages are alike the Linux ones.
 
 So I extracted the files from the RMySQL_*.tar.gz from 
 http://stat.bell-labs.com/RS-DBI/download/index.html
 and stuffed them into a zip-file which was willingly taken by 
 the install routine of my RGui. It said the well known 
 updating HTML package descriptions but when using 
 library(RMySQL) the error Error in testRversion(descfields) 
 : This package has not been installed properly. See the Note 
 in ?library. Obviously the note wasn't very helpful and so I 
 ask you for any help.
 
 Regards
 Robert
 
 __
 [EMAIL PROTECTED] mailing list 
 https://www.stat.math.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide! 
 http://www.R-project.org/posting-guide.html
 


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


RE: [R] Installing RMySQL on Windows XP for R 1.9.1

2004-08-09 Thread Henrik Bengtsson
The code snippet was incorrect; here the correct one (I hope)

library(RODBC)
channel - odbcConnect(MyDatabase, uid=root)   # or some other username
df - sqlQuery(channel, select * from myTable)

/Henrik

 -Original Message-
 From: Henrik Bengtsson [mailto:[EMAIL PROTECTED] 
 Sent: Monday, August 09, 2004 11:59 AM
 To: 'Robert Wania'; '[EMAIL PROTECTED]'
 Subject: RE: [R] Installing RMySQL on Windows XP for R 1.9.1
 
 
 Hi, I cannot help you install RMySQL on Windows, but most 
 likely RMySQL contains non-R code too, such as C code, that 
 requires compilation and then your gunzip-untar-rezip 
 approach will not work. 
 
 For your information, you can use the RODBC package instead. 
 I recently downloaded and installed a MySQL server on my 
 Windows XP *Pro* machine. Then I use the RODBC package (on 
 CRAN and installs directly on Windows) to connect to it. In 
 order for this to work you have to have an ODBC service 
 running on your machine. You will find one for most Windows 
 versions called MyODBC on the mysql.com download pages (links 
 at the right margin). When it works you will be connected to 
 you db from R by 
 
 library(RODBC)
 channel - odbcConnect(MyDatabase, uid=root)   # or some 
 other username
 df - sqlQuery(select * from myTable)
 
 See also ?RODBC. I just did the above two days ago from 
 scratch and it was pretty easy. I won't time to help you more 
 now since I'm writing up my thesis...
 
 Cheers
 
 Henrik Bengtsson
 
 
  -Original Message-
  From: [EMAIL PROTECTED]
  [mailto:[EMAIL PROTECTED] On Behalf Of Robert Wania
  Sent: Monday, August 09, 2004 11:34 AM
  To: [EMAIL PROTECTED]
  Subject: [R] Installing RMySQL on Windows XP for R 1.9.1
  
  
  Hi,
  
  I'm thankful for any help on installing RMySQL on Windows XP
  for R 1.9.1
  
  The thread http://tolstoy.newcastle.edu.au/R/help/04/01/1021.html
  already tried to discuss the matter. It concludes that
  Windows Sources for Packages are alike the Linux ones.
  
  So I extracted the files from the RMySQL_*.tar.gz from
  http://stat.bell-labs.com/RS-DBI/download/index.html
  and stuffed them into a zip-file which was willingly taken by 
  the install routine of my RGui. It said the well known 
  updating HTML package descriptions but when using 
  library(RMySQL) the error Error in testRversion(descfields) 
  : This package has not been installed properly. See the Note 
  in ?library. Obviously the note wasn't very helpful and so I 
  ask you for any help.
  
  Regards
  Robert
  
  __
  [EMAIL PROTECTED] mailing list
  https://www.stat.math.ethz.ch/mailman/listinfo/r-help
  PLEASE do read the posting guide! 
  http://www.R-project.org/posting-guide.html
  
  


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


[R] /minus or /hyphen in PS output

2004-08-09 Thread M.Kondrin
Dear R devolepers!
Wouldn't you change src/main/devPS.c file (patch will follow). Problem 
is  with  minus sign in ps output. The original code forces the name 
/minus to the character number 45 (-). But /minus symbol is not defined 
in standard Adobe encoding and (even worse) is not defined in most type1 
fonts (where the name /hyphen is used instead), in this case you will 
have an empty space instead of -. Redefining encoding for this fonts 
does not help because encoding vector in ps output got corrected and 
/hyphen (or any other name I have selected for 45'th character) is 
replaced with /minus. I have tried this patch and it works for me.


449,450c449
   //  if(c == 45) strcpy(dest, /minus); else
   strcpy(dest, state-p0);
---
   if(c == 45) strcpy(dest, /minus); else strcpy(dest, state-p0);
__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


RE: [R] Installing RMySQL on Windows XP for R 1.9.1

2004-08-09 Thread Prof Brian Ripley
You do need a binary version of  RMySQL.

See http://cran.r-project.org/bin/windows/contrib/1.9/@ReadMe
which tells you to get it from

http://stat.bell-labs.com/RS-DBI/download

the very page you got the sources from.  I do think you should read all of
the pages you look at, as in both cases you have ignored crucial 
information.

On Mon, 9 Aug 2004, Henrik Bengtsson wrote:

 Hi, I cannot help you install RMySQL on Windows, but most likely RMySQL
 contains non-R code too, such as C code, that requires compilation and then
 your gunzip-untar-rezip approach will not work. 

It never works, and no one said it did.  The rw-FAQ answers this question,
and the message in the archives said

Please consult the rw-FAQ for how to install packages. 

 For your information, you can use the RODBC package instead. I recently
 downloaded and installed a MySQL server on my Windows XP *Pro* machine. Then
 I use the RODBC package (on CRAN and installs directly on Windows) to
 connect to it. In order for this to work you have to have an ODBC service
 running on your machine. You will find one for most Windows versions called
 MyODBC on the mysql.com download pages (links at the right margin). When it
 works you will be connected to you db from R by 
 
 library(RODBC)
 channel - odbcConnect(MyDatabase, uid=root)   # or some other username
 df - sqlQuery(select * from myTable)
 
 See also ?RODBC. I just did the above two days ago from scratch and it was
 pretty easy. I won't time to help you more now since I'm writing up my
 thesis...
 
 Cheers
 
 Henrik Bengtsson
 
 
  -Original Message-
  From: [EMAIL PROTECTED] 
  [mailto:[EMAIL PROTECTED] On Behalf Of Robert Wania
  Sent: Monday, August 09, 2004 11:34 AM
  To: [EMAIL PROTECTED]
  Subject: [R] Installing RMySQL on Windows XP for R 1.9.1
  
  
  Hi,
  
  I'm thankful for any help on installing RMySQL on Windows XP 
  for R 1.9.1
  
  The thread http://tolstoy.newcastle.edu.au/R/help/04/01/1021.html
  already tried to discuss the matter. It concludes that 
  Windows Sources for Packages are alike the Linux ones.
  
  So I extracted the files from the RMySQL_*.tar.gz from 
  http://stat.bell-labs.com/RS-DBI/download/index.html
  and stuffed them into a zip-file which was willingly taken by 
  the install routine of my RGui. It said the well known 
  updating HTML package descriptions but when using 
  library(RMySQL) the error Error in testRversion(descfields) 
  : This package has not been installed properly. See the Note 
  in ?library. Obviously the note wasn't very helpful and so I 
  ask you for any help.

It was *very* helpful.  Your failure to read the rw-FAQ was unhelpful.

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

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


Re: [R] linear regression

2004-08-09 Thread Peter Dalgaard
Donald Lehmann [EMAIL PROTECTED] writes:

 Dear Consultant
 
 I've done linear regression successfully on R a few times before.  But
 this time it keeps telling me:-
 
 Error in lm.fit(x, y, offset = offset, singular.ok = singular.ok, ...) :
  0 (non-NA) cases
 
 The model is:-
 
 fm1 - lm(TS.CM ~ AGE + SEX + HFE.Y.01 + TFC2B.01 + HFE.Y.01*TFC2B.01,
 data = IRONresults, subset = DIAG2.1D == 0)
 summary (fm1)
 
 TS.CM is a continuous variable (%s), sex is coded 0 = women, 1 = men,
 DIAG2.1D is coded 0 = non-demented, 1 = ALzheimer's disease and the
 genes, HFE.Y.01  TFC2B.01, are coded 0 = non-carrier and 1 = carrier
 
 I've tried recoding the data to use 1  2, instead of 0  1, and I've
 removed the rows with missing data.  I've also tried putting
 ...lm(formula = TS.CM ~ ...  But I always get the same error message
 
 What am I doing wrong?


You don't need to give the main effects when there's a * term
(that's a SASism, the R equivalent is : and a*b == a+b+a:b by
definition), but that is hardly the main problem.

Could you have a look at this? :

with(IRONresults, complete.cases(TS.CM, AGE, SEX, HFE.Y.01, TFC2B.01))

If you get all FALSE, you'll know what hit you...
 
 A related question: what's the minimum no of data points for
 regression analysis to work?  We have only 23 cases carrying both
 genes out of 447 and only 8 out of 264 in the above subset (ie
 non-demented).  I seem to remember hearing somewhere that you needed a
 minimum of ~30 (?), so probably this wouldn't work anyway.  Still, I'd
 like to know what I was doing wrong!

Technically, you just need linearly independent predictors and more
observations than parameters (incl. the intercept). Other bounds get
bandied about on what should be required for a *meaningful* analysis
(like 10 observations per parameter), but these are quite heuristic
and empirical in nature.

-- 
   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://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] ess settings

2004-08-09 Thread Stephen Eglen

Dear Jin,

First, we have a mailing list for ESS questions; this is probably more
relevant than r-help for these questions.

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

Just last week this came up, and although the ESS documentation
suggests setting inferior-R-args, it doesn't seem to be used.  I will
look into solutions for this.  IN the meantime, there is a temporary
workaround mentioned in the mailing lists; see thread starting

 https://stat.ethz.ch/pipermail/ess-help/2004-August/002031.html

Best wishes,
Stephen

Jin Shusong writes:
  Dear R users,
  
I downloaded an ess-5.2.2 package and hope to use emacs as
  front to work with R.  I modified ~/.emacs and start R by
  M-x R.   But I found when I quited  the R session, it still asked me to
  save the work space or not.  I added inferior-R-args with
  --save args.  But it seemed that it had no effect.   Can
  you tell me how to pass the arguments other than
  --no-readline to R.  Thanks a lot.
  Below is the part for ess settings.
  
  (setq load-path (cons ~/.emacs.d/lisp/ess-5.2.2/lisp load-path))
  (require 'ess-site)
  (setq ess-default-style  GNU)
  (setq inferior-ess-program R)
  (setq inferior-R-program-name ~/.local/bin/R); unix systems
  (setq inferior-R-args --save --no-readline)
  (setq ess-pre-run-hook
'((lambda ()  (setq ess-directory ~/study/R/)
  (setq ess-ask-for-ess-directory nil)
  )))
  -- 
  
  
 Yours  Sincerely
  
 Jin
  
 

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


[R] GLS with binomial errors ?

2004-08-09 Thread Cristian Echeverria
Hi R-users:

I want to model deforestation using GLS in order to handle spatial autocorrelation. My 
response variables is binary data (Yes or Not) and my explanatory variables are 
categorical (1, 2, 3). I have only been able to find code which handles normally 
distributed data, whereas I have binary data. 

Anyone know how apply GLS modelling with a binary response variable?


Many thanks in advance!


Cristian Echeverria
[[alternative HTML version deleted]]

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


[R] Memory failure!!!!

2004-08-09 Thread Monica Palaseanu-Lovejoy
Hi,

I am trying to increase the memory R can use. I am running R 
under Windows on a machine with 2 GB of physical RAM and 4GB 
of paged memory.

I wrote in the R property windows --sdi --max-mem-size=4094M, 
but the R itself when it is doing a bayesian modelling (geoR) it 
stops at 1,096K and i get memory errors because it cannot 
allocate a new segment of about 500K of memory.

I don't have Visual Basic so i cannot use the other commands 
suggested in Help.

Also, if i am using memory.size(max=TRUE) i get a value 
corresponding to about 1024K, and if i am using 
memory.limit(size=NA) i get a value of about 4000K.

How can i force R to use more memory?

thank you for any suggestion,

Monica
Monica Palaseanu-Lovejoy
University of Manchester
School of Geography
Mansfield Cooper Bld. 3.21
Oxford Road
Manchester M13 9PL
England, UK
Tel: +44 (0) 275 8689
Email: [EMAIL PROTECTED]

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


[R] (no subject)

2004-08-09 Thread Paolo Tommasini
Hi ! mu name is Paolo and  I teach statistic in a small college in 
Brazil and we use Linux. We started to use R as our statitical software. 
I,ve been trying to use some commands I see in the documentation online 
but i doesn not work. Commands like

simple.hist.and.boxplot  and  others related with graphing. Do I need a special 
ppackage ? how do I load it ?
Thanks
__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] Memory failure!!!!

2004-08-09 Thread Uwe Ligges
Monica Palaseanu-Lovejoy wrote:
Hi,
I am trying to increase the memory R can use. I am running R 
under Windows on a machine with 2 GB of physical RAM and 4GB 
of paged memory.

I wrote in the R property windows --sdi --max-mem-size=4094M, 
but the R itself when it is doing a bayesian modelling (geoR) it 
stops at 1,096K and i get memory errors because it cannot 
allocate a new segment of about 500K of memory.
In that case either
a) your memory is too fragmented and you should start a new R session or
b) or you need much more than 500K, and you are just getting the error 
from one allocation (out of many) that fails.

The next question is which version of Windows this is. Some versions do 
not support that much memory, others have a hole of 512M (???, PCI 
address space is within the 4GB address space, AFAIR)...


I don't have Visual Basic so i cannot use the other commands 
suggested in Help.

Also, if i am using memory.size(max=TRUE) i get a value 
corresponding to about 1024K, and if i am using 
memory.limit(size=NA) i get a value of about 4000K.
I hope you mean about 4000*M*...
Or more precisely, what you get is:
 4094*1024*1024
[1] 4292870144
Uwe Ligges

How can i force R to use more memory?
thank you for any suggestion,
Monica
Monica Palaseanu-Lovejoy
University of Manchester
School of Geography
Mansfield Cooper Bld. 3.21
Oxford Road
Manchester M13 9PL
England, UK
Tel: +44 (0) 275 8689
Email: [EMAIL PROTECTED]
__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


RE: [R] Installing RMySQL on Windows XP for R 1.9.1

2004-08-09 Thread Robert Wania
I apologize for mixing the source and binary packages. (Although R didn't complain? 
Nevertheless this is no excuse)

After installing the binary package the only problem was the libmysql.dll, which was 
not found by R (but it was within the package).
I put it in the windows/system32 directory and everything works find.

Thanks for the instant help
Robert

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of Prof Brian Ripley
Sent: Monday, August 09, 2004 12:22 PM
To: Henrik Bengtsson
Cc: [EMAIL PROTECTED]; 'Robert Wania'
Subject: RE: [R] Installing RMySQL on Windows XP for R 1.9.1


You do need a binary version of  RMySQL.

See http://cran.r-project.org/bin/windows/contrib/1.9/@ReadMe
which tells you to get it from

http://stat.bell-labs.com/RS-DBI/download

the very page you got the sources from.  I do think you should read all of
the pages you look at, as in both cases you have ignored crucial
information.

On Mon, 9 Aug 2004, Henrik Bengtsson wrote:

 Hi, I cannot help you install RMySQL on Windows, but most likely RMySQL
 contains non-R code too, such as C code, that requires compilation and then
 your gunzip-untar-rezip approach will not work.

It never works, and no one said it did.  The rw-FAQ answers this question,
and the message in the archives said

Please consult the rw-FAQ for how to install packages.

 For your information, you can use the RODBC package instead. I recently
 downloaded and installed a MySQL server on my Windows XP *Pro* machine. Then
 I use the RODBC package (on CRAN and installs directly on Windows) to
 connect to it. In order for this to work you have to have an ODBC service
 running on your machine. You will find one for most Windows versions called
 MyODBC on the mysql.com download pages (links at the right margin). When it
 works you will be connected to you db from R by

 library(RODBC)
 channel - odbcConnect(MyDatabase, uid=root)   # or some other username
 df - sqlQuery(select * from myTable)

 See also ?RODBC. I just did the above two days ago from scratch and it was
 pretty easy. I won't time to help you more now since I'm writing up my
 thesis...

 Cheers

 Henrik Bengtsson


  -Original Message-
  From: [EMAIL PROTECTED]
  [mailto:[EMAIL PROTECTED] On Behalf Of Robert Wania
  Sent: Monday, August 09, 2004 11:34 AM
  To: [EMAIL PROTECTED]
  Subject: [R] Installing RMySQL on Windows XP for R 1.9.1
 
 
  Hi,
 
  I'm thankful for any help on installing RMySQL on Windows XP
  for R 1.9.1
 
  The thread http://tolstoy.newcastle.edu.au/R/help/04/01/1021.html
  already tried to discuss the matter. It concludes that
  Windows Sources for Packages are alike the Linux ones.
 
  So I extracted the files from the RMySQL_*.tar.gz from
  http://stat.bell-labs.com/RS-DBI/download/index.html
  and stuffed them into a zip-file which was willingly taken by
  the install routine of my RGui. It said the well known
  updating HTML package descriptions but when using
  library(RMySQL) the error Error in testRversion(descfields)
  : This package has not been installed properly. See the Note
  in ?library. Obviously the note wasn't very helpful and so I
  ask you for any help.

It was *very* helpful.  Your failure to read the rw-FAQ was unhelpful.

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

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

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


Re: [R] Memory failure!!!!

2004-08-09 Thread Prof Brian Ripley
On Mon, 9 Aug 2004, Monica Palaseanu-Lovejoy wrote:

 I am trying to increase the memory R can use. I am running R 
 under Windows on a machine with 2 GB of physical RAM and 4GB 
 of paged memory.
 
 I wrote in the R property windows --sdi --max-mem-size=4094M, 
 but the R itself when it is doing a bayesian modelling (geoR) it 
 stops at 1,096K and i get memory errors because it cannot 
 allocate a new segment of about 500K of memory.

Please read the rw-FAQ.  Windows cannot allocate 4Gb to a user process, 
and unless you have followed the instructions there you are limited to 
2Gb (and probably a bit less).

Also please read the posting guide and report the exact message you got,
as it requests. Unless it says something about memory limits, it is
because the memory could not be obtained from the OS.

 I don't have Visual Basic so i cannot use the other commands 
 suggested in Help.

What has Visual Basic to do with this?

 Also, if i am using memory.size(max=TRUE) i get a value 
 corresponding to about 1024K, and if i am using 
 memory.limit(size=NA) i get a value of about 4000K.
 
 How can i force R to use more memory?

By making it available to R.  Try rebooting your machine before running R, 
to reduce memory fragmentation.

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

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


Re: [R] (no subject)

2004-08-09 Thread Tobias Verbeke
On Mon, 09 Aug 2004 08:01:55 -0300
Paolo Tommasini [EMAIL PROTECTED] wrote:

 Hi ! mu name is Paolo and  I teach statistic in a small college in 
 Brazil and we use Linux. We started to use R as our statitical software. 
 I,ve been trying to use some commands I see in the documentation online 
 but i doesn not work. Commands like
 
 simple.hist.and.boxplot  and  others related with graphing. Do I need a special 
 ppackage ? how do I load it ?
 

This function is probably a function of the package Simple
that accompanies the user-contributed introduction to R simpleR

http://www.math.csi.cuny.edu/Statistics/R/simpleR/index.html

Download the tarball on this webpage 

http://www.math.csi.cuny.edu/Statistics/R/simpleR/Simple_0.4.tar.gz

and install it (as root) as follows:

# R CMD INSTALL Simple_0.4.tar.gz

Then (as a normal user) you can load the package (from within
R using the library() command)

 library(Simple)

to see an example of this simple.hist.and.boxplot() function
do

 example(simple.hist.and.boxplot)

to see the help for it, use

?simple.hist.and.boxplot

For graphics commands you do not need to use contributed
packages. On a standard R installation, a lot is already
available.

See ?hist, ?boxplot, ?plot etc. or the Graphics section
of the R manual An Introduction to R.

HTH,
Tobias

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


Re: [R] looking for graphic functions; was: (no subject)

2004-08-09 Thread Uwe Ligges
Paolo Tommasini wrote:
Hi ! mu name is Paolo and  I teach statistic in a small college in 
Brazil and we use Linux. We started to use R as our statitical software. 
I,ve been trying to use some commands I see in the documentation online 
but i doesn not work. Commands like

simple.hist.and.boxplot  and  others related with graphing. Do I need a 
special ppackage ? how do I load it ?

Please use a sensible subject line (and see the posting guide mentioned 
below).
Where did you find anything about a function simple.hist.and.boxplot?
If you are talking about the online document simpleR by John Verzani, 
I'd suggest to look at the corresponding R package mentioned in that 
document. If it is not in there, either hack it yourself or ask the author.

Have you already looked at ?hist and ?boxplot?
Uwe Ligges

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


[R] linear constraint optim with bounds/reparametrization

2004-08-09 Thread Ingmar Visser
Hello All,

I would like to optimize a (log-)likelihood function subject to a number of
linear constraints between parameters. These constraints are equality
constraints of the form A%*%theta=c, ie (1,1) %*% 0.8,0.2)^t = 1 meaning
that these parameters should sum to one. Moreover, there are bounds on the
individual parameters, in most cases that I am considering parameters are
bound between zero and one because they are probabilities.
My problems/questions are the following:

1) constrOptim does not work in this case because it only fits inequality
constraints, ie A%*%theta  =  c
  ---
As a result when providing starting values constrOptim exits with an error
saying that the initial point is not feasible, which it isn't because it is
not in the interior of the constraint space.

Is there an alternative to constrOptim that can handle such strict
(equality) linear constraints?

2) Another option of course would be to reparametrize the problem as
follows. I will illustrate with an example:

I have parameters:
 p
  [,1]
 [1,]  0.8
 [2,]  0.2
 [3,]  0.2
 [4,]  0.8
 [5,]  0.6
 [6,]  0.1
 [7,]  0.3
 [8,]  0.1
 [9,]  0.3
[10,]  0.6
[11,]  0.5
[12,]  0.5

and the following constraints (all these constraint amount to certain
probabilities summing to one, ie the first two parameters sum to one, the
second pair of parameters  sum to one etc):

 A
 [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12]
[1,]110000000 0 0 0
[2,]001100000 0 0 0
[3,]000011100 0 0 0
[4,]000000011 1 0 0
[5,]000000000 0 1 1

and the bounds on  the constraints are:

 ci
  [,1]
 [1,]1
 [2,]1
 [3,]1
 [4,]1
 [5,]1

The bounds on the parameters are all zero and one. In order to reparametrize
I could use z=ginv(b)%*%(p-ginv(A)%*%cc) with b=Null(t(A)) and optimize z
instead of p using p=ginv(a)%*%ci + b%*%z

My question is however what the bounds on z are?

In the above example z is:
 z
[,1]
[1,] -0.2333
[2,] -0.0333
[3,] -0.57974349
[4,] -0.37974349
[5,] -0.07974349
[6,] -0.18856181
[7,] -0.18856181

which conforms to the constraints, so these values can be used as an intial
estimate. If I knew the bounds on z I could use optim with method=L-BFGS.

I hope this problem is sufficiently clear to elicit response, if not please
let me know.

ingmar

ps: to reproduce above example use the following:

p=matrix(c(0.8, 0.2, 0.20, 0.8, 0.6, 0.1, 0.3, 0.1, 0.3, 0.6, 0.5,
0.5),nc=1)

A = matrix(c(1, 1, 0, 0, 0, 0, 0, 0, 0,  0,  0,  0
, 0, 0, 1, 1, 0, 0, 0, 0, 0,  0,  0,  0
, 0, 0, 0, 0, 1, 1, 1, 0, 0,  0,  0,  0
, 0, 0, 0, 0, 0, 0, 0, 1, 1,  1,  0,  0
, 0, 0, 0, 0, 0, 0, 0, 0, 0,  0,  1,  1),nc=12,byrow=T)

ci=matrix(rep(1,5),nc=1)

b=Null(t(A))

z=ginv(b)%*%(p-ginv(A)%*%cc)

pp=ginv(a)%*%ci + b%*%z

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


[R] URL change for Statistik ETH and web interface to mailing lists.

2004-08-09 Thread Martin Maechler
   [exceptional cross-posting on purpose]

Dear users/readers of our mailing lists,

The following ONLY affects the web interface to our mailing lists. 
This is both for subscription changes and the mailing list archives.

For a long time, our Statistics ETHZ home page has been
available both as
http://www.stat.math.ethz.ch/   [old default]
and http://stat.ethz.ch/[new default]

For several reasons however, the longer URL above has been the
``default'', or the one to which stat.ethz.ch was automagically converted.
This now has finally been switched two hours ago, such that
http://stat.ethz.ch/  is now the official URL in all respects and
http://www.stat.math.ethz.ch/ is just an alias to the new URL
(and it seems to behave strangely just now for me, but that
 should be very temporary).

For existing mailing lists and their web interface, the change
change has to happen ``inside mailman'' (by calling the correct
python script and changing the lists URL explictly) 
once for each list.

I wanted to first announce this widely and do the change in
about 24 hours or so.
You may have to accept the SSL certificate again {and it's not
from a so called trusted agency since that would cost us lots
of money we rather spend differently}.

Regards,

Martin Maechler [EMAIL PROTECTED] http://stat.ethz.ch/~maechler/
Seminar fuer Statistik, ETH Zurich, Switzerland

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


RE: [R] R packages install problems linux - X not found (WhiteBoxEL 3)

2004-08-09 Thread Dr Mike Waters
 I am concerned by your indications of previously having had RH9 on the
 same box and that you had to force an update of the XFree Devel RPM.
 Forcing the installation of an RPM is almost always a bad thing.

 When you installed WB on the system, did you do a clean installation
 or some type of upgrade?

 If the latter, it is reasonable to consider that there may be some level
 of mixing and matching of RPMS from the two distributions going on. This
 could result in a level of marginally or wholly incompatible versions of
 RPMS being installed.

 Could you clarify that point?

 Also, be sure that you have the same versions of the XFree series RPMS
 installed.

 Use:

 rpm -qa | grep XFree

 in a console and be sure that the RPMS return the same version schema.
 If not, it is possible that one of your problems is the mixing of
 versions.

 Take note of the output of the above and be sure that the
 XFree86-Mesa-libGL and XFree86-Mesa-libGLU RPMS are installed as well.

 Some of the messages above would also suggest a problem finding R
 related headers. How did you install R? This may be a red herring of
 sorts, given the other problems, but may be helpful.

 Marc

 __


Marc,

Sorry for the confusion yesterday - in my defence, it was very hot and humid
here in Hampshire (31 Celsius at 15:00hrs and still 25 at 20:00hrs). 

What had happened was that I had done a clean install of WB Linux, including
the XFree86 and other developer packages. However, the on-line updating
system updated the XFree86 packages to a newer sub version. It seems that it
didn't do this correctly for the XFree86 developer package, which was
missing vital files. However it showed up in the rpm database as being
installed (i.e. rpm -qa | grep XFree showed it thus). I downloaded another
rpm for this manually and I only forced the upgrade because it was the same
version as already 'installed' (as far as the rpm database was concerned). I
assumed that all dependencies were sorted out through the install in the
first place.

I only mentioned RH9 to show that I had some familiarity with the RedHat
policy of separating out the 'includes' etc into a separate developer
package.

Once all this had been sorted out, I was then left with a compilation error
which pointed to a missing dependency or similar, which was not due to
missing developer packages, but, as you and Prof Ripley correctly point out,
from the R installation itself. Having grown fat and lazy on using R under
the MS Windows environment, I was struggling to identify the precise nature
of this remaining problem.

As regards the R installation, I did this from the RH9 binary for version
1.9.1, as I did not think that the Fedora Core 2 binary would be appropriate
here. Perhaps I should now compile from the source instead?

Regards

M

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


Re: [R] R Matrix package solve

2004-08-09 Thread Matt Nunes
torsten,
thanks for the mail.  I have reinstalled the Matrix package, but still get 
the same problems.  Any ideas?

matt nunes.
--On 04 August 2004 3:26pm +0200 Torsten Hothorn 
[EMAIL PROTECTED] wrote:

On Wed, 4 Aug 2004, Matt Nunes wrote:
hello.
I have a query about the Matrix package for R.  I wrote some code a while
ago using the Matrix package version 1.6.2 with an early version of R, to
do some linear least squares for regression:
xn
 [,1]  [,2]  [,3]  [,4]
[1,]1 0.7429352 0.5519528 0.4100652
[2,]1 0.7443713 0.5540886 0.4124477
[3,]1 0.7447385 0.5546355 0.4130584
[4,]1 0.7459597 0.5564558 0.4150936

 temp-crossprod(xn)
 temp
 [,1] [,2]  [,3]  [,4]
[1,] 4.00 2.978005 2.2171327 1.6506648
[2,] 2.978005 2.217133 1.6506648 1.2289297
[3,] 2.217133 1.650665 1.2289297 0.9149473
[4,] 1.650665 1.228930 0.9149473 0.6811865

 solve.Matrix(temp,t(xn))
   [,1]  [,2]  [,3]   [,4]
[1,]   33397.34  122081.7 -241005.4   85527.48
[2,]   21063.72 -664920.2  812316.0 -168459.99
[3,] -236935.74 1125548.2 -86.2  -10835.64
[4,]  199314.69 -608045.8  297509.1  111221.72
(Note:  here I used solve.Matrix since the generic solve said the matrix
is singular).
I recently updated my versions of R to 1.9.1 and also the Matrix package,
but I can't seem to get any similar equivalent matrix calculations to
work (I get error messages like .Call function name not in DLL for
package Matrix
this very much looks like a corrupted package installation. Try
to reinstall  `Matrix'
Torsten
or Lapack routine dpotrf returned error code 4).  I have also
tried using symmetric matrix commands, but to no avail. Can anyone help
me out?
many thanks
Matt Nunes

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


RE: [R] linear constraint optim with bounds/reparametrization

2004-08-09 Thread Kahra Hannu
 from Ingmar Visser:

I would like to optimize a (log-)likelihood function subject to a number of
linear constraints between parameters. These constraints are equality
constraints of the form A%*%theta=c, ie (1,1) %*% 0.8,0.2)^t = 1 meaning
that these parameters should sum to one. Moreover, there are bounds on the
individual parameters, in most cases that I am considering parameters are
bound between zero and one because they are probabilities.
My problems/questions are the following:

1) constrOptim does not work in this case because it only fits inequality
constraints, ie A%*%theta  =  c
  ---
I was struggling with the same problem a few weeks ago in the portfolio optimization 
context. You can impose equality constraints by using inequality constraints = and = 
simultaneously. See the example bellow. 

As a result when providing starting values constrOptim exits with an error
saying that the initial point is not feasible, which it isn't because it is
not in the interior of the constraint space.

In constrOptim the feasible region is defined by ui%*%theta-ci =0. My first attempt 
to obtain feasible starting values was based on solving for theta from ui%*%theta = 
ci. Some of the items in the right hand side of the feasible region are, however, very 
often very small negative numbers, and hence, theta is not feasible. Next, I started 
to increase ci by epsilon (a slack variable) and checked if the result was feasible. 
The code is in the example bellow. If ui is not a square matrix, theta is obtained by 
simulation. It is helpfull to know the upper and lower limits of the theta vector. In 
my case they are often [0,1]. Usually only 2-3 simulations are required.

In the example, the weights (parameters) have limits [0,1] such that their sum is 
limited to unity, as in your case. See, how Amat and b0 are defined.

V - matrix(c(0.12,0,0,0,0.21,0,0,0,0.28),3,3)  # variances
Cor - matrix(c(1,0.25,0.25,0.25,1,0.45,0.05,0.45,1),3,3)   # correlations
sigma - t(V)%*%Cor%*%V # covariance matrix
ER - c(0.07,0.12,0.18) # expected returns
Dmat - sigma   # adopted from solve.QP
dvec - rep(0,3)#   
k - 3  # number of assets
reslow - rep(0,k)  # lower limits for 
portfolio weights
reshigh - rep(1,k) # upper limits for 
portfolio weights
pm - 0.10  # target return
  
rfree - 0.05   # risk-free return
risk.aversion - 2.5# risk aversion parameter
### RISKLESS = FALSE; SHORTS = TRUE ; CONSTRAINTS = TRUE 

a1 - rep(1, k)
a2 - as.vector(ER)+rfree  
a3 - matrix(0,k,k)
diag(a3) - 1
Amat - t(rbind(a1, a2, a3, -a3))
b0 - c(1,pm,reslow, -reshigh)

objectf.mean - function(x) # object 
function
{
return(sum(t(x)%*%ER-1/2*risk.aversion*t(x)%*%sigma%*%x)-(t(x)%*%ER-pm)) 
}

# Getting starting values for constrOptim

ui - t(Amat) 
ci - b0
if (dim(ui)[1] == dim(ui)[2]) 
{
test - F
cieps - ci
while(test==F) 
{
theta - qr.solve(ui,cieps)
foo - (ui%*%theta-ci)  # check if the initial values are in 
the feasible area
test - all(foo  0)
if(test==T) initial - theta# initial values for portfolio weights
cieps - cieps+0.1
}
 } 
 if (dim(ui)[1] != dim(ui)[2])  # if Amat is not square, simulate the 
starting values
 {
test - F
i - 1
while(test==F)
{
theta - runif(k, min = 0, max = 1)
foo - (ui%*%theta-ci)
test - all(foo  0)# and check that theta is feasible
if (test == T) initial - theta
i - i+1
}
}

initial

res - constrOptim(initial, objectf.mean, NULL, ui=t(Amat), ci=b0, control = 
list(fnscale=-1))
res$par # portfolio weights (parameters)   
 
y - t(res$par)%*%ER# return on the portfolio
y



I hope this helps.

Hannu Kahra 
Progetti Speciali 
Monte Paschi Asset Management SGR S.p.A. 
Via San Vittore, 37 - 20123 Milano, Italia 
Tel.: +39 02 43828 754 
Mobile: +39 333 876 1558 
Fax: +39 02 43828 247 
E-mail: [EMAIL PROTECTED] 
Web: www.mpsam.it 

Le informazioni trasmesse sono da intendersi per esclusivo uso del destinatario e 
possono contenere informazioni e materiale confidenziale e privilegiato. Qualsiasi 

RE: [R] R packages install problems linux - X not found (WhiteBoxEL 3)

2004-08-09 Thread Marc Schwartz
On Mon, 2004-08-09 at 08:13, Dr Mike Waters wrote:

snip

 Marc,
 
 Sorry for the confusion yesterday - in my defence, it was very hot and humid
 here in Hampshire (31 Celsius at 15:00hrs and still 25 at 20:00hrs). 
 
 What had happened was that I had done a clean install of WB Linux, including
 the XFree86 and other developer packages. However, the on-line updating
 system updated the XFree86 packages to a newer sub version. It seems that it
 didn't do this correctly for the XFree86 developer package, which was
 missing vital files. However it showed up in the rpm database as being
 installed (i.e. rpm -qa | grep XFree showed it thus). I downloaded another
 rpm for this manually and I only forced the upgrade because it was the same
 version as already 'installed' (as far as the rpm database was concerned). I
 assumed that all dependencies were sorted out through the install in the
 first place.

OK, that helps. I still have a lingering concern that, given the facts
above, there may be other integrity issues in the RPM database, if not
elsewhere.

From reading the WB web site FAQ's
(http://www.whiteboxlinux.org/faq.html) , it appears that they are using
up2date/yum for system updates. Depending upon the version in use, there
have been issues especially with up2date (hangs, incomplete updates,
etc.) which could result in other problems. I use yum via the console
here (under FC2), though I note that a GUI version of yum has been
created, including replacing the RHN/up2date system tray alert icon.

A thought relative to this specifically:

If there is or may be an integrity problem related to the rpm database,
you should review the information here:

http://www.rpm.org/hintskinks/repairdb/

which provides instructions on repairing the database. Note the
important caveats regarding backups, etc.

The two key steps there are to remove any residual lock files using (as
root):

rm -f /var/lib/rpm/__*

and then rebuilding the rpm database using (also as root):

rpm -vv --rebuilddb

I think that there needs to be some level of comfort that this basic
foundation for the system is intact and correct.

 I only mentioned RH9 to show that I had some familiarity with the RedHat
 policy of separating out the 'includes' etc into a separate developer
 package.
 
 Once all this had been sorted out, I was then left with a compilation error
 which pointed to a missing dependency or similar, which was not due to
 missing developer packages, but, as you and Prof Ripley correctly point out,
 from the R installation itself. Having grown fat and lazy on using R under
 the MS Windows environment, I was struggling to identify the precise nature
 of this remaining problem.
 
 As regards the R installation, I did this from the RH9 binary for version
 1.9.1, as I did not think that the Fedora Core 2 binary would be appropriate
 here. Perhaps I should now compile from the source instead?

I would not use the FC2 RPM, since FC2 has many underlying changes not
the least of which includes the use of the 2.6 kernel series and the
change from XFree86 to x.org. Both changes resulted in significant havoc
during the FC2 testing phases and there was at least one issue here with
R due to the change in X.

According to the WB FAQs:

If you cannot find a package built specifically for RHEL3 or WBEL3 you
can try a package for RH9 since many of the packages in RHEL3 are the
exact same packages as appeared in RH9.

Thus, it would seem reasonable to use the RH9 RPM that Martyn has
created. An alternative would certainly be to compile R from the source
tarball.

In either case, I would remove the current installation of R and after
achieving a level of comfort that your RPM database is OK, reinstall R
using one of the above methods. Pay close attention to any output during
the installation process, noting any error or warning messages that may
occur.

If you go the RPM route, be sure that the MD5SUM of the RPM file matches
the value that Martyn has listed on CRAN to ensure that the file has
been downloaded in an intact fashion.

These are my thoughts at this point. You need to get to a point where
the underlying system is stable and intact, then get R to the same state
before attempting to install new packages.

HTH,

Marc

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


Re: [R] displaying computation outputs inside for loops

2004-08-09 Thread Thomas Lumley
On Mon, 9 Aug 2004, Dewez Thomas wrote:

 Dear R-users,

 I am puzzled by for loops and am kind of ashamed to ask because it is so
 simple. There must be something I am missing in the way they are executed.


If you want an explanation, rather than just a way to get printing, look
at FAQ 7.18.

-thomas

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


[R] hclust-segmentation fault

2004-08-09 Thread Medvedovic, Mario (medvedm)
I am getting the Segmentation fault when using hclust in R-1.9.1 running
under SuSe 9.0 64-bit kernel on a dual opteron system with 8G of RAM. 
I was wandering if anybody could offer any insight?
Thanks,
mario.

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


[R] built-in Sweave-like documentation in R-2.x

2004-08-09 Thread Khamenia, Valery
Hi devels,

  i did not find at this page:

http://developer.r-project.org/ideas.txt

  any ideas concerning incorporating documentation 
  possibilities (say, Sweave-based) into R-scripts.

  Was it discussed already? 
  (If discussed, then what is the decision/conclusion then?)

thanks,
Valery

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


RE: [R] linear constraint optim with bounds/reparametrization

2004-08-09 Thread Thomas Lumley
On Mon, 9 Aug 2004, Kahra Hannu wrote:

 1) constrOptim does not work in this case because it only fits inequality
 constraints, ie A%*%theta  =  c
   --- I was struggling with the same problem a
 few weeks ago in the portfolio optimization context. You can impose
 equality constraints by using inequality constraints = and =
 simultaneously. See the example bellow.


Ick. You do not want to use constrOptim for equality constraints.
constrOptim is a log-barrier interior-point method, meaning that it adds
a multiple of log(A%*%theta-c) to the objective function. This is a really
bad idea as a way of faking equality constraints.

Use Lagrange multipliers and optim.

-thomas

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


[R] log-linear contrasts

2004-08-09 Thread Christoph Scherber
Dear list members,
suppose I have a one-way ANOVA where the explanatory variable is of 
class ordered(). How can I define, instead of the default linear, 
quadratic, cubic contrasts, a set of log-linear contrasts corresponding 
to logb(c(1,2,4,8,16,60)+1,2) ?

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


Re: [R] built-in Sweave-like documentation in R-2.x

2004-08-09 Thread Deepayan Sarkar
On Monday 09 August 2004 09:52, Khamenia, Valery wrote:
 Hi devels,

   i did not find at this page:

 http://developer.r-project.org/ideas.txt

   any ideas concerning incorporating documentation
   possibilities (say, Sweave-based) into R-scripts.

   Was it discussed already?
   (If discussed, then what is the decision/conclusion then?)

See the 'Writing R Extensions' manual, specifically 

Creating R Packages - Writing package vignettes

HTH,

Deepayan

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


RE: [R] R packages install problems linux - X not found (WhiteBoxEL 3)

2004-08-09 Thread Martyn Plummer
On Sun, 2004-08-08 at 22:22, Prof Brian Ripley wrote:
 On Sun, 8 Aug 2004, Marc Schwartz wrote:
 
  On Sun, 2004-08-08 at 14:10, Dr Mike Waters wrote:
  
  snip
  
   Thanks for the responses guys.
   
   I used to have RH9 installed on this machine and I found out about the
   separate developer packages then. I thought that I had got the relevant
   XFree devel package installed, but although it showed up in the rpm database
   as being present, the required files were not present. I did a forced rpm
   upgrade from the WhiteBox updates directory and that problem is now fixed,
   at least for car. Marc, thanks for the pointer on the rgl problem. However,
   I have a slightly different problem with the install of this package. It
   gets through to the point where it tries to make the rgl.so from the various
   .o files and fails then, as follows:
   
   
   
   g++ -I/usr/lib/R/include -I/usr/X11R6/include -DHAVE_PNG_H
   -I/usr/include -I/usr/local/include  -Wall -pedantic -fno-exceptions
   -fno-rtti -fPIC  -O2 -g -march=i386 -mcpu=i686 -c glgui.cpp -o glgui.o
   
   g++  -L/usr/local/lib -o rgl.so x11lib.o x11gui.o types.o math.o fps.o
   pixmap.o gui.o api.o device.o devicemanager.o rglview.o scene.o glgui.o
   -L/usr/X11R6/lib -L/usr/lib -lstdc++ -lX11 -lXext -lGL -lGLU -lpng
   /usr/lib/gcc-lib/i386-redhat-linux/3.2.3/../../../crt1.o(.text+0x18): In
   function `_start':
   : undefined reference to `main'
   x11lib.o(.text+0x84): In function `set_R_handler':
   /tmp/R.INSTALL.13414/rgl/src/x11gui.h:33: undefined reference to
   `R_InputHandlers'
   x11lib.o(.text+0x92):/tmp/R.INSTALL.13414/rgl/src/x11gui.h:33: undefined
   reference to `addInputHandler'
   x11lib.o(.text+0xfb): In function `unset_R_handler':
   /tmp/R.INSTALL.13414/rgl/src/x11lib.cpp:52: undefined reference to
   `R_InputHandlers'
   x11lib.o(.text+0x103):/tmp/R.INSTALL.13414/rgl/src/x11lib.cpp:52:
   undefined reference to `removeInputHandler'
   collect2: ld returned 1 exit status
   make: *** [rgl.so] Error 1
   ERROR: compilation failed for package 'rgl'
   ** Removing '/usr/lib/R/library/rgl'
   
   -
   
   No doubt another failed dependency... DOH!
   
   Regards
  
  
  I am concerned by your indications of previously having had RH9 on the
  same box and that you had to force an update of the XFree Devel RPM.
  Forcing the installation of an RPM is almost always a bad thing.
  
  When you installed WB on the system, did you do a clean installation
  or some type of upgrade?
  
  If the latter, it is reasonable to consider that there may be some level
  of mixing and matching of RPMS from the two distributions going on. This
  could result in a level of marginally or wholly incompatible versions of
  RPMS being installed.
  
  Could you clarify that point?
  
  Also, be sure that you have the same versions of the XFree series RPMS
  installed.
  
  Use:
  
  rpm -qa | grep XFree
  
  in a console and be sure that the RPMS return the same version schema.
  If not, it is possible that one of your problems is the mixing of
  versions.
  
  Take note of the output of the above and be sure that the
  XFree86-Mesa-libGL and XFree86-Mesa-libGLU RPMS are installed as well.
  
  Some of the messages above would also suggest a problem finding R
  related headers. How did you install R? This may be a red herring of
  sorts, given the other problems, but may be helpful.
 
 I think it is the exact point.  Those entry points are in R.bin, 
 so should be missing.  The g++ line is missing `-shared', which is picked 
 up from R_HOME/etc/Makeconf, specifically from
 
 SHLIB_CXXLDFLAGS = -shared
 
 So the R installation doesn't have the right flags.

This could be my fault. It transpires that this is not set correctly in
the RPMs for RH9 and 8.x.  I will look into it (this is most probably
due to a missing BuildRequires).  This isn't the first time someone has
had this problem. I apologize for not fixing it, but at the time I was
convinced the RPMS were OK.

Martyn

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


Re: [R] hclust-segmentation fault

2004-08-09 Thread Martin Maechler
 MarioM == Medvedovic, Mario (medvedm) [EMAIL PROTECTED]
 on Mon, 9 Aug 2004 10:47:16 -0400  writes:

MarioM I am getting the Segmentation fault when using
MarioM hclust in R-1.9.1 running under SuSe 9.0 64-bit
MarioM kernel on a dual opteron system with 8G of RAM.  I
MarioM was wandering if anybody could offer any insight?

{ where will you get when wandering around?  :-) }

I have seen other problematic behavior on a 64-bit kernel Linux
on the Opteron though not with SuSE and only with R-devel (R-2.0.0-unstable)

Can you give a reproducible example please
(as the posting guide asks you to)?

Martin Maechler

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


Re: [R] hclust-segmentation fault

2004-08-09 Thread Prof Brian Ripley
On Mon, 9 Aug 2004, Medvedovic, Mario (medvedm) wrote:

 I am getting the Segmentation fault when using hclust in R-1.9.1 running
 under SuSe 9.0 64-bit kernel on a dual opteron system with 8G of RAM. 
 I was wandering if anybody could offer any insight?

Please try to use the debugger to supply more information, or give us some 
code we can reproduce on a similar system to see if we can reproduce the 
segfault.

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

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


Re: [R] built-in Sweave-like documentation in R-2.x

2004-08-09 Thread Ulises Mora Alvarez
Hi!

I'm not a developer, but you can take a look at the article 

Sweave, Part II: Package Vignettes 

in R-news Vol. 3/2, October 2003.

Regards.

On Mon, 9 Aug 2004, Khamenia, Valery wrote:

 Hi devels,
 
   i did not find at this page:
 
 http://developer.r-project.org/ideas.txt
 
   any ideas concerning incorporating documentation 
   possibilities (say, Sweave-based) into R-scripts.
 
   Was it discussed already? 
   (If discussed, then what is the decision/conclusion then?)
 
 thanks,
 Valery
 
 __
 [EMAIL PROTECTED] mailing list
 https://www.stat.math.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
 

-- 
Ulises M. Alvarez
LAB. DE ONDAS DE CHOQUE
FISICA APLICADA Y TECNOLOGIA AVANZADA
UNAM
-u-m-a-l-v-a-r-e-z- at -f-a-t-a- dot -u-n-a-m- dot -m-x-

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


Re: [R] (REPOST) Simple main effects in 2-way repeated measure ANOVA

2004-08-09 Thread Giuseppe Pagnoni
Dear Prof. Ripley
I am sorry that reposting the mail was perceived as not complying to the 
correct list etiquette: I do not usually frequent the list and I just 
thought that the message went unnoticed.  I apologize for the insistence.

On the subject matter of the e-mail, yes, there was a typo, the error 
term was indeed Error(Subj/Time).  But I am still interested in 
examining the simple main effects, when the interaction of Time and 
Group is significant:

Time:
--
ControlGroup: before vs after
TreatmentGroup: before vs after
Group:
--
Before:  ControlGroup vs TreatmentGroup
After: ControlGroup vs TreatmentGroup
Is this incorrect statistical praxis?  Other software packages display 
the results for the above tests after the ANOVA.  However, I couldn't 
find a simple way to extract this information in R.

Also, I am not sure how to include a confounding variable, like Age, in 
the formulation of the model.

Thanks for your help
   giuseppe


Prof Brian Ripley wrote:
Why has this been REPOSTed?  It was delivered last Thursday.
On Sun, 8 Aug 2004, Giuseppe Pagnoni wrote:
 

I am running a 2-way repeated measure anova with 1 between-subjects 
factor (Group=treatment, control), and 1 within-subject factor (Time of 
measurement: time1, time2).  I extract the results of the anova with:

summary(aov(effect ~ Group*Time + Error=Subj/Time, data=mydata))
   

That's not valid syntax for an R formula. Did you mean Error(Subj/Time)?
 

Now, this must be clearly a dumb question, but how can I quickly 
extract in R all the post-hoc t-tests for the simple main effects?
   

I very much hope you cannot, as you have specified an interaction, and
you should not want t-tests for main effects in the presence of an 
interaction, and certainly not with the default R coding.

Did you mean Group + Time?
 

Also, while I am at it, how do I enter in the model a counfounding 
covariate (e.g., Age)?

And on a different matter, is there a way to receive interactive user 
input in an R script? Something like Enter the name of  the factor:  
, or even more simply Press Enter to see the result of the next 
analysis
   

?readline, or cat + scan or ... using connections.
 


--

Giuseppe Pagnoni, Ph.D.
Dept. of Psychiatry and Behavioral Sciences
1639 Pierce Drive, Suite 4000
WMB Bldg., Atlanta, GA 30322, U.S.
phone: 404-712-8431
fax: 404-727-3233
e-mail: [EMAIL PROTECTED]
__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


AW: [R] built-in Sweave-like documentation in R-2.x

2004-08-09 Thread Khamenia, Valery
 See the 'Writing R Extensions' manual, specifically 
 Creating R Packages - Writing package vignettes

thank you, i saw this entry. However, this entry is rather 
about how to include documents (in particular Sweave-based) 
into a package. But I have meant smth else.

Let me explain in example. Today I use emacs as 
environment for my R-sessions. I am quite happy to 
use Sweave, but not happy, that there is no good 
possibility to run some selected *part* of the R-code.
Indeed, the R-chunks are alternated with 
Latex-chunks in Sweave. So, if one would like to 
execute, say, three consequent R-chunks (C-c C-r in ESS-mode), 
then the corresponding Latex-chunks between the 
R-chunks will cause side-effects. Actually, it is
because neither ESS nor R could accept Latex-chunks
and the markup symbols of Sweave. This makes interactive 
work in .Rnw files not fully convenient.

Making the above short: would it be a bad idea to
allow Latex-friendly documentation chunks in 
R-language?

Thank you.

P.S. I am sorry if i missed something well-known 
concerning the subj.
--
Valery.

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


RE: [R] hclust-segmentation fault

2004-08-09 Thread Medvedovic, Mario (medvedm)
Well, the use of debugger will take some time, but here is a simple code
that invariably causes the fault. 
Mario.

indata-matrix(rnorm(1000,0,1),ncol=10)
ed-dist(indata)
hc.e-hclust(ed,average)


-Original Message-
From: Prof Brian Ripley [mailto:[EMAIL PROTECTED]
Sent: Monday, August 09, 2004 11:14 AM
To: Medvedovic, Mario (medvedm)
Cc: '[EMAIL PROTECTED]'
Subject: Re: [R] hclust-segmentation fault


On Mon, 9 Aug 2004, Medvedovic, Mario (medvedm) wrote:

 I am getting the Segmentation fault when using hclust in 
R-1.9.1 running
 under SuSe 9.0 64-bit kernel on a dual opteron system with 
8G of RAM. 
 I was wandering if anybody could offer any insight?

Please try to use the debugger to supply more information, or 
give us some 
code we can reproduce on a similar system to see if we can 
reproduce the 
segfault.

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


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


Re: [R] built-in Sweave-like documentation in R-2.x

2004-08-09 Thread A.J. Rossini

What exactly do you mean by this?

1. generation of Sweave-style docs from R programs or interaction?  A
related approach is the reviveable statistical analysis (the
authors/researchers will have to forgive me for not recalling the WWW
site or their Uni!)

2. tools for doing docs and analysis at the same time?  Emacs Speaks
Statistics has supported this with R since last century (1997 or so).

3. the vignettes of Bioconductor?

4. a text book in line with the above?

best,
-tony


Khamenia, Valery [EMAIL PROTECTED] writes:

 Hi devels,

   i did not find at this page:

 http://developer.r-project.org/ideas.txt

   any ideas concerning incorporating documentation 
   possibilities (say, Sweave-based) into R-scripts.

   Was it discussed already? 
   (If discussed, then what is the decision/conclusion then?)

 thanks,
 Valery

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


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

CONFIDENTIALITY NOTICE: This e-mail message and any attachme...{{dropped}}

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


Re: AW: [R] built-in Sweave-like documentation in R-2.x

2004-08-09 Thread Deepayan Sarkar
On Monday 09 August 2004 10:23, Khamenia, Valery wrote:
  See the 'Writing R Extensions' manual, specifically
  Creating R Packages - Writing package vignettes

 thank you, i saw this entry. However, this entry is rather
 about how to include documents (in particular Sweave-based)
 into a package. But I have meant smth else.

 Let me explain in example. Today I use emacs as
 environment for my R-sessions. I am quite happy to
 use Sweave, but not happy, that there is no good
 possibility to run some selected *part* of the R-code.
 Indeed, the R-chunks are alternated with
 Latex-chunks in Sweave. So, if one would like to
 execute, say, three consequent R-chunks (C-c C-r in ESS-mode),
 then the corresponding Latex-chunks between the
 R-chunks will cause side-effects. Actually, it is
 because neither ESS nor R could accept Latex-chunks
 and the markup symbols of Sweave. This makes interactive
 work in .Rnw files not fully convenient.

Is selecting and 'C-c C-r'-ing the 3 chunks separately that bad?

The pieces for what you want are there. You can use Stangle() on a 
Sweave format file to extract the R code chunks. In your usage, a crude 
implementation would involve writing your selection to a file, running 
Stangle on it, and source()-ing the resulting .R file. 

Others may have better suggestions.

Deepayan

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


RE: [R] hclust-segmentation fault

2004-08-09 Thread Prof Brian Ripley
On Mon, 9 Aug 2004, Medvedovic, Mario (medvedm) wrote:

 Well, the use of debugger will take some time, but here is a simple code
 that invariably causes the fault. 
 Mario.
 
 indata-matrix(rnorm(1000,0,1),ncol=10)
 ed-dist(indata)
 hc.e-hclust(ed,average)

Works fine on R 1.9.1 on our dual Opteron 248 under FC2.

We know of some pertinent compiler bugs on x86_64, so is this gcc 3.3.3 
or later?

 -Original Message-
 From: Prof Brian Ripley [mailto:[EMAIL PROTECTED]
 Sent: Monday, August 09, 2004 11:14 AM
 To: Medvedovic, Mario (medvedm)
 Cc: '[EMAIL PROTECTED]'
 Subject: Re: [R] hclust-segmentation fault
 
 
 On Mon, 9 Aug 2004, Medvedovic, Mario (medvedm) wrote:
 
  I am getting the Segmentation fault when using hclust in 
 R-1.9.1 running
  under SuSe 9.0 64-bit kernel on a dual opteron system with 
 8G of RAM. 
  I was wandering if anybody could offer any insight?
 
 Please try to use the debugger to supply more information, or 
 give us some 
 code we can reproduce on a similar system to see if we can 
 reproduce the 
 segfault.
 
 -- 
 Brian D. Ripley,  [EMAIL PROTECTED]
 Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
 University of Oxford, Tel:  +44 1865 272861 (self)
 1 South Parks Road, +44 1865 272866 (PA)
 Oxford OX1 3TG, UKFax:  +44 1865 272595
 
 
 __
 [EMAIL PROTECTED] mailing list
 https://www.stat.math.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
 
 

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

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


Re: [R] R packages install problems linux - X not found (WhiteBoxEL 3)

2004-08-09 Thread Muhammad Subianto
Maybe you can try with the other RHEL clone like CentOS-3:
http://install.linux.duke.edu/pub/linux/add-on/distrib/centos-3.1/i386/rpms/R-1.9.0-0.duke.1.el3.i386.rpm
http://install.linux.duke.edu/pub/linux/add-on/distrib/centos-3.1/i386/srpms/R-1.9.0-0.duke.1.el3.src.rpm
Best wishes,
Muhammad Subianto
On this day 09/08/2004 04:12 PM, Marc Schwartz wrote:
On Mon, 2004-08-09 at 08:13, Dr Mike Waters wrote:
snip
Marc,
Sorry for the confusion yesterday - in my defence, it was very hot and humid
here in Hampshire (31 Celsius at 15:00hrs and still 25 at 20:00hrs). 

What had happened was that I had done a clean install of WB Linux, including
the XFree86 and other developer packages. However, the on-line updating
system updated the XFree86 packages to a newer sub version. It seems that it
didn't do this correctly for the XFree86 developer package, which was
missing vital files. However it showed up in the rpm database as being
installed (i.e. rpm -qa | grep XFree showed it thus). I downloaded another
rpm for this manually and I only forced the upgrade because it was the same
version as already 'installed' (as far as the rpm database was concerned). I
assumed that all dependencies were sorted out through the install in the
first place.

OK, that helps. I still have a lingering concern that, given the facts
above, there may be other integrity issues in the RPM database, if not
elsewhere.
From reading the WB web site FAQ's
(http://www.whiteboxlinux.org/faq.html) , it appears that they are using
up2date/yum for system updates. Depending upon the version in use, there
have been issues especially with up2date (hangs, incomplete updates,
etc.) which could result in other problems. I use yum via the console
here (under FC2), though I note that a GUI version of yum has been
created, including replacing the RHN/up2date system tray alert icon.
A thought relative to this specifically:
If there is or may be an integrity problem related to the rpm database,
you should review the information here:
http://www.rpm.org/hintskinks/repairdb/
which provides instructions on repairing the database. Note the
important caveats regarding backups, etc.
The two key steps there are to remove any residual lock files using (as
root):
rm -f /var/lib/rpm/__*
and then rebuilding the rpm database using (also as root):
rpm -vv --rebuilddb
I think that there needs to be some level of comfort that this basic
foundation for the system is intact and correct.

I only mentioned RH9 to show that I had some familiarity with the RedHat
policy of separating out the 'includes' etc into a separate developer
package.
Once all this had been sorted out, I was then left with a compilation error
which pointed to a missing dependency or similar, which was not due to
missing developer packages, but, as you and Prof Ripley correctly point out,
from the R installation itself. Having grown fat and lazy on using R under
the MS Windows environment, I was struggling to identify the precise nature
of this remaining problem.
As regards the R installation, I did this from the RH9 binary for version
1.9.1, as I did not think that the Fedora Core 2 binary would be appropriate
here. Perhaps I should now compile from the source instead?

I would not use the FC2 RPM, since FC2 has many underlying changes not
the least of which includes the use of the 2.6 kernel series and the
change from XFree86 to x.org. Both changes resulted in significant havoc
during the FC2 testing phases and there was at least one issue here with
R due to the change in X.
According to the WB FAQs:
If you cannot find a package built specifically for RHEL3 or WBEL3 you
can try a package for RH9 since many of the packages in RHEL3 are the
exact same packages as appeared in RH9.
Thus, it would seem reasonable to use the RH9 RPM that Martyn has
created. An alternative would certainly be to compile R from the source
tarball.
In either case, I would remove the current installation of R and after
achieving a level of comfort that your RPM database is OK, reinstall R
using one of the above methods. Pay close attention to any output during
the installation process, noting any error or warning messages that may
occur.
If you go the RPM route, be sure that the MD5SUM of the RPM file matches
the value that Martyn has listed on CRAN to ensure that the file has
been downloaded in an intact fashion.
These are my thoughts at this point. You need to get to a point where
the underlying system is stable and intact, then get R to the same state
before attempting to install new packages.
HTH,
Marc
__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: AW: [R] built-in Sweave-like documentation in R-2.x

2004-08-09 Thread A.J. Rossini
If you name chunks that should be run together the same thing
(i.e. similar to how Noweb suggests that you should create documents),
then ess-eval-thread will evaluate  all chunks in the thread
(i.e. that noweb would have sent to the same file upon tangling).

This is similar to the ess-eval-chunk  ESS function.


Khamenia, Valery [EMAIL PROTECTED] writes:

 See the 'Writing R Extensions' manual, specifically 
 Creating R Packages - Writing package vignettes

 thank you, i saw this entry. However, this entry is rather 
 about how to include documents (in particular Sweave-based) 
 into a package. But I have meant smth else.

 Let me explain in example. Today I use emacs as 
 environment for my R-sessions. I am quite happy to 
 use Sweave, but not happy, that there is no good 
 possibility to run some selected *part* of the R-code.
 Indeed, the R-chunks are alternated with 
 Latex-chunks in Sweave. So, if one would like to 
 execute, say, three consequent R-chunks (C-c C-r in ESS-mode), 
 then the corresponding Latex-chunks between the 
 R-chunks will cause side-effects. Actually, it is
 because neither ESS nor R could accept Latex-chunks
 and the markup symbols of Sweave. This makes interactive 
 work in .Rnw files not fully convenient.

 Making the above short: would it be a bad idea to
 allow Latex-friendly documentation chunks in 
 R-language?

 Thank you.

 P.S. I am sorry if i missed something well-known 
 concerning the subj.
 --
 Valery.

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


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

CONFIDENTIALITY NOTICE: This e-mail message and any attachme...{{dropped}}

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


Re: AW: [R] built-in Sweave-like documentation in R-2.x

2004-08-09 Thread A.J. Rossini
Deepayan Sarkar [EMAIL PROTECTED] writes:


 Is selecting and 'C-c C-r'-ing the 3 chunks separately that bad?

Yes.  The UI should take care of it for him.

 Others may have better suggestions.

A bit more work on the chunk evaluation approach within Emacs is one;
it almost does what is needed, but not quite.  

best,
-tony

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

CONFIDENTIALITY NOTICE: This e-mail message and any attachme...{{dropped}}

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


Follow-up Q Re: [R] displaying computation outputs inside for loops

2004-08-09 Thread Dave Atkins
I have a somewhat related question.  A while back I was doing some simulations 
using for() loops, and I wanted to keep track of the iterations using a line of 
code quite similar to what Dimitris presented below.  Instead of printing the 
iteration message at the end of each iteration (actually, at the end of every 
100th), nothing was printed until the for() loop was complete, and *then* all 
the iteration messages were reported.  Extending Dimitris' example:

for(i in 1:1){
  x - rnorm(5)
  cat(the values of `x' are:, format(x), \n)
  cat(computation, i, finished\n\n)
}
demonstrates what I'm referring to (using R v1.9.1 with Windows XP): Iterations 
are not printed as they occur, only at the end of the for() loop computation.

An interesting wrinkle is that I sometimes use Emacs (and ESS).  Running the 
code from within Emacs prints the iterations as they occur; also, if I switch to 
other programs and then back to R, iterations have been printed.

Can anybody help me out with what's going on (and how to print iterations from 
within a for() loop as they occur)?

Thanks, Dave
Dave Atkins, PhD
University of Washington
Message: 28
Date: Mon, 9 Aug 2004 11:26:08 +0200
From: Dimitris Rizopoulos [EMAIL PROTECTED]
Subject: Re: [R] displaying computation outputs inside for loops
To: Dewez Thomas [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Message-ID: [EMAIL PROTECTED]
Content-Type: text/plain;   charset=iso-8859-1
Hi Thomas,
is this what you would like to get,
for(i in 1:3){
  x - rnorm(5)
  cat(the values of `x' are:, format(x), \n)
  cat(computation, i, finished\n\n)
}
for(i in 1:3) print(i)
I hope this helps.
Best,
Dimitris

Dimitris Rizopoulos
Doctoral Student
Biostatistical Centre
School of Public Health
Catholic University of Leuven
Address: Kapucijnenvoer 35, Leuven, Belgium
Tel: +32/16/396887
Fax: +32/16/337015
Web: http://www.med.kuleuven.ac.be/biostat/
 http://www.student.kuleuven.ac.be/~m0390867/dimitris.htm
- Original Message -
From: Dewez Thomas [EMAIL PROTECTED]
To: 'R mailing list' [EMAIL PROTECTED]
Sent: Monday, August 09, 2004 11:15 AM
Subject: [R] displaying computation outputs inside for loops

 Dear R-users,

 I am puzzled by for loops and am kind of ashamed to ask because it
is so
 simple. There must be something I am missing in the way they are
executed.

 Basically, I would like to iterate a given number of time and
generate a
 bunch of stats (that's what loops are designed for, right?). Before
doing
 this I simply want to test simple procedure and see if they work (ie
got the
 syntax right - my main problem as I am new to R - and produce
expected
 results).

 Even for something as basic as
 for (i in 1:3) {i}

 I get no screen output. Shouldn't R systematically display i for
every loop
 just like I am requesting with invoking i? When checking at the
end of the
 looping, i is indeed assigned to 5 but I cannot get intermediate
values.

 Further testing shows that i takes all the values in turn.

  for (i in 1:3) {str(i)}

  int 1
  int 2
  int 3

 but summary(i) doesn't display anything. Isn't there something weird
with
 this? Am I expecting something wrong and for loops just don't work
that way,
 unless using str() command? I tried print() and other descriptive
commands
 but to no avail.

 A quick explanation would be grately appreciated

 Thomas
 ***
 Le contenu de cet e-mail et de ses pièces jointes est
destin...{{dropped}}

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


[R] Approaches to using RUnit

2004-08-09 Thread Seth Falcon
Having used JUnit and PyUnit, I was pleased to see the release of the
RUnit package on CRAN.

I'm wondering if there are any RUnit users out there that would be
willing to share some tips on how they organize their code to work with
RUnit.

Specifically, I'm wondering about the best way to load/import/source the
functions to be tested.  I would like to end up with a script, testall
or some such, that allows me to run all the unit tests in a given
directory.


One way I've thought about looks like:

myfunc.R
--
# some functions here
--

runit_myfunc.R
--
source(myfunc.R)

# test function here
--


+ seth

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


RE: [R] hclust-segmentation fault

2004-08-09 Thread Martin Maechler
 MarioM == Medvedovic, Mario (medvedm) [EMAIL PROTECTED]
 on Mon, 9 Aug 2004 11:31:45 -0400  writes:

MarioM Well, the use of debugger will take some time
well
did you try

R -d gdb

... GDB welcome messages
... GDB welcome messages

run

and then the R commands and after the segmentation fault, simply
bt
{ = 'backtrace' =^=  traceback() in R }
?

MarioM but here is a simple code that invariably causes the
MarioM fault.  Mario.

 indata - matrix(rnorm(1000,0,1),ncol=10)
 ed - dist(indata)
 hc.e - hclust(ed,average)

to make this really reproducible you'd have to give a 
set.seed(n)
at the beginning. But since you say it's invariably, that's ok.
As for Prof Ripley's, these R calls also work here on our Opteron
machine w/o a problem.

Martin Maechler


 -Original Message- From: Prof Brian Ripley
 [mailto:[EMAIL PROTECTED] Sent: Monday, August 09,
 2004 11:14 AM To: Medvedovic, Mario (medvedm) Cc:
 '[EMAIL PROTECTED]' Subject: Re: [R]
 hclust-segmentation fault
 
 
 On Mon, 9 Aug 2004, Medvedovic, Mario (medvedm) wrote:
 
 I am getting the Segmentation fault when using hclust
 in
 R-1.9.1 running
 under SuSe 9.0 64-bit kernel on a dual opteron system
 with
 8G of RAM.
 I was wandering if anybody could offer any insight?
  Please try to use the debugger to supply more
 information, or give us some code we can reproduce on a
 similar system to see if we can reproduce the segfault.
 
 -- 
 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, UK Fax:
 +44 1865 272595
 

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

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


Re: Follow-up Q Re: [R] displaying computation outputs inside for loops

2004-08-09 Thread Prof Brian Ripley
On Mon, 9 Aug 2004, Dave Atkins wrote:

 
 I have a somewhat related question.  A while back I was doing some simulations 
 using for() loops, and I wanted to keep track of the iterations using a line of 
 code quite similar to what Dimitris presented below.  Instead of printing the 
 iteration message at the end of each iteration (actually, at the end of every 
 100th), nothing was printed until the for() loop was complete, and *then* all 
 the iteration messages were reported.  Extending Dimitris' example:
 
 for(i in 1:1){
x - rnorm(5)
cat(the values of `x' are:, format(x), \n)
cat(computation, i, finished\n\n)
 }
 
 demonstrates what I'm referring to (using R v1.9.1 with Windows XP): Iterations 
 are not printed as they occur, only at the end of the for() loop computation.

This *is* in the rw-FAQ.  Please see the posting guide.

 An interesting wrinkle is that I sometimes use Emacs (and ESS).  Running the 
 code from within Emacs prints the iterations as they occur; also, if I switch to 
 other programs and then back to R, iterations have been printed.
-- 
Brian D. Ripley,  [EMAIL PROTECTED]
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford, Tel:  +44 1865 272861 (self)
1 South Parks Road, +44 1865 272866 (PA)
Oxford OX1 3TG, UKFax:  +44 1865 272595

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


Re: [R] Approaches to using RUnit

2004-08-09 Thread A.J. Rossini
Seth Falcon [EMAIL PROTECTED] writes:

 Having used JUnit and PyUnit, I was pleased to see the release of the
 RUnit package on CRAN.

 I'm wondering if there are any RUnit users out there that would be
 willing to share some tips on how they organize their code to work with
 RUnit.

 Specifically, I'm wondering about the best way to load/import/source the
 functions to be tested.  I would like to end up with a script, testall
 or some such, that allows me to run all the unit tests in a given
 directory.

Hi Seth -

The version that I was working on (before the other folks released a
less eclectic and more functional/general package) had a

 testrunner(test=c(list,of,functions),testall=FALSE)

API, along with a preliminary tcltk 

 GUIrunner() 

with a similar intended API.  I've been trying to find the initiative
to integrate (overlay) those tools with the current RUnit as an
add-on, but the difference is that I attached tests as S4 object
instantiations.

Stop by if you want to chat a bit about it.

best,
-tony

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

CONFIDENTIALITY NOTICE: This e-mail message and any attachme...{{dropped}}

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


Re: [R] linear constraint optim with bounds/reparametrization

2004-08-09 Thread Spencer Graves
Hi, Tom: 

 Why is adding a multiple of log(A*theta-c) to the objective 
function ... a really bad idea as a way of faking equality constraints? 

 I've used Lagrange multipliers on other occasions, but if computer 
time is cheaper than the time to work out the Lagrange multiplier 
approach, why is it a bad idea to add violation of constraints to the 
objective function?  I've done it myself in the past and have gotten 
what looked like sensible results. 

 Best Wishes,
 spencer graves
Thomas Lumley wrote:
On Mon, 9 Aug 2004, Kahra Hannu wrote:
 

1) constrOptim does not work in this case because it only fits inequality
constraints, ie A%*%theta  =  c
 

 --- I was struggling with the same problem a
few weeks ago in the portfolio optimization context. You can impose
equality constraints by using inequality constraints = and =
simultaneously. See the example bellow.
   

Ick. You do not want to use constrOptim for equality constraints.
constrOptim is a log-barrier interior-point method, meaning that it adds
a multiple of log(A%*%theta-c) to the objective function. This is a really
bad idea as a way of faking equality constraints.
Use Lagrange multipliers and optim.
-thomas
__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
 

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


RE: [R] R packages install problems linux - X not found (WhiteBoxEL 3)

2004-08-09 Thread Martyn Plummer
On Mon, 2004-08-09 at 15:13, Dr Mike Waters wrote:

  [SNIP]

 Once all this had been sorted out, I was then left with a compilation error
 which pointed to a missing dependency or similar, which was not due to
 missing developer packages, but, as you and Prof Ripley correctly point out,
 from the R installation itself. Having grown fat and lazy on using R under
 the MS Windows environment, I was struggling to identify the precise nature
 of this remaining problem.
 
 As regards the R installation, I did this from the RH9 binary for version
 1.9.1, as I did not think that the Fedora Core 2 binary would be appropriate
 here. Perhaps I should now compile from the source instead?

The Red Hat 9 RPM is appropriate for you, but it is currently buggy, so
you are best compiling from source.  I need to add gcc-g++ to the list
of BuildRequires (packages that must be installed at build time). 
This isn't strictly necessary to build R, but if R is configured without
a C++ compiler, of course it does not know how to build packages with
C++ code in them.

Martyn

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


Re: Follow-up Q Re: [R] displaying computation outputs inside for loops

2004-08-09 Thread Dave Atkins
I have now been enlightened via Windows FAQ 6.2 on When using Rgui the output 
to the console seems to be delayed.  Ctrl-W toggles whether console output is 
buffered.

[As a side note: Damn!  I was hoping to avoid that response (i.e., having my 
ignorance pointed out), but all my searches of R-help and FAQs had focused on 
for() and iteration, which didn't find the right answer.  Knowing the 
right question to ask goes a long way...]

Thanks, Dave
Prof Brian Ripley wrote:
On Mon, 9 Aug 2004, Dave Atkins wrote:

I have a somewhat related question.  A while back I was doing some simulations 
using for() loops, and I wanted to keep track of the iterations using a line of 
code quite similar to what Dimitris presented below.  Instead of printing the 
iteration message at the end of each iteration (actually, at the end of every 
100th), nothing was printed until the for() loop was complete, and *then* all 
the iteration messages were reported.  Extending Dimitris' example:

for(i in 1:1){
  x - rnorm(5)
  cat(the values of `x' are:, format(x), \n)
  cat(computation, i, finished\n\n)
}
demonstrates what I'm referring to (using R v1.9.1 with Windows XP): Iterations 
are not printed as they occur, only at the end of the for() loop computation.

This *is* in the rw-FAQ.  Please see the posting guide.

An interesting wrinkle is that I sometimes use Emacs (and ESS).  Running the 
code from within Emacs prints the iterations as they occur; also, if I switch to 
other programs and then back to R, iterations have been printed.
__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] FAQs (was: displaying computation outputs inside for loops)

2004-08-09 Thread Thomas Lumley
On Mon, 9 Aug 2004, Dave Atkins wrote:
 [As a side note: Damn!  I was hoping to avoid that response (i.e., having my
 ignorance pointed out), but all my searches of R-help and FAQs had focused on
 for() and iteration, which didn't find the right answer.  Knowing the
 right question to ask goes a long way...]

This illustrates why reading the FAQs is a useful thing to do. You can
find these things out before they cause problems for you (that is, you
all, not specifically Dave).

With help pages and the email archives it can be difficult to find the
right index terms. The FAQs are short enough that you can just read the
whole thing, and the answer is likely to be clearer and more detailed than
you will get from asking the question again. (If it isn't, then asking
can someone clear up this question about FAQ 7.13? is likely to get
useful help).


-thomas

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


[R] Simultaneous subscripts and superscripts

2004-08-09 Thread Brian Beckage
Dear List,
I'd like to add text to a plot where a text symbol has both a 
superscript and subscript.  For example, the variable S with a 
superscript 2 and a subscript t.  I have been able to accomplish this 
using either

expression( paste(S,atop(scriptstyle(2),scriptstyle(t))) )
or
expression( {S[t]}^2 )
but the spacing isn't quite right (or rather what I'd like) using 
either of these.  By 'right' I mean the placement and spacing don't 
quite coincide with what I'd expect if I superimposed S^2 with S[t]. 
Is there a way to place BOTH a subscript and superscript so that they 
are placed identically as if I had overlayed S^2 and S[t]?

I'm using R 1.9.0 on Mac OSX.
Thanks,
Brian
--
*
Brian Beckage
Department of Botany
University of Vermont
Marsh Life Science Building
Burlington, VT 05405
__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


RE: [R] Simultaneous subscripts and superscripts

2004-08-09 Thread Liaw, Andy
expression(S[t]^2) looks pretty good for me (on windows()).

Andy

 From: Brian Beckage
 
 Dear List,
 
 I'd like to add text to a plot where a text symbol has both a 
 superscript and subscript.  For example, the variable S with a 
 superscript 2 and a subscript t.  I have been able to accomplish this 
 using either
 
 expression( paste(S,atop(scriptstyle(2),scriptstyle(t))) )
 
 or
 
 expression( {S[t]}^2 )
 
 but the spacing isn't quite right (or rather what I'd like) using 
 either of these.  By 'right' I mean the placement and spacing don't 
 quite coincide with what I'd expect if I superimposed S^2 with S[t]. 
 Is there a way to place BOTH a subscript and superscript so that they 
 are placed identically as if I had overlayed S^2 and S[t]?
 
 I'm using R 1.9.0 on Mac OSX.
 
 Thanks,
 Brian
 
 
 -- 
 *
 Brian Beckage
 Department of Botany
 University of Vermont
 Marsh Life Science Building
 Burlington, VT 05405
 
 __
 [EMAIL PROTECTED] mailing list
 https://www.stat.math.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide! 
 http://www.R-project.org/posting-guide.html
 


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


Re: [R] Simultaneous subscripts and superscripts

2004-08-09 Thread Uwe Ligges
Brian Beckage wrote:
Dear List,
I'd like to add text to a plot where a text symbol has both a 
superscript and subscript.  For example, the variable S with a 
superscript 2 and a subscript t.  I have been able to accomplish this 
using either

expression( paste(S,atop(scriptstyle(2),scriptstyle(t))) )
or
expression( {S[t]}^2 )
but the spacing isn't quite right (or rather what I'd like) using either 
of these.  By 'right' I mean the placement and spacing don't quite 
coincide with what I'd expect if I superimposed S^2 with S[t]. Is there 
a way to place BOTH a subscript and superscript so that they are placed 
identically as if I had overlayed S^2 and S[t]?

I'm using R 1.9.0 on Mac OSX.
Thanks,
Brian
I think that depends on the font in use. If letters don't have the same 
width, it is difficult to calculate pretty bounding boxes ... and the 
expected behaviour is to left-align. Hence it's as expected.

Are you volunteering to add some fuzz to plotmath.c? I guess you will 
have to add quite a lot of code for this tiny step... (and R is not TeX, 
BTW).

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


RE: [R] Simultaneous subscripts and superscripts

2004-08-09 Thread Brian Beckage
Yep, it looks good on my system as well.  I had tried 
expression(S^2[t]) but not expression(S[t]^2) and the order matters.

Thanks for the help.
Brian


Brian
At 1:44 PM -0400 8/9/04, Liaw, Andy wrote:
expression(S[t]^2) looks pretty good for me (on windows()).
Andy
 From: Brian Beckage
 Dear List,
 I'd like to add text to a plot where a text symbol has both a
 superscript and subscript.  For example, the variable S with a
 superscript 2 and a subscript t.  I have been able to accomplish this
 using either
 expression( paste(S,atop(scriptstyle(2),scriptstyle(t))) )
 or
 expression( {S[t]}^2 )
 but the spacing isn't quite right (or rather what I'd like) using
 either of these.  By 'right' I mean the placement and spacing don't
 quite coincide with what I'd expect if I superimposed S^2 with S[t].
 Is there a way to place BOTH a subscript and superscript so that they
 are placed identically as if I had overlayed S^2 and S[t]?
 I'm using R 1.9.0 on Mac OSX.
 Thanks,
 Brian
 --
 *
 Brian Beckage
 Department of Botany
 University of Vermont
 Marsh Life Science Building
 Burlington, VT 05405
 __
 [EMAIL PROTECTED] mailing list
 https://www.stat.math.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide!
 http://www.R-project.org/posting-guide.html


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

--
*
Brian Beckage
Department of Botany
University of Vermont
Marsh Life Science Building
Burlington, VT 05405
Phone:  802 656-0197
Fax  :  802 656-0440
email:  [EMAIL PROTECTED]
web  :  www.uvm.edu/~bbeckage
__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


RE: [R] Simultaneous subscripts and superscripts

2004-08-09 Thread Rolf Turner
Andy Liaw wrote

 expression(S[t]^2) looks pretty good to me (on windows()).

And to me too (sparc-sun-solaris2.9; R version 1.9.1).

cheers,

Rolf Turner

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


RE: [R] Simultaneous subscripts and superscripts

2004-08-09 Thread Brian Beckage
Yes, I agree.  I thought I had tried it both way, but I guess I was 
too quick to look for more complicated solutions.

Brian
At 2:10 PM -0400 8/9/04, Liaw, Andy wrote:
I guess it's good to type what makes sense:  I can understand squaring S[t],
but it's hard for me to fathom subscripting S^2...
 -Original Message-
 From: Brian Beckage [mailto:[EMAIL PROTECTED]
 Sent: Monday, August 09, 2004 1:55 PM
 To: Liaw, Andy; [EMAIL PROTECTED]
 Subject: RE: [R] Simultaneous subscripts and superscripts
 Yep, it looks good on my system as well.  I had tried
 expression(S^2[t]) but not expression(S[t]^2) and the order matters.
 Thanks for the help.
 Brian


 Brian
 At 1:44 PM -0400 8/9/04, Liaw, Andy wrote:
 expression(S[t]^2) looks pretty good for me (on windows()).
 
 Andy
 
   From: Brian Beckage
 
   Dear List,
 
   I'd like to add text to a plot where a text symbol has both a
   superscript and subscript.  For example, the variable S with a
   superscript 2 and a subscript t.  I have been able to
 accomplish this
   using either
 
   expression( paste(S,atop(scriptstyle(2),scriptstyle(t))) )
 
   or
 
   expression( {S[t]}^2 )
 
   but the spacing isn't quite right (or rather what I'd like) using
   either of these.  By 'right' I mean the placement and
 spacing don't
   quite coincide with what I'd expect if I superimposed S^2
 with S[t].
   Is there a way to place BOTH a subscript and superscript
 so that they
   are placed identically as if I had overlayed S^2 and S[t]?
 
   I'm using R 1.9.0 on Mac OSX.
 
   Thanks,
   Brian
 
 
   --
  
 *
   Brian Beckage
   Department of Botany
   University of Vermont
   Marsh Life Science Building
   Burlington, VT 05405
 
   __
   [EMAIL PROTECTED] mailing list
   https://www.stat.math.ethz.ch/mailman/listinfo/r-help
   PLEASE do read the posting guide!
   http://www.R-project.org/posting-guide.html
 
 
 
 
 -
 -
 Notice:  This e-mail message, together with any attachments,
 contains information of Merck  Co., Inc. (One Merck Drive,
 Whitehouse Station, New Jersey, USA 08889), and/or its affiliates
 (which may be known outside the United States as Merck Frosst, Merck
 Sharp  Dohme or MSD and in Japan, as Banyu) that may be
 confidential, proprietary copyrighted and/or legally privileged. It
 is intended solely for the use of the individual or entity named on
 this message.  If you are not the intended recipient, and have
 received this message in error, please notify us immediately by
 reply e-mail and then delete it from your system.
 -
 -

 --
 *
 Brian Beckage
 Department of Botany
 University of Vermont
 Marsh Life Science Building
 Burlington, VT 05405
 Phone:  802 656-0197
 Fax  :  802 656-0440
 email:  [EMAIL PROTECTED]
 web  :  www.uvm.edu/~bbeckage
 *

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

--
*
Brian Beckage
Department of Botany
University of Vermont
Marsh Life Science Building
Burlington, VT 05405
Phone:  802 656-0197
Fax  :  802 656-0440
email:  [EMAIL PROTECTED]
web  :  www.uvm.edu/~bbeckage
__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] Need help on this problem!

2004-08-09 Thread Lijuan Wang
Hi everyone,
I have posted a similar question to this list, but I don't 
get a reply. I really want to solve this problem, so I 
post it again... 
I am trying to use R to fit some mixed-effects models for 
a nested data. The data is a simulated data with 111 
subjects. Each subject has 6 waves' data.  Below are the 
first two subjects' data : 
simu1[1:12,]
Grouped Data: gf ~ age | id
   id occasion   age   gf  tau b0 
 b1b2 
 1  11  4.056714 35.08943 14.8  14.502078 
5.209333 -5.199452
 2  12 14.056714 87.18276 14.8  14.502078 
5.209333 -5.199452
 3  13 29.056714 91.19566 14.8  14.502078 
5.209333 -5.199452
 4  14 42.056714 91.32411 14.8  14.502078 
5.209333 -5.199452
 5  15 57.056714 91.47233 14.8  14.502078 
5.209333 -5.199452
 6  16 65.056714 91.55138 14.8  14.502078 
5.209333 -5.199452
 7  21  3.353627 16.94166 14.8  -0.331536 
5.293478 -5.392813
 8  22 13.353627 69.87644 14.8  -0.331536 
5.293478 -5.392813
 9  23 28.353627 76.18644 14.8  -0.331536 
5.293478 -5.392813
10  24 41.353627 74.89508 14.8  -0.331536 5.293478 
-5.392813
11  25 56.353627 73.40505 14.8  -0.331536 5.293478 
-5.392813
12  26 64.353627 72.61037 14.8  -0.331536 5.293478 
-5.392813
Firstly, I used lme to fit a mixed effects model with 
quadratic curve.
simu1$age2-simu1$age^2
mm.lme.2-lme(gf~age+age2,random=~age+age2|id,data=simu1)
It works well:
summary(mm.lme.2)
Linear mixed-effects model fit by REML
 Data: simu1 
   AIC  BIClogLik
  5222.225 5267.193 -2601.113

Random effects:
 Formula: ~age + age2 | id
 Structure: General positive-definite, Log-Cholesky 
parametrization
StdDev   Corr
(Intercept) 2.729384e+00 (Intr) age  
age 1.068434e-01 0.648   
age28.285027e-34 0.000  0.000
Residual1.082344e+01 

Fixed effects: gf ~ age + age2 
Value Std.Error  DF   t-value p-value
(Intercept) 23.902926 1.1606163 553  20.59503  .0001
age  3.046429 0.0815675 553  37.34854  .0001
age2-0.034015 0.0011395 553 -29.85176  .0001
 Correlation: 
 (Intr) age   
age  -0.790   
age2  0.697 -0.964

Standardized Within-Group Residuals:
   Min Q1Med Q3Max 
-2.5233682 -0.6801665 -0.1735055  0.5243569  2.7772921 

Number of Observations: 666
Number of Groups: 111 

However, when I tried to fit the following model and the 
starting value is very close to the true value:
simu.nlme-nlme(gf~b00 + b10 * age + b20 * 
max(0,(age-tau0)),data=simu1,fixed=b00+b10+b20+tau0~1,random=b00+b10+b20+tau0~1,group=~id, 
start=c(b00=4.08,b10=5.32,b20=-5.29,tau0=14.8),method=REML)
It shows following error:
**
Error in MEEM(object, conLin, control$niterEM) : 
Singularity in backsolve at level 0, block 1
**
I also fitted the same model by using SAS and winBUGS. 
They all worked well... 

Do you have any suggestions on this problem?
Any reply will be appreciated!
Lijuan
__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] error when calling debugger()

2004-08-09 Thread Vadim Ogranovich
Hi,

I am getting an error message when I am trying to run the debugger() on
the last.dump. The debugger() stops after I make a selection. Could
someone please suggest what it might mean? The R log is included below.
This is R-1.8.1 on RH 7.3.

Thanks, Vadim

 load(last.dump.rda)
 debugger(last.dump)
Message:  Error in split(x, f) : Group length is 0 but data length  0
Available environments had calls:
1: try({
2: local(for (ticker in univ$ticker) {
3: eval.parent(substitute(eval(quote(expr), envir)))
4: eval(expr, p)
5: eval(expr, envir, enclos)
6: eval(quote(for (ticker in univ$ticker) {
7: eval(expr, envir, enclos)
8: local(for (i in l) {
9: eval.parent(substitute(eval(quote(expr), envir)))
10: eval(expr, p)
11: eval(expr, envir, enclos)
12: eval(quote(for (i in l) {
13: eval(expr, envir, enclos)
14: accumulate(accu, lapply(split(seq(length(key)), key), function(i) {
15: lapply(split(seq(length(key)), key), function(i) {
16: split(seq(length(key)), key)
17: split.default(seq(length(key)), key)

Enter an environment number, or 0 to exit  Selection: 1
Error in get(.obj, envir = dump[[.selection]]) : 
recursive default argument reference

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


[R] Easy acf and pacf for irregular time series in R

2004-08-09 Thread Jason . L . Higbee
R:

Is there an easy way to get the acf and pacf for an irregular times 
series?  That is, the acf and pacf with lag lengths that are in units of 
time, not observation number.


Thanks,

Jason Higbee
Research Associate
Federal Reserve Bank of St. Louis
The views expressed in this email are the author's and not necessarily 
those of the Federal Reserve Bank of St. Louis or the Federal Reserve 
System
[[alternative HTML version deleted]]

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


Re: [R] error when calling debugger()

2004-08-09 Thread Patrick Burns
I ran across this behavior in debugger a while ago -- it is R Problem 2656.
As far as I know, no one has made any sense of what is happening in
debugger, but the bug that was the cause of debugger being called was
trying to subscript columns of a matrix that didn't exist.  (You can see the
example in the bug report.)  That doesn't seem like much of a hint in this
case, however.
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)
Vadim Ogranovich wrote:
Hi,
I am getting an error message when I am trying to run the debugger() on
the last.dump. The debugger() stops after I make a selection. Could
someone please suggest what it might mean? The R log is included below.
This is R-1.8.1 on RH 7.3.
Thanks, Vadim
 

load(last.dump.rda)
debugger(last.dump)
   

Message:  Error in split(x, f) : Group length is 0 but data length  0
Available environments had calls:
1: try({
2: local(for (ticker in univ$ticker) {
3: eval.parent(substitute(eval(quote(expr), envir)))
4: eval(expr, p)
5: eval(expr, envir, enclos)
6: eval(quote(for (ticker in univ$ticker) {
7: eval(expr, envir, enclos)
8: local(for (i in l) {
9: eval.parent(substitute(eval(quote(expr), envir)))
10: eval(expr, p)
11: eval(expr, envir, enclos)
12: eval(quote(for (i in l) {
13: eval(expr, envir, enclos)
14: accumulate(accu, lapply(split(seq(length(key)), key), function(i) {
15: lapply(split(seq(length(key)), key), function(i) {
16: split(seq(length(key)), key)
17: split.default(seq(length(key)), key)
Enter an environment number, or 0 to exit  Selection: 1
Error in get(.obj, envir = dump[[.selection]]) : 
	recursive default argument reference

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

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


[R] The sm Package - axis limit values and axis removal

2004-08-09 Thread bcatton
Hi there,

 

I am trying to place axis limit values on plots generated using the
sm.density(x) function as in figure 1.6 (page 8) of Bowman  Azzalini
(1997).  I realize The sm Package does not apply the x, y or zlim values in
3D plots, is there a way to add this information after the fact?

 

Also, can one remove the upper plot axis; apparently this and addition of
xlim values can be accomplished in S-Plus.

 

Thanks in advance,

Bruce

 

_

Bruce Catton

MSc Candidate

Forest Sciences

University of British Columbia

email:  [EMAIL PROTECTED]

 


[[alternative HTML version deleted]]

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


[R] How to import specific column(s) using read.table?

2004-08-09 Thread F Duan
Dear R people,

I have a very big tab-delim txt file with header and I only want to import 
several columns into R. I checked the options for “read.table” and only 
found “nrows” which lets you specify the maximum number of rows to read in. 
Although I can use some text editors (e.g., wordpad) to edit the txt file first 
before running R, I feel it’s not very convenient. The reason for me to do this 
is that if I import the whole file into R, it will eat up too much of my 
system’s memory. Even after I remove it later, I still can’t release the memory.

Anyone has any suggestions?

Thank you very much,

Frank

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


Re: [R] How to import specific column(s) using read.table?

2004-08-09 Thread Thomas Lumley
On Mon, 9 Aug 2004, F Duan wrote:

 Dear R people,

 I have a very big tab-delim txt file with header and I only want to import
 several columns into R. I checked the options for “read.table” and only
 found “nrows” which lets you specify the maximum number of rows to read in.
 Although I can use some text editors (e.g., wordpad) to edit the txt file first
 before running R, I feel it’s not very convenient. The reason for me to do this
 is that if I import the whole file into R, it will eat up too much of my
 system’s memory. Even after I remove it later, I still can’t release the memory.


You can't avoid reading the whole file, but you can avoid having it in
memory.

I'll assume you know how many lines are in the file, call it N. (this
isn't necessary  but it is tidier) and that you are interested in columns
10 and 110, both numeric

If you do something like

inputfile-file(inputfile.txt,open=r)
result-data.frame(col10=numeric(N), col110=numeric(N))
chunksize-1000
nchunks- ceiling(N/1000)

for(i in 1:nchunks){
chunk-read.table(inputfile,nrows=chunksize)
result[ (i-1)*chunksize+ (1:chunksize),]-chunk[,c(10,110)]
}

close(inputfile)

you can choose the chunk size so that the memory use is not too bad.

There are also more efficient ways that make you do more of the work (eg
read in lines of text with readLines and use regular expressions to
extract the columns you need)

-thomas

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


Re: [R] How to import specific column(s) using read.table?

2004-08-09 Thread A.J. Rossini

If you've got access to unix tools (i.e. linux or cygwin), consider
the cut command.  Great for column selection.


Thomas Lumley [EMAIL PROTECTED] writes:

 On Mon, 9 Aug 2004, F Duan wrote:

 Dear R people,

 I have a very big tab-delim txt file with header and I only want to import
 several columns into R. I checked the options for “read.table” and only
 found “nrows” which lets you specify the maximum number of rows to read in.
 Although I can use some text editors (e.g., wordpad) to edit the txt file first
 before running R, I feel it’s not very convenient. The reason for me to do this
 is that if I import the whole file into R, it will eat up too much of my
 system’s memory. Even after I remove it later, I still can’t release the memory.


 You can't avoid reading the whole file, but you can avoid having it in
 memory.

 I'll assume you know how many lines are in the file, call it N. (this
 isn't necessary  but it is tidier) and that you are interested in columns
 10 and 110, both numeric

 If you do something like

 inputfile-file(inputfile.txt,open=r)
 result-data.frame(col10=numeric(N), col110=numeric(N))
 chunksize-1000
 nchunks- ceiling(N/1000)

 for(i in 1:nchunks){
   chunk-read.table(inputfile,nrows=chunksize)
   result[ (i-1)*chunksize+ (1:chunksize),]-chunk[,c(10,110)]
 }

 close(inputfile)

 you can choose the chunk size so that the memory use is not too bad.

 There are also more efficient ways that make you do more of the work (eg
 read in lines of text with readLines and use regular expressions to
 extract the columns you need)

   -thomas

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


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

CONFIDENTIALITY NOTICE: This e-mail message and any attachme...{{dropped}}

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


Re: [R] How to import specific column(s) using read.table?

2004-08-09 Thread Prof Brian Ripley
There is no way for read.table to skip columns.  It is however very easy 
to do this with a preprocessing of the table: cut, awk and perl all come 
to mind, and you could do it in R too, reading a block of rows at a time 
and writing them back out.

scan() can skip columns, but I would still use preprocessing with scan.

On Mon, 9 Aug 2004, F Duan wrote:

 I have a very big tab-delim txt file with header and I only want to import 
 several columns into R. I checked the options for “read.table” and only 
 found “nrows” which lets you specify the maximum number of rows to read in. 
 Although I can use some text editors (e.g., wordpad) to edit the txt file first 
 before running R, I feel it’s not very convenient. The reason for me to do this 
 is that if I import the whole file into R, it will eat up too much of my 
 system’s memory. Even after I remove it later, I still can’t release the memory.

The peculiar quotes suggest this is Windows -- the Rtools we use to build 
R there contain a cut.exe.

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

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


[R] Using R boxplot function in Excel

2004-08-09 Thread Jessie F
Hi, I have downloaded the R-Com and I was able to run Interactive Graphics 
Demo 2 in excel. However, I couldn't create my own boxplot. Whenever I 
tried to run any code, it always say Error in loading DLL, even 
=rput(A1,A2:A20). Any idea about what's going wrong? A detailed 
explaination about how to use R-Excel tool would be greatly appreciated.
Thanks a lot in advance!

PS: I would like you to use the following data as an example.
AB   C
12.5186182  7.394714354 6.58360308
11.37597453 16.66820087 3.900166247
7.059103407 9.696804606 3.738396698
13.80587153 21.95622475 5.365668029
7.933769009 9.572635842 4.195704277
14.80409653 12.39208079 6.883236109
8.974253685 12.02387754 5.842696863
7.6083609   18.08369863 4.75223318
10.01654143 10.61151753 4.940416728
10.22753966 7.59634933  5.150066626
9.638591817 17.68393592 5.427933173
12.9405328  17.35731932 5.079704705
7.758718564 14.28801913 5.319497531
9.873025445 16.89445473 5.044402668
8.023517946 16.28102329 5.637006679
7.214663381 24.19544618 5.083052782
11.82039457 5.482319845 5.26250973
8.432808752 14.50188112 7.040906111
10.41255589 8.92899781  3.335806595
14.0030136  18.31841647 3.26446583
9.75501396  18.97398026 6.075650289
11.25837687 16.9443803  5.077193363
13.51650669 22.33716661 2.850945874
stationery, fonts and colors. 

 Start enjoying all the benefits of MSN® Premium right now and get the 
first two months FREE*.

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


[R] on.exit() inside local()

2004-08-09 Thread Vadim Ogranovich
Hi,

Since I routinely open files in a loop I've developed a habit of using
on.exit() to close them. Since on.exit() needs to be called within a
function I use eval() as a surrogate. For example:

for (fileName in c(a, b)) eval({
con - file(fileName);
on.exit(close(con))
}) 

and con will be closed no matter what.


However it stopped working once I wrapped the loop in local():
 local(
+   for (foo in seq(2)) eval({
+ on.exit(cat(foo, \n))
+   })
+ )
Error in cat(foo, \n) : Object foo not found


W/o local()it works just fine
   for (foo in seq(2)) eval({
+ on.exit(cat(foo, \n))
+   })
1 
2 

The reason I wanted the local() is to keep 'foo' from interfering with
the existing environments, but somehow this breaks the thing.
At this point I am stuck. Could someone please tell what's going on?

Thanks,
Vadim

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


[R] Enduring LME confusion or Psychologists and Mixed-Effects

2004-08-09 Thread Gijs Plomp
Dear ExpeRts,
Suppose I have a typical psychological experiment that is a 
within-subjects design with multiple crossed variables and a continuous 
response variable. Subjects are considered a random effect. So I could model
 aov1 - aov(resp~fact1*fact2+Error(subj/(fact1*fact2))

However, this only holds for orthogonal designs with equal numbers of 
observation and no missing values. These assumptions are easily violated 
so I seek refuge in fitting a mixed-effects model with the nlme library.
 lme1 - lme(resp~fact1*fact2, random=~1|subj)

When testing the significance of the effects of my factors, with 
anova(lme1), the degrees of freedom that lme uses in the denominator 
spans all observations and is identical for all factors and their 
interaction. I read in a previous post on the list ([R] Help with lme 
basics) that this is inherent to lme. I studied the instructive book of 
Pinheiro  Bates and I understand why the degrees of freedom are 
assigned as they are, but think it may not be appropriate in this case. 
Used in this way it seems that lme is more prone to type 1 errors than aov.

To get more conservative degrees of freedom one could model
 lme2 - lme(resp~fact1*fact2, random=~1|subj/fact1/fact2)
But this is not a correct model because it assumes the factors to be 
hierarchically ordered, which they are not.

Another alternative is to model the random effect using a matrix, as 
seen in [R] lme and mixed effects on this list.
 lme3 - (resp~fact1*fact2, random=list(subj=pdIdent(form=~fact1-1),  
subj=~1,  fact2=~1)

This provides correct degrees of freedom for fact1, but not for the 
other effects and I must confess that I don't understand this use of 
matrices, Im not a statistician.

My questions thus come down to this:
1. When aovs assumptions are violated, can lme provide the right model 
for within-subjects designs where multiple fixed effects are NOT 
hierarchically ordered?

2. Are the degrees of freedom in anova(lme1) the right ones to report? 
If so, how do I convince a reviewer that, despite the large number of 
degrees of freedom, lme does provide a conservative evaluation of the 
effects? If not, how does one get the right denDf in a way that can be 
easily understood?

I hope that my confusion is all due to an ignorance of statistics and 
that someone on this list will kindly point that out to me. I do realize 
that this type of question has been asked before, but think that an 
illuminating answer can help R spread into the psychological community.

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