Re: [R] Font Encodings --- some work, some don't

2005-08-31 Thread Prof Brian Ripley
Are you talking about the pdf() device?  You never say so, but you do say

 The font encoding error does not appear in the postscript
 device driver, and it works fine.

This report is far too vague: what did you do and what reported the file 
was corrupt?  (Note that Acrobat reader is famous for mis-rendering
files which meet the Adobe PDF specification.)

Please do read the posting guide and restate your problem following the 
guidelines there.

Finally, I don't see any claim that arbitrary font encodings would produce 
a valid PDF file, so what did you read to suggest that?

On Tue, 30 Aug 2005, ivo welch wrote:


 Dear R wizards:  I believe some more font encoding info. some of the
 font encodings work, others do not:  IsoLatin1, MacRoman, WinAnsi, and
 PDFDoc seem fine.  AdobeStd, AdobeSym, ISOLatin2, ISOLatin9, and
 TeXtext seem broken, in that the resulting output file is silently
 corrupt.  The font encoding error does not appear in the postscript
 device driver, and it works fine.  It would be nice if R gave an error
 message, instead of producing corrupt .pdf files.  Just a suggestion...

 Regards,

 /iaw
 ---
 ivo welch

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


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

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


Re: [R] R binaries

2005-08-31 Thread Prof Brian Ripley
On Wed, 31 Aug 2005, Berwin A Turlach wrote:

 G'day Nam-Ky,

 NKN == Nam-Ky Nguyen [EMAIL PROTECTED] writes:

NKN I intend to burn some R CDs to colleagues in Vietnam.  I want
NKN to put all binary files for base as well as contributed
NKN packages (for both Windows and Linux).
 I don't believe that precompiled binary files for Linux exist, since
 they would depend very much on which flavour of Linux you are running.

NKN It is very time consuming if I download files by files. Is
NKN there a place a can buy a CD with all the mentioned files?
 Not that I am aware off.  But I would do the following for easy
 download of all contributed files:  Issue  from an R session the
 following commands (mostly untested):

 options(repos=c(CRAN=http://cran.au.r-project.org/;))
 tmp - available.packages()  # Or just use CRAN.packages() ??
 ## To download all source files
 download.packages(tmp, destdir=.)
 ## To download all windows binary
 download.packages(tmp, destdir=., type=win.binary)

 If you do it from a Windows machine, you may have to adapt the destdir
 argument in those commands.  Also, if you sit behind a proxy, then you
 might have to first issue an appropriate
 'Sys.putenv(http_proxy=put your proxy here)' command.

 available.packages() does not seem to have a type argument according
 to its documentation, so I guess that even if it is run under Windows
 that it returns a list of all source packages available in contrib.

Depends on what contriburl is set to, but the default under Windows is 
binary packages.  See my article in the current R-Newsletter.

The default argument is contrb.url(getOption(repos)), and contrib.url 
does have a type argument (and its default is getOption(pkgType) ).

 If some of those are not available as a precompiled windows binary,
 the download.packages() command will probably fail with an error, so
 you have to do the download in bits and pieces, removing offending
 entries from `tmp' -- but that should be still faster than downloading
 file by file (presumably by clicking in a web browser?).  (The
 development version of R should now be more robust (Thanks again,
 Brian) when downloading and just continue downloading the remaining
 files if it encounters an error.  But I don't know where you run (or
 what to run) R-devel ;-) ).

 Hope this helps.

 Cheers,

Berwin

 == Full address 
 Berwin A Turlach  Tel.: +61 (8) 6488 3338 (secr)
 School of Mathematics and Statistics+61 (8) 6488 3383 (self)
 The University of Western Australia   FAX : +61 (8) 6488 1028
 35 Stirling Highway
 Crawley WA 6009e-mail: [EMAIL PROTECTED]
 Australiahttp://www.maths.uwa.edu.au/~berwin

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


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

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


Re: [R] R binaries

2005-08-31 Thread Berwin A Turlach
G'day Brian,

 BDR == Prof Brian Ripley [EMAIL PROTECTED] writes:

BDR On Wed, 31 Aug 2005, Berwin A Turlach wrote:
 available.packages() does not seem to have a type argument
 according to its documentation, so I guess that even if it is
 run under Windows that it returns a list of all source packages
 available in contrib.

BDR Depends on what contriburl is set to, but the default under
BDR Windows is binary packages.  See my article in the current
BDR R-Newsletter.

BDR The default argument is contrb.url(getOption(repos)), and
BDR contrib.url does have a type argument (and its default is
BDR getOption(pkgType) ).
Thanks for pointing this out;  seems as if I didn't read the
documentation in sufficient details.

Thus, since Nam-Ky works on a Linux box (private e-mail) the commands
should be

 options(repos=c(CRAN=http://cran.au.r-project.org/;),
+ pkgType=source)
 download.packages(available.packages(), destdir=.)

to download all the source files; followed by 

 options(pkgType=win.binary)
 download.packages(available.packages(), destdir=.)

to download all contributed binary packages for Windows.

Cheers,

Berwin

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


Re: [R] R binaries

2005-08-31 Thread Peter Dalgaard
Berwin A Turlach [EMAIL PROTECTED] writes:

 Thus, since Nam-Ky works on a Linux box (private e-mail) the commands
 should be

On a Linux box, I would rather suggest using wget on the appropriate
CRAN directories (wget -r --no-parent http://etc.etc.etc/...) - unless
of course it is the download speed that is the issue.

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

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


[R] Distributional characteristics

2005-08-31 Thread Naji
Hi all

I've a continuous variable and I want to test (graphically, plotting
observed and theoretical distr, qqplot) whether it follows some formal
distribution. (some thing close to Ricci document : Fitting distributions
with R, Feb05).
 
The distribution I want to fit is a truncated Gamma at 1 (the minimal value
is 1), P(x)=Pgamma(rate,x)/(1-Pgamma(rate,x1))

NB : changing the variable (x-1,ln(x)) didn't get satisfying results

Best
Naji

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


Re: [R] R binaries

2005-08-31 Thread Thomas Petzoldt
Nam-Ky Nguyen schrieb:
 Dear Rexperts,
 
 I intend to burn some R CDs to colleagues in Vietnam.  I want to put all
 binary files for base as well as contributed packages (for both Windows
 and Linux). It is very time consuming if I download files by files. Is
 there a place a can buy a CD with all the mentioned files?
 
 Regards,

There are many methods to download several files at once, either text 
based using an ftp or http client (e.g. wget) or GUI based.

Some GUI's:

- the downTHEMall! plugin for Mozilla Firefox

- Total Commander (Shareware, Windows) is a very nice universal file 
manager with an effective built-in ftp client.

- KDE on a recent LINUX distribution: the file manager konqueror has 
built-in http and ftp support and is able to copy complete directory trees.

As an example to copy some documentation simply type

ftp://cran.r-project.org/pub/R/doc

(please select your cran mirror near you) into the address line, then 
select the required directory (e.g. Rnews) and press the right mouse 
button, but be careful if you select huge directory tries.

Thomas P.

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


Re: [R] Installation help

2005-08-31 Thread Prof Brian Ripley
On Tue, 30 Aug 2005, b wrote:

 Solved the problem with the 'R' installation!

 One of the processes that loads up on startup was
 conflicting with it. It was a program called
 Gameutil.exe which seems to enhance games by
 altering display modes. For some reason a conflict
 existed. Anyhow I dont really need the Gameutil.exe,
 so I'm as happy as Larry R works!

Was this on Windows?  If so, such programs are covered by the rw-FAQ, see 
the posting guide.

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

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


Re: [R] PLSR: model notation and reliabilities

2005-08-31 Thread I.Ioannou
On Mon, Aug 29, 2005 at 08:08:53AM +0200, Bj?rn-Helge Mevik wrote:
 
 It seems to me that what you are looking for, is some sort of
 structured equation models (? la Lisrel).  The pls package implements
 partial least squares regression and principal component regression,
 which is something different.  I quess you could still use plsr for the
 outer model (path model), but you would have to build the inner
 model (the constructs) with other tools, such as prcomp/princomp or
 other factor analyses (see e.g. ?factanal and ?varimax).
 
 Alternatively, there is an R package sem that implements structured
 equation models.  You might want to take a look at that.


Thank you very much for your hints. I actually tried factanal
to construct the latent variables, and both the reliabilties 
and the explained variance seem to be ok, but I'm afraid that 
this is not my case. I thought that plsr should be used to perform 
this task, and that PLS is prefered under conditions on non-normality 
and small to medium sample sizes where you do not assume error 
free measurement (Chin et all, 1996, p25). Also Wold suggests 
using PLS or PC scores in each level of hierarchical PLS models 
(Wold et al, 2004, p17). 

It is obvious to me how I should use plsr to perform the final
regression  between the constructs, but I'm missing the procedure 
I have to use in order to construct the factors (constructs) from 
the observed indicators.

Any hints will be much appreciatted.

Rgrds

References:

Chin et al, 1996, A PARTIAL LEAST SQUARES LATENT VARIABLE 
MODELING APPROACH FOR MEASURING INTERACTION EFFECTS: RESULTS FROM A MONTE 
CARLO SIMULATION STUDY AND VOICE MAIL EMOTION/ADOPTION STUDY,
Available: 
http://disc-nt.cba.uh.edu/chin/plsfaq/http/disc-nt.cba.uh.edu/chin/icis96.pdf

Wold et al, 2004, The PLS method -- partial least squares projections to 
latent structures -- and its applications in industrial RDP, 
Available: 
http://www.umetrics.com/pdfs/events/prague%200408%20__%20PLS_text_wold.pdf   

Ioannis Ioannou

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


[R] Gamma for ordinal trends

2005-08-31 Thread Wuming Gong
Dear list, 

Are there any functions for calculating gamma (and its standard
error), which measures the association of ordinal factors in I x J
contingency table. I did a RSiteSearch but did not find any clues...

Thanks,

Wuming

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


[R] tcl/tk return problem

2005-08-31 Thread deggle
Hello,

I'm very new in working with tcl/tk in R and have a problem which will 
probably
sound silly to most of you.
Here is the code I have problems with:

readcelfiles - function()
{
   require(tcltk)
   tt - tktoplevel()
   tkgrid(tklabel(tt,text=Choose a directory!))

 OnOK - function()
 {
fileDir-tclvalue(tkchooseDirectory())
data.raw - ReadAffy(celfile.path=fileDir)
#return(data.raw)
 }

   OK.but - tkbutton(tt,text=OK,command=OnOK)
   tkgrid(OK.but)
   tkfocus(tt)
}

So after clicking on my OK button, I choose my directory and read the 
cel-files.
But now I want to return the object to my workspace ... return doesn't 
work here.

Could anyone give me a hint?

Thank you very much,
Daniela

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


Re: [R] Gamma for ordinal trends

2005-08-31 Thread Jonathan Baron
On 08/31/05 17:46, Wuming Gong wrote:
 Dear list,
 
 Are there any functions for calculating gamma (and its standard
 error), which measures the association of ordinal factors in I x J
 contingency table. I did a RSiteSearch but did not find any clues...

You have to look for Goodman-Kruskal gamma.  It is a bit
obscure.  It is rcorr.cens in the Hmisc package.

The significance test is the same as for Kendall's tau, according 
to some books.  I don't know about standard error.

Jon
-- 
Jonathan Baron, Professor of Psychology, University of Pennsylvania
Home page: http://www.sas.upenn.edu/~baron

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


Re: [R] tcl/tk return problem

2005-08-31 Thread Philippe Grosjean
deggle wrote:
 Hello,
 
 I'm very new in working with tcl/tk in R and have a problem which will 
 probably
 sound silly to most of you.
 Here is the code I have problems with:
 
 readcelfiles - function()
 {
require(tcltk)
tt - tktoplevel()
tkgrid(tklabel(tt,text=Choose a directory!))
 
  OnOK - function()
  {
 fileDir-tclvalue(tkchooseDirectory())
 data.raw - ReadAffy(celfile.path=fileDir)
 #return(data.raw)
  }
 
OK.but - tkbutton(tt,text=OK,command=OnOK)
tkgrid(OK.but)
tkfocus(tt)
 }
 
 So after clicking on my OK button, I choose my directory and read the 
 cel-files.
 But now I want to return the object to my workspace ... return doesn't 
 work here.

I suppose you mean in the User Workspace. Your OnOK function should look 
like that:

OnOK - function() {
  fileDir-tclvalue(tkchooseDirectory())
  data.raw - ReadAffy(celfile.path=fileDir)
}

Note that the function overwrites any existing 'data.raw', so this could 
be dangerous. Writting directly in the User Workspace is not advised 
from inside a function, but here, it is the simplest way to return a 
result from a tk widget action.
Best

Philippe Grosjean


 Could anyone give me a hint?
 
 Thank you very much,
 Daniela
 
 __
 R-help@stat.math.ethz.ch mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
 


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


Re: [R] tcl/tk return problem

2005-08-31 Thread Prof Brian Ripley
On Wed, 31 Aug 2005, Philippe Grosjean wrote:

 deggle wrote:
  Hello,
 
  I'm very new in working with tcl/tk in R and have a problem which will
  probably
  sound silly to most of you.
  Here is the code I have problems with:
 
  readcelfiles - function()
  {
 require(tcltk)
 tt - tktoplevel()
 tkgrid(tklabel(tt,text=Choose a directory!))
 
   OnOK - function()
   {
  fileDir-tclvalue(tkchooseDirectory())
  data.raw - ReadAffy(celfile.path=fileDir)
  #return(data.raw)
   }
 
 OK.but - tkbutton(tt,text=OK,command=OnOK)
 tkgrid(OK.but)
 tkfocus(tt)
  }
 
  So after clicking on my OK button, I choose my directory and read the
  cel-files.
  But now I want to return the object to my workspace ... return doesn't
  work here.

 I suppose you mean in the User Workspace. Your OnOK function should look
 like that:

 OnOK - function() {
   fileDir-tclvalue(tkchooseDirectory())
   data.raw - ReadAffy(celfile.path=fileDir)
 }

 Note that the function overwrites any existing 'data.raw', so this could
 be dangerous. Writting directly in the User Workspace is not advised
 from inside a function, but here, it is the simplest way to return a
 result from a tk widget action.

Maybe simplest, but not a very good way.  See
R_SOURCES/src/library/tcltk/R/utils.R for ideas on how to write a modal
dialog box that returns the value selected.

One problem with - is that it does not necessarily write in the
workspace.  You need

   assign(data.raw, ReadAffy(celfile.path=fileDir), envir=.GlobalEnv)

to be sure of that.  (The example code I quote does use - but in a
controlled way.)

-- 
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 272860 (secr)
Oxford OX1 3TG, UKFax:  +44 1865 272595

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


Re: [R] Gamma for ordinal trends

2005-08-31 Thread Peter Dalgaard
Jonathan Baron [EMAIL PROTECTED] writes:

 On 08/31/05 17:46, Wuming Gong wrote:
  Dear list,
  
  Are there any functions for calculating gamma (and its standard
  error), which measures the association of ordinal factors in I x J
  contingency table. I did a RSiteSearch but did not find any clues...
 
 You have to look for Goodman-Kruskal gamma.  It is a bit
 obscure.  It is rcorr.cens in the Hmisc package.
 
 The significance test is the same as for Kendall's tau, according 
 to some books.  

Well, it would be if we handled ties in Kendall's tau correctly...

 I don't know about standard error.

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

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


Re: [R] Gamma for ordinal trends

2005-08-31 Thread Wuming Gong
Is it possible to use delta method to evaluate the standard error of
Goodman-Kruskal gamma and then Wald test to evaluate the significance
of association?

Wuming


On 31 Aug 2005 13:42:27 +0200, Peter Dalgaard [EMAIL PROTECTED] wrote:
 Jonathan Baron [EMAIL PROTECTED] writes:
 
  On 08/31/05 17:46, Wuming Gong wrote:
   Dear list,
  
   Are there any functions for calculating gamma (and its standard
   error), which measures the association of ordinal factors in I x J
   contingency table. I did a RSiteSearch but did not find any clues...
 
  You have to look for Goodman-Kruskal gamma.  It is a bit
  obscure.  It is rcorr.cens in the Hmisc package.
 
  The significance test is the same as for Kendall's tau, according
  to some books.
 
 Well, it would be if we handled ties in Kendall's tau correctly...
 
  I don't know about standard error.
 
 --
O__   Peter Dalgaard Øster Farimagsgade 5, Entr.B
   c/ /'_ --- Dept. of Biostatistics PO Box 2099, 1014 Cph. K
  (*) \(*) -- University of Copenhagen   Denmark  Ph:  (+45) 35327918
 ~~ - ([EMAIL PROTECTED])  FAX: (+45) 35327907


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


Re: [R] tcl/tk return problem

2005-08-31 Thread Duncan Murdoch
Prof Brian Ripley wrote:
 On Wed, 31 Aug 2005, Philippe Grosjean wrote:
 
 
deggle wrote:

Hello,

I'm very new in working with tcl/tk in R and have a problem which will
probably
sound silly to most of you.
Here is the code I have problems with:

readcelfiles - function()
{
   require(tcltk)
   tt - tktoplevel()
   tkgrid(tklabel(tt,text=Choose a directory!))

 OnOK - function()
 {
fileDir-tclvalue(tkchooseDirectory())
data.raw - ReadAffy(celfile.path=fileDir)
#return(data.raw)
 }

   OK.but - tkbutton(tt,text=OK,command=OnOK)
   tkgrid(OK.but)
   tkfocus(tt)
}

So after clicking on my OK button, I choose my directory and read the
cel-files.
But now I want to return the object to my workspace ... return doesn't
work here.

I suppose you mean in the User Workspace. Your OnOK function should look
like that:

OnOK - function() {
  fileDir-tclvalue(tkchooseDirectory())
  data.raw - ReadAffy(celfile.path=fileDir)
}

Note that the function overwrites any existing 'data.raw', so this could
be dangerous. Writting directly in the User Workspace is not advised
from inside a function, but here, it is the simplest way to return a
result from a tk widget action.
 
 
 Maybe simplest, but not a very good way.  See
 R_SOURCES/src/library/tcltk/R/utils.R for ideas on how to write a modal
 dialog box that returns the value selected.
 
 One problem with - is that it does not necessarily write in the
 workspace.  You need
 
assign(data.raw, ReadAffy(celfile.path=fileDir), envir=.GlobalEnv)
 
 to be sure of that.  (The example code I quote does use - but in a
 controlled way.)

This works, and you weren't suggesting it as a good style, but I'd like 
to say it's really a bad style to write to .GlobalEnv.  The controlled 
use of - as in tk_select.list from the file you quoted is really the 
best way to solve this problem.  As a general rule, you shouldn't stomp 
on something you don't own, and functions don't own variables in 
.GlobalEnv.

What tk_select.list does is define OnOK locally, and use - to write to
the tk_select.list environment.  Then the result can be manipulated and 
returned politely, without stomping on anything anywhere.

Duncan Murdoch

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


Re: [R] tcl/tk return problem

2005-08-31 Thread Prof Brian Ripley
On Wed, 31 Aug 2005, Duncan Murdoch wrote:

 Prof Brian Ripley wrote:
  On Wed, 31 Aug 2005, Philippe Grosjean wrote:
 
 
 deggle wrote:
 
 Hello,
 
 I'm very new in working with tcl/tk in R and have a problem which will
 probably
 sound silly to most of you.
 Here is the code I have problems with:
 
 readcelfiles - function()
 {
require(tcltk)
tt - tktoplevel()
tkgrid(tklabel(tt,text=Choose a directory!))
 
  OnOK - function()
  {
 fileDir-tclvalue(tkchooseDirectory())
 data.raw - ReadAffy(celfile.path=fileDir)
 #return(data.raw)
  }
 
OK.but - tkbutton(tt,text=OK,command=OnOK)
tkgrid(OK.but)
tkfocus(tt)
 }
 
 So after clicking on my OK button, I choose my directory and read the
 cel-files.
 But now I want to return the object to my workspace ... return doesn't
 work here.
 
 I suppose you mean in the User Workspace. Your OnOK function should look
 like that:
 
 OnOK - function() {
   fileDir-tclvalue(tkchooseDirectory())
   data.raw - ReadAffy(celfile.path=fileDir)
 }
 
 Note that the function overwrites any existing 'data.raw', so this could
 be dangerous. Writting directly in the User Workspace is not advised
 from inside a function, but here, it is the simplest way to return a
 result from a tk widget action.
 
 
  Maybe simplest, but not a very good way.  See
  R_SOURCES/src/library/tcltk/R/utils.R for ideas on how to write a modal
  dialog box that returns the value selected.
 
  One problem with - is that it does not necessarily write in the
  workspace.  You need
 
 assign(data.raw, ReadAffy(celfile.path=fileDir), envir=.GlobalEnv)
 
  to be sure of that.  (The example code I quote does use - but in a
  controlled way.)

 This works, and you weren't suggesting it as a good style, but I'd like
 to say it's really a bad style to write to .GlobalEnv.

It was the question asked!  If you use a non-modal tcltk dialog you
have little choice, as the parent function will have returned and vanished
long ago.  Now, having a widget firing off R commands independently of the
command line is not a great idea (R's evaluator is not multithreaded and
this could be interspersed in another computation) so there is a lot to be
said for using dialog boxes modally.

 The controlled use of - as in tk_select.list from the file you
 quoted is really the best way to solve this problem.  As a general
 rule, you shouldn't stomp on something you don't own, and functions
 don't own variables in .GlobalEnv.

One could argue the user who pressed the button does: it is the user
workspace.

 What tk_select.list does is define OnOK locally, and use - to write to
 the tk_select.list environment.  Then the result can be manipulated and
 returned politely, without stomping on anything anywhere.

-- 
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 272860 (secr)
Oxford OX1 3TG, UKFax:  +44 1865 272595

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


Re: [R] tcl/tk return problem

2005-08-31 Thread Duncan Murdoch
On 8/31/2005 8:57 AM, Prof Brian Ripley wrote:
 On Wed, 31 Aug 2005, Duncan Murdoch wrote:
 
 Prof Brian Ripley wrote:
  On Wed, 31 Aug 2005, Philippe Grosjean wrote:
 
 
 deggle wrote:
 
 Hello,
 
 I'm very new in working with tcl/tk in R and have a problem which will
 probably
 sound silly to most of you.
 Here is the code I have problems with:
 
 readcelfiles - function()
 {
require(tcltk)
tt - tktoplevel()
tkgrid(tklabel(tt,text=Choose a directory!))
 
  OnOK - function()
  {
 fileDir-tclvalue(tkchooseDirectory())
 data.raw - ReadAffy(celfile.path=fileDir)
 #return(data.raw)
  }
 
OK.but - tkbutton(tt,text=OK,command=OnOK)
tkgrid(OK.but)
tkfocus(tt)
 }
 
 So after clicking on my OK button, I choose my directory and read the
 cel-files.
 But now I want to return the object to my workspace ... return doesn't
 work here.
 
 I suppose you mean in the User Workspace. Your OnOK function should look
 like that:
 
 OnOK - function() {
   fileDir-tclvalue(tkchooseDirectory())
   data.raw - ReadAffy(celfile.path=fileDir)
 }
 
 Note that the function overwrites any existing 'data.raw', so this could
 be dangerous. Writting directly in the User Workspace is not advised
 from inside a function, but here, it is the simplest way to return a
 result from a tk widget action.
 
 
  Maybe simplest, but not a very good way.  See
  R_SOURCES/src/library/tcltk/R/utils.R for ideas on how to write a modal
  dialog box that returns the value selected.
 
  One problem with - is that it does not necessarily write in the
  workspace.  You need
 
 assign(data.raw, ReadAffy(celfile.path=fileDir), envir=.GlobalEnv)
 
  to be sure of that.  (The example code I quote does use - but in a
  controlled way.)

 This works, and you weren't suggesting it as a good style, but I'd like
 to say it's really a bad style to write to .GlobalEnv.
 
 It was the question asked! 

Yes, I agree, but I was pointing out that it is probably the wrong question.

Duncan Murdoch

  If you use a non-modal tcltk dialog you
 have little choice, as the parent function will have returned and vanished
 long ago.  Now, having a widget firing off R commands independently of the
 command line is not a great idea (R's evaluator is not multithreaded and
 this could be interspersed in another computation) so there is a lot to be
 said for using dialog boxes modally.
 
 The controlled use of - as in tk_select.list from the file you
 quoted is really the best way to solve this problem.  As a general
 rule, you shouldn't stomp on something you don't own, and functions
 don't own variables in .GlobalEnv.
 
 One could argue the user who pressed the button does: it is the user
 workspace.
 
 What tk_select.list does is define OnOK locally, and use - to write to
 the tk_select.list environment.  Then the result can be manipulated and
 returned politely, without stomping on anything anywhere.


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


Re: [R] problem with certain data sets when using randomForest

2005-08-31 Thread Liaw, Andy
I've been trying to play catch-up on R-help since DSC2005.  This one must
have slipped through...

This is what I'd do:

iris.sub - subset(iris, Species %in% c(setosa, virginica))
iris.sub$Species - factor(iris.sub$Species)

That last line drops the empty level in the factor.  You can then run
randomForest with that data.

HTH,
Andy

 From: Martin Lam
 
 Hi,
 
 Since I've had no replies on my previous post about my
 problem I am posting it again in the hope someone
 notice it. The problem is that the randomForest
 function doesn't take datasets which has instances
 only containing a subset of  all the classes. So the
 dataset with instances that either belong to class a
 or b from the levels a, b and c doesn't work
 because there is no instance that has class c. Is
 there any way to solve this problem?
 
 library(randomForest)
 
 # load the iris plant data set
 dataset - iris
 
 numberarray - array(1:nrow(dataset), nrow(dataset),
 1)
 
 # include only instances with Species = setosa or
 virginica
 indices - t(numberarray[(dataset$Species == setosa
 | 
 dataset$Species == virginica) == TRUE])
 
 finaldataset - dataset[indices,]
 
 # just to let you see the 3 classes
 levels(finaldataset$Species)
 
 # create the random forest
 randomForest(formula = Species ~ ., data =
 finaldataset, ntree = 5)
 
 # The error message I get
 Error in randomForest.default(m, y, ...) : 
 Can't have empty classes in y.
 
 #The problem is that the finaldataset doesn't contain
 #any instances of versicolor, so I think the only
 way #to solve this problem is by changing the levels
 the #Species have to only setosa and virginica,
 # correct me if I'm wrong.
 
 # So I tried to change the levels but I got stuck:
 
 # get the possible unique classes
 uniqueItems - unique(levels(finaldataset$Species))
 
 # the problem!
 newlevels - list(uniqueItems[1] = c(uniqueItems[1],
 uniqueItems[2]), uniqueItems[3] = uniqueItems[3])
 
 # Error message
 Error: syntax error
 
 # In the help they use constant names to rename the
 #levels, so this works (but that's not what I want
 #because I don't want to change the code every time I
 #use another data set):
 newlevels - list(setosa = c(uniqueItems[1],
 uniqueItems[2]), virginica = uniqueItems[3])
 
 levels(finaldataset$Species) - newlevels
 
 levels(finaldataset$Species)
 
 finaldataset$Species
 
 ---
 
 Thanks in advance,
 
 Martin
 
 __
 R-help@stat.math.ethz.ch mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide! 
 http://www.R-project.org/posting-guide.html
 
 


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


[R] Bioconductor and R-devel

2005-08-31 Thread Jennifer Lai
Hi,
   I have built R (current development version) and BioConductor 1.7 
with portland group compiler on a AMD Opteron.
When I ran qc assessment on Affymetrix latin square data set, I got the 
following output,

Loading required package: affy
Loading required package: Biobase
Loading required package: tools
Welcome to Bioconductor
 Vignettes contain introductory material.  To view,
 simply type: openVignette()
 For details on reading vignettes, see
 the openVignette help page.
Loading required package: reposTools
Welcome to 'simpleaffy' V 2.1.3 
  Produced by The Paterson Institute for Cancer Research
  and funded by CANCER RESEARCH UK. 
  http://bioinformatics.picr.man.ac.uk/simpleaffy   
  mailto: [EMAIL PROTECTED] 
Background correcting
Retrieving data from AffyBatch...done.
Computing expression calls...
.done.
scaling to a TGT of 100 ...
Scale factor for: 0203_YH10_H_MCF7_r1.CEL 0.291660289301555
Scale factor for: 0203_YH11_H_MCF10A_r1.CEL 0.42025300545212
Scale factor for: 0203_YH12_H_a100MCF7_r1.CEL 0.287589038746987
Scale factor for: 0203_YH13_H_a100MCF10A_r1.CEL 0.451200408584071
Scale factor for: 0203_YH14_H_a10MCF7_r1.CEL 0.385462078301135
Scale factor for: 0203_YH15_H_a100MCF7_r2.CEL 0.284974495993646
Scale factor for: 0203_YH16_H_a100MCF7_r3.CEL 0.376484877281483
Scale factor for: 0203_YH17_H_a100MCF10A_r2.CEL 0.374087365857816
Scale factor for: 0203_YH18_H_a100MCF10A_r3.CEL 0.487207458237659
Scale factor for: 0203_YH19_H_a10MCF7_r2.CEL 0.413217979158927
Scale factor for: 0203_YH20_H_a10MCF7_r3.CEL 0.482703032325383
Scale factor for: 0203_YH21_H_a10MCF10A_r1.CEL 0.945369712044904
Scale factor for: 0203_YH22_H_a10MCF10A_r2.CEL 1.96143996386198
Scale factor for: 0203_YH23_H_a10MCF10A_r3_rescan.CEL 0.841535915879218
Scale factor for: 0203_YH24_H_MCF7_r2.CEL 0.347795838770919
Scale factor for: 0203_YH25_H_MCF7_r3.CEL 0.318539156900791
Scale factor for: 0203_YH26_H_MCF10A_r2.CEL 0.578922233010316
Scale factor for: 0203_YH27_H_MCF10A_r3.CEL 0.394833650209601
Scale factor for: 0403_YH34_H_a10MCF10A_r4.CEL 1.06804698986081
Scale factor for: 0403_YH35_H_a1MCF7_r1_2.CEL 3.5923019165673
Scale factor for: 0403_YH36_H_a1MCF7_r2.CEL 3.16130786066591
Scale factor for: 0403_YH37_H_a1MCF7_r3_2.CEL 2.01330391697437
Scale factor for: 0403_YH38_H_a1MCF10A_r1.CEL 0.923881702153984
Scale factor for: 0403_YH39_H_a1MCF10A_r2_2.CEL 2.29265379531566
Scale factor for: 0403_YH40_H_a1MCF10A_r3.CEL 4.02474777803345
Getting probe level data...
Computing p-values
Doing PMA Calls
TEST 1 : time Elapsed =  0 1 20

Background correcting
Retrieving data from AffyBatch...done.
Computing expression calls...
.Error in FUN(X[[9]], ...) : Expecting 22283 unique probesets, 
found 22284


Can anyone advise me on how to fix this problem? I was able to run the 
same data set with gcc-compiled R2.1.1 and BioConductor 1.6 successfully.


Here is the code that I ran, if it helps to diagnose the problems.

library(simpleaffy);
library(affy);

ampli.data - ReadAffy()

# normalize the data using call.exprs and mas5
ampli.eset - call.exprs(ampli.data, mas5)

# see what data is stored in [EMAIL PROTECTED]@preprocssing
names([EMAIL PROTECTED]@preprocessing)

# acess each piece of information within 
[EMAIL PROTECTED]@preprocessing scale factors
[EMAIL PROTECTED]@preprocessing$sfs

# filenames so that the scale factors can be related to their chips
[EMAIL PROTECTED]@preprocessing$filenames

# tgt is the target intensity each chip was scaled to
[EMAIL PROTECTED]@preprocessing$tgt

# which version of the affy package was used
[EMAIL PROTECTED]@preprocessing$affyversion

qc.data - qc(ampli.data, ampli.eset);

slotNames(qc.data);

# scale.factors contains a list of scale factors applied to each chip;
[EMAIL PROTECTED]

# target is the target intensity that each chip was scaled to
[EMAIL PROTECTED]

# percent.present is a list of the percentage of probesets called 
present on each chip;
[EMAIL PROTECTED]

# average.background, minimum.background, maximum.background are all 
lists detailing
# the average, minimum and maximum background for each chip;
[EMAIL PROTECTED]

# spikes is a matrix containing normalized values for each of the spike 
controls
colnames([EMAIL PROTECTED])



Thanks,
Jennifer

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


Re: [R] tcl/tk return problem

2005-08-31 Thread Philippe Grosjean
Duncan Murdoch wrote:
 On 8/31/2005 8:57 AM, Prof Brian Ripley wrote:
 
 On Wed, 31 Aug 2005, Duncan Murdoch wrote:

 Prof Brian Ripley wrote:
  On Wed, 31 Aug 2005, Philippe Grosjean wrote:
 
 
 deggle wrote:
 
 Hello,
 
 I'm very new in working with tcl/tk in R and have a problem which 
 will
 probably
 sound silly to most of you.
 Here is the code I have problems with:
 
 readcelfiles - function()
 {
require(tcltk)
tt - tktoplevel()
tkgrid(tklabel(tt,text=Choose a directory!))
 
  OnOK - function()
  {
 fileDir-tclvalue(tkchooseDirectory())
 data.raw - ReadAffy(celfile.path=fileDir)
 #return(data.raw)
  }
 
OK.but - tkbutton(tt,text=OK,command=OnOK)
tkgrid(OK.but)
tkfocus(tt)
 }
 
 So after clicking on my OK button, I choose my directory and 
 read the
 cel-files.
 But now I want to return the object to my workspace ... return 
 doesn't
 work here.
 
 I suppose you mean in the User Workspace. Your OnOK function should 
 look
 like that:
 
 OnOK - function() {
   fileDir-tclvalue(tkchooseDirectory())
   data.raw - ReadAffy(celfile.path=fileDir)
 }
 
 Note that the function overwrites any existing 'data.raw', so this 
 could
 be dangerous. Writting directly in the User Workspace is not advised
 from inside a function, but here, it is the simplest way to return a
 result from a tk widget action.
 
 
  Maybe simplest, but not a very good way.  See
  R_SOURCES/src/library/tcltk/R/utils.R for ideas on how to write a 
 modal
  dialog box that returns the value selected.
 
  One problem with - is that it does not necessarily write in the
  workspace.  You need
 
 assign(data.raw, ReadAffy(celfile.path=fileDir), 
 envir=.GlobalEnv)
 
  to be sure of that.  (The example code I quote does use - but in a
  controlled way.)

 This works, and you weren't suggesting it as a good style, but I'd like
 to say it's really a bad style to write to .GlobalEnv.


 It was the question asked! 
 
 
 Yes, I agree, but I was pointing out that it is probably the wrong 
 question.
 
 Duncan Murdoch

This was to provide a direct answer to the question. I think I said it 
is not a good practice. For storing temporary variables for a GUI, I 
prefer to use a dedicated workspace. The very simple functions 
assignTemp(), getTemp() and rmTemp() in the svMisc package (SciViews 
bundle) ease its use. 'TempEnv' is used in SciViews-R, and, after a 
suggestion, John Fox included it also in R Commander (called 'RcmdrEnv' 
there).

May be a modal Tk dialog box is all what is needed here... Although 
since we are speaking about good and bad questions, I wonder if the 
whole stuff is of any value:

1°) Draw a Tk dialog just with a Choose a directory! and an OK 
button is totally useless. Why not to display tkchooseDirectory() 
directly? After all, the 'Cancel' button is there in case the user does 
not want to proceed. This error in GUI design is to place in the same 
bag as Do you want to quit? - Do you really want to quit? - Are 
you really sure you really want to quit? !!!

2°) However, if the initial idea is to place other info in the Tk 
dialog, it then makes sense. Now, if this is the case, it is not 
necessary to put tkchooseDirectory() in the OnOK() function. The 
following code is doing the job without all the problems mentioned:

  # This is because I don't have the ReadAffy() function...
  ReadAffy - function(celfile.path) return(celfile.path)
 
  readcelfiles - function() {
  require(tcltk)
  tt - tktoplevel()
  tkgrid(tklabel(tt, text = Choose a directory!))
  tkgrid(tkbutton(tt, text = OK,
   command = function() tkdestroy(tt)))
  tkfocus(tt)
  tkwait.window(tt)
  fileDir-tclvalue(tkchooseDirectory())
  return(ReadAffy(celfile.path = fileDir))
  }
  readcelfiles()

So... perhaps the wrong question is not where one think it is ;-)
Best,

Philippe

   If you use a non-modal tcltk dialog you
 
 have little choice, as the parent function will have returned and 
 vanished
 long ago.  Now, having a widget firing off R commands independently of 
 the
 command line is not a great idea (R's evaluator is not multithreaded and
 this could be interspersed in another computation) so there is a lot 
 to be
 said for using dialog boxes modally.

 The controlled use of - as in tk_select.list from the file you
 quoted is really the best way to solve this problem.  As a general
 rule, you shouldn't stomp on something you don't own, and functions
 don't own variables in .GlobalEnv.


 One could argue the user who pressed the button does: it is the user
 workspace.

 What tk_select.list does is define OnOK locally, and use - to write to
 the tk_select.list environment.  Then the result can be manipulated and
 returned politely, without stomping on anything anywhere.


 
 


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

[R] Cases as Variables in Principal Component Analysis?

2005-08-31 Thread Yukihiro Ishii
Dear R users,

I have a data set of 25 cases with 150-160 explanatory variables(the
number of which depends on what I choose from 200 odd digitalized spectrum
strength numbers) and one dependent variable(a sensory test result). My
natural choice is to work on a principal component analysis using the
explanatory variables, thus enabling to characterize and describe the
data space, and make a regression of the dependent variable on the
principal components. 

But a colleague of mine transposed the data matrix and, using the cases
as the independent variables, explained the dependent variable in terms
of the principal components he had. He changed obviously the score for the
rotation. The analysis gave a plausible story. But I can't be sure of the
physical meaning of it. 

My colleague says that this method is common in the image analysis
proper, which he specializes in. 

Is there anyone who can comment on this matter. Venables  Ripley says
something to the effect that either method will do, but the authors do
not seem to give a specific example.

In my trade(chemistry), the data is commonly analyzed by the PLS(Partial
Least Suare) method, which seems to give more or less the same result.
Only the contribution of the PC's seems to be different.

I would appreciate any help. Thank you.

-- 
Yukihiro Ishii [EMAIL PROTECTED]

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


Re: [R] Bioconductor and R-devel

2005-08-31 Thread Seth Falcon
Hi Jennifer,

I'm moving this over to the bioconductor mail list since we are
discussing Bioconductor packages, that would be the best place for the
discussion at this point.  Please subscribe and reply there.

A couple quick comments:

1. You do realize BioC 1.7 is the current devel version, right?
2. After you see the error, try traceback() to get a better idea of
   where things are going wrong.  Then you can use debug(someFunc) to
   debug in the place where the error occurs.  I'm sure the package
   maintainers will be most receptive to any bug fixes.

Best,

+ seth


On 31 Aug 2005, [EMAIL PROTECTED] wrote:

 Hi, I have built R (current development version) and BioConductor
 1.7 with portland group compiler on a AMD Opteron.  When I ran qc
 assessment on Affymetrix latin square data set, I got the following
 output,

 Loading required package: affy Loading required package: Biobase
 Loading required package: tools Welcome to Bioconductor Vignettes
 contain introductory material.  To view, simply type: openVignette()
 For details on reading vignettes, see the openVignette help page.
 Loading required package: reposTools Welcome to 'simpleaffy' V 2.1.3
 Produced by The Paterson Institute for Cancer Research and funded by
 CANCER RESEARCH UK.  http://bioinformatics.picr.man.ac.uk/simpleaffy
 mailto: [EMAIL PROTECTED] Background correcting Retrieving
 data from AffyBatch...done.  Computing expression
 calls...  .done.  scaling to a TGT of 100
 ...  Scale factor for: 0203_YH10_H_MCF7_r1.CEL 0.291660289301555
 Scale factor for: 0203_YH11_H_MCF10A_r1.CEL 0.42025300545212 Scale
 factor for: 0203_YH12_H_a100MCF7_r1.CEL 0.287589038746987 Scale
 factor for: 0203_YH13_H_a100MCF10A_r1.CEL 0.451200408584071 Scale
 factor for: 0203_YH14_H_a10MCF7_r1.CEL 0.385462078301135 Scale
 factor for: 0203_YH15_H_a100MCF7_r2.CEL 0.284974495993646 Scale
 factor for: 0203_YH16_H_a100MCF7_r3.CEL 0.376484877281483 Scale
 factor for: 0203_YH17_H_a100MCF10A_r2.CEL 0.374087365857816 Scale
 factor for: 0203_YH18_H_a100MCF10A_r3.CEL 0.487207458237659 Scale
 factor for: 0203_YH19_H_a10MCF7_r2.CEL 0.413217979158927 Scale
 factor for: 0203_YH20_H_a10MCF7_r3.CEL 0.482703032325383 Scale
 factor for: 0203_YH21_H_a10MCF10A_r1.CEL 0.945369712044904 Scale
 factor for: 0203_YH22_H_a10MCF10A_r2.CEL 1.96143996386198 Scale
 factor for: 0203_YH23_H_a10MCF10A_r3_rescan.CEL 0.841535915879218
 Scale factor for: 0203_YH24_H_MCF7_r2.CEL 0.347795838770919 Scale
 factor for: 0203_YH25_H_MCF7_r3.CEL 0.318539156900791 Scale factor
 for: 0203_YH26_H_MCF10A_r2.CEL 0.578922233010316 Scale factor for:
 0203_YH27_H_MCF10A_r3.CEL 0.394833650209601 Scale factor for:
 0403_YH34_H_a10MCF10A_r4.CEL 1.06804698986081 Scale factor for:
 0403_YH35_H_a1MCF7_r1_2.CEL 3.5923019165673 Scale factor for:
 0403_YH36_H_a1MCF7_r2.CEL 3.16130786066591 Scale factor for:
 0403_YH37_H_a1MCF7_r3_2.CEL 2.01330391697437 Scale factor for:
 0403_YH38_H_a1MCF10A_r1.CEL 0.923881702153984 Scale factor for:
 0403_YH39_H_a1MCF10A_r2_2.CEL 2.29265379531566 Scale factor for:
 0403_YH40_H_a1MCF10A_r3.CEL 4.02474777803345 Getting probe level
 data...  Computing p-values Doing PMA Calls TEST 1 : time Elapsed =
 0 1 20

 Background correcting Retrieving data from AffyBatch...done.
 Computing expression calls...  .Error in FUN(X[[9]], ...) :
 Expecting 22283 unique probesets, found 22284


 Can anyone advise me on how to fix this problem? I was able to run
 the same data set with gcc-compiled R2.1.1 and BioConductor 1.6
 successfully.


 Here is the code that I ran, if it helps to diagnose the problems.

 library(simpleaffy);
 library(affy);

 ampli.data - ReadAffy()

 # normalize the data using call.exprs and mas5
 ampli.eset - call.exprs(ampli.data, mas5)

 # see what data is stored in [EMAIL PROTECTED]@preprocssing
 names([EMAIL PROTECTED]@preprocessing)

 # acess each piece of information within 
 [EMAIL PROTECTED]@preprocessing scale factors
 [EMAIL PROTECTED]@preprocessing$sfs

 # filenames so that the scale factors can be related to their chips
 [EMAIL PROTECTED]@preprocessing$filenames

 # tgt is the target intensity each chip was scaled to
 [EMAIL PROTECTED]@preprocessing$tgt

 # which version of the affy package was used
 [EMAIL PROTECTED]@preprocessing$affyversion

 qc.data - qc(ampli.data, ampli.eset);

 slotNames(qc.data);

 # scale.factors contains a list of scale factors applied to each
 # chip;
 [EMAIL PROTECTED]

 # target is the target intensity that each chip was scaled to
 [EMAIL PROTECTED]

 # percent.present is a list of the percentage of probesets called 
 present on each chip;
 [EMAIL PROTECTED]

 # average.background, minimum.background, maximum.background are all
 lists detailing
 # the average, minimum and maximum background for each chip;
 [EMAIL PROTECTED]

 # spikes is a matrix containing normalized values for each of the
 # spike
 controls
 colnames([EMAIL PROTECTED])



 Thanks,
 Jennifer

 __
 

Re: [R] xtable

2005-08-31 Thread Don MacQueen
You do have to load optional packages in each R session. See

   ?require

But you can automate the loading; see

   ?Startup

-Don

At 6:46 PM +0200 8/30/05, Mag. Ferri Leberl wrote:
I have installed package xtable with

su -c 'R CMD INSTALL xtable'

and got this promising feedback:

* Installing *source* package 'xtable' ...
** R
** data
** help
   Building/Updating help pages for package 'xtable'
  Formats: text html latex example
* DONE (xtable)

Despite that, R returns:

Error: couldn't find function print.xtable
Execution halted

when I call that function.
What have I done wrong? Do I have to activate the package everytime when I
start R?
Thank you in advance!

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


-- 
--
Don MacQueen
Environmental Protection Department
Lawrence Livermore National Laboratory
Livermore, CA, USA

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


[R] loop

2005-08-31 Thread Hathaikan Chootrakool
I was wondering why this loop doesn't work!

for (i in 1:k)
fnTr[i] -  function (p) 0.5* sum ( n*log(2*pi) - log(sd(i)^2)
 +(logitp(i)-p)^2/sd(i)^2 )
outTr[i]- nlm (fnTr[i],p=c(10),hessian=TRUE)
minimumTr[i] - outTr[i]$minimum
valueTr[i] - outTr[i]$estimate
list (minimumTr[i],valueTr[i])

Has anyone can help me?

Thank you very much
Hathaikan

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


Re: [R] loop

2005-08-31 Thread ernesto
Hathaikan Chootrakool wrote:

I was wondering why this loop doesn't work!

for (i in 1:k)
fnTr[i] -  function (p) 0.5* sum ( n*log(2*pi) - log(sd(i)^2)
 +(logitp(i)-p)^2/sd(i)^2 )
outTr[i]- nlm (fnTr[i],p=c(10),hessian=TRUE)
minimumTr[i] - outTr[i]$minimum
valueTr[i] - outTr[i]$estimate
list (minimumTr[i],valueTr[i])

Has anyone can help me?

Thank you very much
Hathaikan

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

  

missing {} on your code block

for(...){
...
}

EJ

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


[R] extrating BLUP values from linear mixed models

2005-08-31 Thread Matt Robinson
Hello,

I wish to learn how to extract best linear unbiased predictor values from a
linear mixed model of repeated measures on individuals which has a random error
structure (random =~ 1|individual).

Thanks for your time,
Kind regards
Matt

--
Matt Robinson
Institute of Evolutionary Biology
University of Edinburgh

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


Re: [R] extrating BLUP values from linear mixed models

2005-08-31 Thread Doran, Harold
Use the ranef() command 

ranef(fm1, level=1)

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Matt Robinson
Sent: Wednesday, August 31, 2005 12:26 PM
To: r-help@stat.math.ethz.ch
Subject: [R] extrating BLUP values from linear mixed models

Hello,

I wish to learn how to extract best linear unbiased predictor values
from a linear mixed model of repeated measures on individuals which has
a random error structure (random =~ 1|individual).

Thanks for your time,
Kind regards
Matt

--
Matt Robinson
Institute of Evolutionary Biology
University of Edinburgh

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

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


[R] best c++ matrix library?

2005-08-31 Thread Ott Toomet
Hi folks,

I am planning to write some more time-consuming matrix manipulations
in c++.  What is the experience with the existing c++ matrix
libraries?  Do you have some recommendations?  Are some libraries more
compatible with R than the others?

All suggestions welcome!

Best,
Ott

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


[R] sinput for Windows

2005-08-31 Thread Isotta Felli
Hi, I'm trying to latex part of my R- code and don't know where to find the 
sinput package to include in my version of miktex (I have the LINUX version 
handy, but need also the Windows one) Any idea? (sorry it is not really a R 
question)
 
Thanks
Isotta


-

[[alternative HTML version deleted]]

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


[R] Block-Diagonal Matrix and Multivariate Skew Normal

2005-08-31 Thread Caio Lucidius Naberezny Azevedo
Dear R-users,
 
Does anybody know how to construct a block-diagonal matrix (with the blocks 
being different matrixs, concerning the dimension and the values) ? 
 
I would like to know also if there is any package that generates values from a 
multivariate skew normal distribution.
 
Thanks all,
 
Caio
 
 


-

[[alternative HTML version deleted]]

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


[R] En: Block-Diagonal Matrix and Multivariate Skew Normal

2005-08-31 Thread Caio Lucidius Naberezny Azevedo
Dear R-users,
 
Does anybody know how to construct a block-diagonal matrix (with the blocks 
being different matrixs, concerning the dimension and the values) ? 
 
I would like to know also if there is any package that generates values from a 
multivariate skew normal distribution.
 
Thanks all,
 
Caio
 
 


-


__


[[alternative HTML version deleted]]

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


[R] Reading numeric data in Excel as character data in R using RODBC

2005-08-31 Thread White, Charles E WRAIR-Wash DC
The Excel 'database' I am pulling from mixes multiple character
indicators for different kinds of non-numeric results in the same column
as the numeric values. A simple sqlFetch turns all of the character
indicators into NAs. I would like to pull in all of the Excel data as
character so that I can split the column into multiple types of vectors
and control the type conversion within R. Can anyone provide clues as to
how I go about getting RODBC to bring in data containing some numbers
without running a numeric conversion?

The simple code I use to pull data directly from Excel is generally
something like the following:
prj-'C:/data' 
library(RODBC)
channel -
odbcConnectExcel(paste(prj,/intermediate/datafile.xls,sep=''))
r - sqlTables(channel)
ifn.display - sqlFetch(channel, SHEET1)
il2.display - sqlFetch(channel, SHEET2)
pl.display - sqlFetch(channel, SHEET3)
odbcClose(channel)

Background: The current problem is small enough to solve with read.csv
but I expect to get larger problems in the future. My clients generally
give me data in Excel format. Sometimes I get multiple character
indicators for different kinds of non-numeric results. Sometimes I get
40+ sheets in a single file where all of the sheets are formatted alike.
I'd like to be ready to run a reasonably automated data conversion
whenever a client decides to give me both at once.

Thanks for your time.

Chuck

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


Re: [R] best c++ matrix library?

2005-08-31 Thread Vehbi Sinan Tunalioglu
Hi,

I used Meschach: http://www.math.uiowa.edu/~dstewart/meschach/
However, it is written in C. The API is strong. I used the same API and
trimmed down the functionality, as well. Both worked for me.

IBM Developworks has an article on the subject Matrix libraries for C
and C++:
http://www-128.ibm.com/developerworks/linux/library/l-matrix.html

It has also a comparison for some libraries.

I wonder if there is another library...

--vst


Ott Toomet wrote:
 Hi folks,
 
 I am planning to write some more time-consuming matrix manipulations
 in c++.  What is the experience with the existing c++ matrix
 libraries?  Do you have some recommendations?  Are some libraries more
 compatible with R than the others?
 
 All suggestions welcome!
 
 Best,
 Ott
 
 __
 R-help@stat.math.ethz.ch mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

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


Re: [R] sinput for Windows

2005-08-31 Thread Duncan Murdoch
On 8/31/2005 12:57 PM, Isotta Felli wrote:
 Hi, I'm trying to latex part of my R- code and don't know where to find the 
 sinput package to include in my version of miktex (I have the LINUX version 
 handy, but need also the Windows one) Any idea? (sorry it is not really a R 
 question)


If you have it on Linux, just grab a copy, install it in your localtexmf 
folder, and rebuild the indices.  miktex uses the same format for 
packages as other TeX implementations.

Duncan Murdoch

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


Re: [R] Block-Diagonal Matrix and Multivariate Skew Normal

2005-08-31 Thread Liaw, Andy
For your first question, here's a function originally posted by Ben Bolker,
with modification by Rich Raubertas:

blockdiag - function (x, ...) 
{
if (!is.list(x)) 
x - list(x)
args - list(...)
if (length(args)  0) 
args - c(x, args)
else args - x
idx - which(!sapply(args, is.matrix))
if (length(idx)  0) 
for (i in idx) args[[i]] - as.matrix(args[[i]])
if (length(args) == 1) 
return(args[[1]])
nr - sapply(args, nrow)
nc - sapply(args, ncol)
cumnc - cumsum(nc)
NR - sum(nr)
NC - sum(nc)
rowfun - function(m, zbefore, zafter) {
cbind(matrix(0, ncol = zbefore, nrow = nrow(m)), m, matrix(0, 
ncol = zafter, nrow = nrow(m)))
}
ret - rowfun(args[[1]], 0, NC - ncol(args[[1]]))
for (i in 2:length(args)) {
ret - rbind(ret, rowfun(args[[i]], cumnc[i - 1], NC - 
cumnc[i]))
}
ret
}

Andy

 From: Caio Lucidius Naberezny Azevedo
 
 Dear R-users,
  
 Does anybody know how to construct a block-diagonal matrix 
 (with the blocks being different matrixs, concerning the 
 dimension and the values) ? 
  
 I would like to know also if there is any package that 
 generates values from a multivariate skew normal distribution.
  
 Thanks all,
  
 Caio
  
  
 
   
 -
 
   [[alternative HTML version deleted]]
 
 __
 R-help@stat.math.ethz.ch mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide! 
 http://www.R-project.org/posting-guide.html
 
 


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


Re: [R] Advice about system for installing updating all R packa ge in a Linux Lab?

2005-08-31 Thread Warnes, Gregory R

If you have several different versions of R installed, you might want to use
a script like this one, which should work on (at least) 1.9.1 and newer.

script
#!/bin/sh

echo ##
echo ## This script will attempt to install all available R packages
echo ## from the package repositories:
echo ##
echo ##   - CRAN:  http://cran.r-project.org/;
echo ##   - BioCondictor:  http://www.bioconductor.org;
echo ##
echo ## As well as Pfizer custom packages
echo ## 
echo ##   - Rlsf:  ~warneg/src/R/Rlsf
echo ##   - AffyTool: nlvfs016:rstat-data/
echo ##   ExpressionAnalysis/StandardAffyAnalysis/AffyTool
echo ##
echo ##
echo ##

if [ -z '$1' ]; then
  RCMD=R
  echo ## Parameter 1 : R Command Name = $RCMD (Default)
else
  RCMD=$1
  echo ## Parameter 1 : R Command Name = $RCMD
fi
export RCMD
echo $RCMD

echo ##
echo ##
echo ##
echo ## Starting R ...
echo ##

$RCMD --vanilla EOF

##
## Update installed packages
##
update.packages (repos =http://cran.r-project.org,ask = FALSE,
installWithVers=TRUE )

##
## Install New Packages from CRAN
##
#
if (exists(new.packages,mode=function))
   {
 options(repos=http://cran.r-project.org;)
 new.list - new.packages(ask=FALSE)
   } else
   {
 CRAN.list - CRAN.packages()[,1]
 here.list - installed.packages()[,1]
 new.list - CRAN.list[ ! CRAN.list  %in% here.list ]
 
   }
   install.packages(pkgs=new.list, dependencies=TRUE, installWithVers=TRUE )

##
## Install (New) Bioconductor Packages
##
source(http://www.bioconductor.org/getBioC.R;) 
getBioC(groupName=all)
y

EOF

echo ##
echo ## All Done!
echo ##
echo ## *Check the log for failed package installs*
echo ##
echo ##
/script





 -Original Message-
 From: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED] Behalf Of Prof 
 Brian Ripley
 Sent: Saturday, August 20, 2005 1:28 AM
 To: Paul Johnson
 Cc: r-help@stat.math.ethz.ch
 Subject: Re: [R] Advice about system for installing  updating all R
 package in a Linux Lab?
 
 
 This is based on the pre-2.1.0 ideas.  Try
 
 update.packages(ask=FALSE)
 install.packages(new.packages(), dependencies=TRUE)
 
 However, I would suggest that you set up each student with a 
 library, say 
 ~/R/library, and point R_LIBS at it (set in Renviron.site).  
 That's what 
 we do for Windows, and it seems successful.  (We have other 
 reasons to 
 want very complete central Linux setups, one being that we 
 run more than 
 one archtecture where personal libraries are a little harder 
 to manage.)
 
 On Fri, 19 Aug 2005, Paul Johnson wrote:
 
  Good day:
 
  I'm administering 6 linux systems (FC4) in a student lab 
 and worry that
  users may want packages that are not installed.  I get 
 tired of adding
  them one by one.  Then I happened upon this page
 
  http://support.stat.ucla.edu/view.php?supportid=30
 
 Many of the commands there are now or about to be deprecated.  See my 
 article in the current R-News.
 
  about installing all R packages from CRAN.  That did not 
 run as it was,
  but after some fiddling I arrived at the following script, 
 which does
  run and it builds many packages and reports failures on the rest:
 
  #R_installAll.R
  options(repos = http://lib.stat.cmu.edu/R/CRAN/;)
  update.packages(ask=F)
  x - 
 packageStatus(repositories=http://cran.r-project.org/src/contrib;)
  st - x$avai[Status]
  install.packages(rownames(st)[which(st$Status==not installed)],
  dependencies=T)
 
  If I run that in batch mode (as root, of course)
 
R CMD BATCH R_installAll.R
 
  It produces some informative output. Some packages don't 
 build because
  they are for Windows.  As Prof Ripley mentioned recently, 
 some packages
  don't build because of gcc-4.0.1. Some fail because I don't 
 have some
  requisite libraries installed.  I try to deduce which FC 
 packages may be
  used to fix that and iterate the process now and then.
 
  But, for the most part, the packages to be OK (as far as I 
 can tell).
  The output of a recent update is posted on the net here, in 
 case you are
  interested to see (this lists the ones that don't build plus the
  successful updates):
 
  http://lark.cc.ku.edu/~pauljohn/software/R/R_installAll.Rout
 
  I can't see how this does any damage, since the packages that don't
  build are very graceful about erasing themselves, and the 
 ones that do
  build are automatically available for the users.
 
  Can you see any downside to scheduling this process to run as a cron
  job, say once per week, to keep packages up to date?
 
 None at all.  We do something similar (but based on 
 new.packages and with 
 a stoplist of packages that we know will not install).
 
 -- 
 Brian D. Ripley,  [EMAIL PROTECTED]
 Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
 University of Oxford, Tel:  +44 1865 272861 (self)
 1 South Parks Road, +44 1865 272866 (PA)
 Oxford OX1 3TG, UKFax:  +44 1865 272595
 
 

[R] b1 function in ch 12 scripts of MASS

2005-08-31 Thread Jordi
Dear list,

 

I have been trying to reproduce the scripts of the MASS library and I have
found a problem when trying to reproduce the code in 12.4, with the use of
neural networks and the function b1:

 

b1 - function(Z, ...)

{

   zp - Z[,3] - pmax(Z[,2], Z[,1])

   contour(xp/log(10), yp/log(10), matrix(zp, np),

  add=T, levels=0, labex=0, ...)

   zp - Z[,1] - pmax(Z[,3], Z[,2])

   contour(xp/log(10), yp/log(10), matrix(zp, np),

  add=T, levels=0, labex=0, ...)

}

 

Using this function, the contours appear in a much reduced zone of the
chart. Instead, if I use

 

b1 - function(Z, ...)

{

   zp - Z[,3] - pmax(Z[,2], Z[,1])

   contour(exp(xp), exp(yp), matrix(zp, np),

  add=T, levels=0, labex=0, ...)

   zp - Z[,1] - pmax(Z[,3], Z[,2])

   contour(exp(xp), exp(yp), matrix(zp, np),

  add=T, levels=0, labex=0, ...)

}

 

I get similar panels to the ones in the book. Also, this choice would be
consistent with the functions predplot and cushplot.

 

Am I doing something wrong? 

 

Regards

 

Jordi

 


[[alternative HTML version deleted]]

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


[R] label *on the side* in conditional lattice plots?

2005-08-31 Thread Maciej Kalisiak
I'm doing bwplot(x ~ y | z, ...) with lattice, but would like the
z-labels to appear to the *side* of each bwplot, rather than on top...
is this possible?  The main reason is that my bwplots are horizontal,
and as such can be nicely squished in the vertical axis (big
space-saver when including in papers), but  the labels get in the
way, look too large in comparison, while I have all this empty space
to the side of the plots which is being wasted instead...

-- 
Maciej Kalisiak
[EMAIL PROTECTED]
http://www.dgp.toronto.edu/~mac

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


Re: [R] best c++ matrix library?

2005-08-31 Thread Rafael Laboissiere
* Ott Toomet [EMAIL PROTECTED] [2005-08-31 19:53]:

 I am planning to write some more time-consuming matrix manipulations
 in c++.  What is the experience with the existing c++ matrix
 libraries?  Do you have some recommendations?  Are some libraries more
 compatible with R than the others?

Liboctave is a quite powerful C++ matrix library.  It is part of Octave
(www.octave.org), but you can write standalone applications with it.
Since liboctave links against standard Fortran and C libraries (lapack,
odepack, minpack, quadpack, slatec, fftw, etc), you have access to all
matrix algorithms of Octave.

Attached below is an example, showing eigenvalue computation (via the
lapack routine).  Also attached is the compilation command and the output
of the program (in my Debian sarge box).

I do not know how liboctave compares with the other libraries as regards
speed.  As far as I know, there is no efforts for gluing liboctave into
R. 

-- 
Rafael Laboissiere
$ g++ -I/usr/include/octave eig.cc -o eig -L/usr/lib/octave-2.1.69/ -loctave
$ LD_LIBRARY_PATH=/usr/lib/octave-2.1.69/ ./eig
Original Matrix
 3 2
 2 0

Eigen Vectors
 (0.447214,0) (-0.894427,0)
 (-0.894427,0) (-0.447214,0)

Eigen Values
(-1,0)
(4,0)

Recomposed Matrix
 (3,0) (2,0)
 (2,0) (-9.92587e-17,0)
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

Re: [R] label *on the side* in conditional lattice plots?

2005-08-31 Thread Wiener, Matthew
I think you might be able to use the horizontal argument to lattice to
rotate all your plots and squish them in the other dimension.  (Though I
don't know whether you consider that a good outcome ...)

Hope this helps,

Matt Wiener

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Maciej Kalisiak
Sent: Wednesday, August 31, 2005 4:21 PM
To: r-help@stat.math.ethz.ch
Subject: [R] label *on the side* in conditional lattice plots?


I'm doing bwplot(x ~ y | z, ...) with lattice, but would like the
z-labels to appear to the *side* of each bwplot, rather than on top...
is this possible?  The main reason is that my bwplots are horizontal,
and as such can be nicely squished in the vertical axis (big
space-saver when including in papers), but  the labels get in the
way, look too large in comparison, while I have all this empty space
to the side of the plots which is being wasted instead...

-- 
Maciej Kalisiak
[EMAIL PROTECTED]
http://www.dgp.toronto.edu/~mac

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

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


[R] Imputation using Pan in R

2005-08-31 Thread Yi-Fu Chen
Hi,

I've tried to run the multiple imputation for longitudinal data using Pan in 
R.
The trimmed data consist 10 individuals across 4 time points.
Following the example in panex.R, I imputated the model with one y variable 
and only random intercept.
It worked well.
The next step for me is to imputate a model with one y variable and both 
random intercept and slope.
The program ran well, but did not imputate any of my missing values.
I attached my codes in the following. Did I do anything wrong in the codes?

I am confused with the setting of xcol and zcol (and of course the pred).
Do anyone know how to set these matrices when including both random 
intercept and slope or when having 2 or more y's?

Any suggestions would be appreciated. Thanks!

Yi-fu

library(pan)
 y - c(5,8,NA,10,
+2,NA,NA,NA,
+10,10,8,NA,
+NA,10,4,NA,
+2,8,NA,9,
+NA,NA,NA,NA,
+8,6,NA,5,
+6,NA,NA,NA,
+10,2,NA,NA,
+6,8,NA,2)
 subj - c(1,1,1,1,
+   2,2,2,2,
+   3,3,3,3,
+   4,4,4,4,
+   5,5,5,5,
+   6,6,6,6,
+   7,7,7,7,
+   8,8,8,8,
+   9,9,9,9,
+   10,10,10,10)
 pred - cbind(int=rep(1,40),
+dummy1=rep(c(1,0,0,0),10),
+dummy2=rep(c(0,1,0,0),10),
+dummy3=rep(c(0,0,1,0),10),
+dummy4=rep(c(0,2,4,6),10))
 xcol - 1:4
 zcol - c(1,5)
 a - array (2,dim=c(2,2))
 prior - list(a=1,Binv=1,c=2,Dinv=a)
 result - pan(y,subj,pred,xcol,zcol,prior,seed=25679,iter=5000)
 result$y
 [1]   5   8 NaN  10   2 NaN NaN NaN  10  10   8 NaN NaN  10   4 NaN   2   8 
NaN
[20]   9 NaN NaN NaN NaN   8   6 NaN   5   6 NaN NaN NaN  10   2 NaN NaN   6 
8
[39] NaN   2



[[alternative HTML version deleted]]

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


[R] eigen-decomposition of symmetric BCCB matrices

2005-08-31 Thread Globe Trotter
Hi,

Can anyone please point to how to decompose BCCB
(Block-Circulant-Circulant-Block) matrices? I am interested in the derivations:
I do know that this can be numerically done using 2-dimensional FFTs.

Many thanks and best wishes!

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


Re: [R] best c++ matrix library?

2005-08-31 Thread Dirk Eddelbuettel
Ott Toomet otoomet at ut.ee writes:
 I am planning to write some more time-consuming matrix manipulations
 in c++.  What is the experience with the existing c++ matrix
 libraries?  Do you have some recommendations?  Are some libraries more
 compatible with R than the others?

A lng time ago, I used to use the newmat C++ library by Robert Davies -- 
see http://www.robertnz.net/nm_intro.htm which states 
This C++ library is intended for scientists and engineers who need to
 manipulate a variety of types of matrices using standard matrix operations.
 Emphasis is on the kind of operations needed in statistical calculations
 such as least squares, linear equation solve and eigenvalues.

In fact, my use even lead to a short review about newmat and g++ for the 
Journal 
of Applied Econometrics (http://dirk.eddelbuettel.com/papers/gccnewmat.ps.gz).

Robert has continued to maintain, support and extend newmat. I would probably 
start there if I needed a C++ Matrix library as newmat is (in no order of 
preference)
-- fairly small (unlike Boost)
-- as I recall, doesn't depend on anything else
-- well documented 
-- well tested
-- pretty clean conceptually

Moreover, Robert really is a statistician so there may be interest on his side
in tieing newmat to R if were to provide some prototypes. 

But this really is a question of programming style and preferences, and mine
certainly changed in the meantime so take this with the usual spoon of salt.

Hope this helps,  Dirk

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


Re: [R] loop

2005-08-31 Thread Jean Eid
just one more thing. Why are you defining the function over and over
again...


On Wed, 31 Aug 2005, Hathaikan Chootrakool wrote:

 I was wondering why this loop doesn't work!

 for (i in 1:k)
 fnTr[i] -  function (p) 0.5* sum ( n*log(2*pi) - log(sd(i)^2)
  +(logitp(i)-p)^2/sd(i)^2 )
 outTr[i]- nlm (fnTr[i],p=c(10),hessian=TRUE)
 minimumTr[i] - outTr[i]$minimum
 valueTr[i] - outTr[i]$estimate
 list (minimumTr[i],valueTr[i])

 Has anyone can help me?

 Thank you very much
 Hathaikan

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


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


[R] R environment

2005-08-31 Thread Jean Eid
This is probably a weird question but I need to know if there is a way...

I run an R batch job without saving the variables at each step to the
disk.   Is there a way to invoke another session of R and link it to the
same environment for read only.

The problem is that I am running optim with every step getting the
parameters into the global env using - However, I forgot to issue a
save(list=ls(),...) right after so I can load and see how the parameters
are changing. It's been couple of days and it is still running so I am
hoping that I can invoke another session of R and link it to the
environment of the batch session. Does this sound totally ridiculous ?

it is a debian machine with R 2.1.1


Thanks

Jean

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


[R] R binaries, platform independent and Design of Experiments

2005-08-31 Thread Nam-Ky Nguyen
Dear Rexpert,

I would like to thank those who spend time  answering my email on the
burning of a CD with all R binary files for Windows and Linux. I have
tried a couple of suggestions but have not been successful. I will pass
these suggestions to our system administrator and I am sure that he can
sort them out.

I hope that the future version of R will be written in Java so that it is
platform independent. This means there will be a single binary file for
each new version of R. At the moment there are files for Windows, Mac OS,
Fedora 1, 2, 3, 4, SUSE 9.1, 9.2, 9.3, etc.

I also hope that the future of version of R include more DOE (Design of
Experiments) modules. R will be more useful if it is not only a language
and environment for statistical computing and graphics, but also for
design of experiments. I am toying with the idea of adding to R some
modules of my Gendex DOE toolkit (http://designcomputing.net/gendex/). I
learn from an Rexpert that the first step for this exercise is to convert
my java code to C++.  As I do not know C++ (and life is short) please let
me know whether there is an alternative way without this conversion and
whether you can actively help me in this exercise.

Regards,
-- 
Nam-Ky Nguyen, Senior Lecturer
School of Mathematics, Statistics and Computer Science
University of New England, Armidale NSW 2351 Australia
[EMAIL PROTECTED]  Tel: +612 6773 2763
http://turing.une.edu.au/~nkn  Fax: +612 6773 3312

Please convert Word files into PDF files before sending them to me.
See http://www.gnu.org/philosophy/no-word-attachments.html

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


Re: [R] label *on the side* in conditional lattice plots?

2005-08-31 Thread Maciej Kalisiak
On 8/31/05, Wiener, Matthew [EMAIL PROTECTED] wrote:
 I think you might be able to use the horizontal argument to lattice to
 rotate all your plots and squish them in the other dimension.  (Though I
 don't know whether you consider that a good outcome ...)

I take it you mean to switch the layout so that the conditioned
bwplots are side by side, narrow but tall, with horizontal=TRUE, and
then incorporate into the paper by first rotating 90 degrees.  But is
there a way to rotate the axis labels then?  Having the z-label
written sideways is probably OK, but having the x- and y-axis labels
also sideways is just too much.

-- 
Maciej Kalisiak
[EMAIL PROTECTED]
http://www.dgp.toronto.edu/~mac

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


[R] Block-diagonal matrix

2005-08-31 Thread Caio Lucidius Naberezny Azevedo
Dear R-users,
 
Does anybody know how to construct a block-diagonal matrix (with the blocks 
being different matrixs, concerning the dimension and the values), without use 
loops ? 
 
 
Thanks all,
 
Caio



-

[[alternative HTML version deleted]]

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


Re: [R] label *on the side* in conditional lattice plots?

2005-08-31 Thread Maciej Kalisiak
On 8/31/05, Maciej Kalisiak [EMAIL PROTECTED] wrote:
 I take it you mean to switch the layout so that the conditioned
 bwplots are side by side, narrow but tall, with horizontal=TRUE, and

Oops, I obviously meant horizontal=FALSE...

-- 
Maciej Kalisiak
[EMAIL PROTECTED]
http://www.dgp.toronto.edu/~mac

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


Re: [R] R environment

2005-08-31 Thread Duncan Murdoch
Jean Eid wrote:
 This is probably a weird question but I need to know if there is a way...
 
 I run an R batch job without saving the variables at each step to the
 disk.   Is there a way to invoke another session of R and link it to the
 same environment for read only.
 
 The problem is that I am running optim with every step getting the
 parameters into the global env using - However, I forgot to issue a
 save(list=ls(),...) right after so I can load and see how the parameters
 are changing. It's been couple of days and it is still running so I am
 hoping that I can invoke another session of R and link it to the
 environment of the batch session. Does this sound totally ridiculous ?
 
 it is a debian machine with R 2.1.1

If you happened to have compiled R with debug information, you might be 
able to use gdb or another debugger to examine variables in the running 
process, but you probably didn't, and it's probably easier to kill the 
job, fix it, and start it again, than it would be to learn how to see 
the active variables using gdb.

Duncan Murdoch

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


[R] Question

2005-08-31 Thread Mahmoud Torabi
Dear Sir/Madam

I would be pleased if anybody can help me. I'm using linear mixed model
(lme) function.I'm doing some simulation in my research and need to be
assigned variance components values during of my program. Specifically,
when I use lme function, I can get some information by use summary() and I
can assign some valuse like variance of fixed parameters and variance of
random error
term by using for example  varFix and sigma.But I don't know how I can
assign for variance of random effect.
I know in SPLUS we have command var.ran, how about R ?

Thanks alot.
M.Torabi

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


[R] Linux Standalone Server Suggestions for R

2005-08-31 Thread Jia-Shing So
Hi All,

My group is  looking for any suggestions on what to purchase to  
achieve the most powerful number crunching system that $50k can buy.   
The main application that will be used is R so input on what hardware  
benefits R most will be appreciated.  The requirements are that it be  
a single standalone server (i.e. not a cluster solution), and it that  
must be able to run unix/linux.  If anyone has any experience/ 
suggestions regarding the following questions that would also be  
greatly appreciated.

AMD vs Intel chips, especially 64-bit versions of the two?
Using Itanium/Opterons and if so how much of a performance boost did  
you achieve vs other 64-bit chip sets?
Also, does anyone know if there is an upper thresh hold on much  
memory R can use?

Thanks in advance for any help and suggestions,

Jia-Shing So
Programmer Analyst
Biostatistics and Bioinformatics Lab
University of California, San Diego

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


[R] Data Mining Conference Program Announced

2005-08-31 Thread Lisa Solomon
DATA MINING 2006 CONFERENCE sponsored by Salford Systems
San Diego, California: March 29 - March 31, 2006

The Conference will offer Real-World Case Study Presentations including 
Cutting Edge Topics:  Crime Prevention * Anti-Terrorism * Gambling * 
Sports * Video Games * Food  Water Science * Diet Research * 
Standardized Testing

There will be special courses available for attendees who are new to Data 
Mining covering 

CART(R) Decision Trees
MARS(R) Modern regression analysis
TreeNet(tm) Jerome Friedman's Multiple Additive Trees
Random Forests(tm) Leo Breiman's Tree Ensembles

See how Data Mining is Used for Business, Biomedial, and Environmental 
applications. Find out why previous attendees rate our conferences the most 
informative in the industry.

If you would like more information, please click here:
http://www.salforddatamining.com/program-sd.htm

To be placed on the conference mailing list, please click here:
http://www.salforddatamining.com/2006InfoRequest.php

Best regards,
Lisa Solomon
Ph: (619)543-8880

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


Re: [R] Linux Standalone Server Suggestions for R

2005-08-31 Thread Whit Armstrong
you can test out a live PPC 64 bit system here:
http://www.openpowerproject.org/us/signup.php

I have successfully built R in my home dir and compiled a few packages for it.

Here are the machines available:

Universität AugsburgPeking University   
Server  OpenPower 720   OpenPower 720   
Equipment   4-Way POWER54-Way POWER5
Memory  8GB 16GB
InstallationDebian  SUSE Enterprise 9


I think the 16GB solution is approaching or beyond your budget.



-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Jia-Shing So
Sent: Wednesday, August 31, 2005 10:03 PM
To: r-help@stat.math.ethz.ch
Cc: Phuoc Hong
Subject: [R] Linux Standalone Server Suggestions for R

Hi All,

My group is  looking for any suggestions on what to purchase to  
achieve the most powerful number crunching system that $50k can buy.   
The main application that will be used is R so input on what hardware benefits 
R most will be appreciated.  The requirements are that it be a single 
standalone server (i.e. not a cluster solution), and it that must be able to 
run unix/linux.  If anyone has any experience/ suggestions regarding the 
following questions that would also be greatly appreciated.

AMD vs Intel chips, especially 64-bit versions of the two?
Using Itanium/Opterons and if so how much of a performance boost did you 
achieve vs other 64-bit chip sets?
Also, does anyone know if there is an upper thresh hold on much memory R can 
use?

Thanks in advance for any help and suggestions,

Jia-Shing So
Programmer Analyst
Biostatistics and Bioinformatics Lab
University of California, San Diego

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

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


Re: [R] basic anova and t-test question

2005-08-31 Thread Spencer Graves
  Does the following answer your question:

  set.seed(1)
  z0 - rnorm(100)
  p.z - 2*pnorm(-abs(z0))
  sum(p.z0.05)
[1] 5
  pchisq(sum(z0^2), 100, lower=FALSE)
[1] 0.917285

  Some of the 100 (in this case) normal random deviates seem 
statistically significant, even though the ensemble is not.

  spencer graves

[EMAIL PROTECTED] wrote:

 Hello,
 
 I'm posting this to receive some comments/hints about a rather statistical 
 than R-technical question ... .
 
 In an anova of a lme factor SSPos11 shows up non-significant, 
but in the t-test of the summay 2 of the 4 levels (one for
constrast) are significant. See below for some truncated output.
 
 I realize that the two test are different (F-test/t-test), 
but I'm looking for for a meaning. Maye you have a schenario
that explains how these differences can be created and how you'd
go ahead and analyse it further.
 
 When I use SSPos11 as te only fixed effect, it does it is not 
significant in either anova nor t-test, and a boxplot of the
factor shows that the levels are all quite similar (similar
variance and mean). Might the effect I observe be linked to
an unbalance design in the multifactorial model?
 
   thanks a lot for your help,
   +kind regards,
 
   Arne
 
 
anova(fit)
 
  numDF denDF  F-value p-value
 (Intercept)  1   540 323.4442  .0001
 SSPos1   3   540  15.1206  .0001
 ...
 SSPos11  3   540   1.1902  0.3128
 ...
 
 
summary(fit)
 
 Linear mixed-effects model fit by REML
  Data: d.orig 
AIC  BIClogLik
   1007.066 1153.168 -469.5329
 
 Random effects:
  Formula: ~1 | Method
 (Intercept)  Residual
 StdDev:   0.4000478 0.4943817
 
 Fixed effects: log(value + 7.5) ~ SSPos1 + SSPos2 + SSPos6 + SSPos7 + SSPos10 
 + SSPos11 + SSPos13 + SSPos14 + SSPos18 + SSPos19 +  
   Value  Std.Error  DF   t-value p-value
 (Intercept)   2.8621811 0.23125065 540 12.376964  0.
 SSPos1C  -0.1647937 0.06293993 540 -2.618269  0.0091
 SSPos1G  -0.3448095 0.05922479 540 -5.822047  0.
 SSPos1T   0.1083988 0.06087095 540  1.780797  0.0755
 ...
 SSPos11C -0.1540292 0.06171635 540 -2.495761  0.0129
 SSPos11G -0.1428980 0.05993122 540 -2.384368  0.0175
 SSPos11T -0.0039434 0.06133920 540 -0.064289  0.9488
 ...
 
 
   [[alternative HTML version deleted]]
 
 __
 R-help@stat.math.ethz.ch mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

-- 
Spencer Graves, PhD
Senior Development Engineer
PDF Solutions, Inc.
333 West San Carlos Street Suite 700
San Jose, CA 95110, USA

[EMAIL PROTECTED]
www.pdf.com http://www.pdf.com
Tel:  408-938-4420
Fax: 408-280-7915

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


[R] Dataset size in R

2005-08-31 Thread Peter.Watkins
Dear listers,

 

I would like to know whether a maximum size is set for data sets in R.

 

I'm planning on analysing data sets which have 33 points for a
sample. The response is from GCxGC output.

Also, with data analysis, is there a time-cost saving by performing the
analysis in Linux as against doing it in Windows XP?

 

Many thanks, Peter


[[alternative HTML version deleted]]

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