Re: [R] convolution of the double exponential distribution

2005-12-28 Thread Matthias Kohl
Hi David,

you can even increase the precision of these computations by changing 
the variables
DefaultNrFFTGridPointsExponent (default: 12 - 2^12 grid points) and 
TruncQuantile
(default: 1e-5) in our package distr; see
distroptions()

You can for instance use

distroptions(DefaultNrFFTGridPointsExponent, 14)
and
distroptions(TruncQuantile, 1e-8)

We checked our algorithm in case of Binomial, Poisson, Normal and 
Exponential distributions and found a very high precision; confer 
Section 5 of

http://www.stamats.de/comp.pdf

Moreover, for n-fold convolutions you can also use the function 
convpow which can be found under
http://www.uni-bayreuth.de/departments/math/org/mathe7/DISTR/nFoldConvolution.R

hth,
Matthias

Ravi, Duncan, and Matthias,

Thank you very much for the helpful replies. For convolutions with 2 or
3 copies, I found that the CDFs from the distr package closely match the
analytic results from this paper:
K. Singh, M. Xie, and W. E. Strawderman, Combining Information From
Independent Sources Through Confidence Distributions, Annals of
Statistics 33, no. 1 (2005): 159-183.

That gives me confidence that the package will also work well for higher
copy numbers. At least for me, using the package is much more convenient
than programming all the needed integrals into R.

David
___
David R. Bickel  http://davidbickel.com
Research Scientist
Pioneer Hi-Bred International (DuPont)
Bioinformatics and Exploratory Research
7200 NW 62nd Ave.; PO Box 184
Johnston, IA 50131-0184
515-334-4739 Tel
515-334-4473 Fax
[EMAIL PROTECTED], [EMAIL PROTECTED]


| -Original Message-
| From: Matthias Kohl [mailto:[EMAIL PROTECTED] 
| Sent: Friday, December 23, 2005 9:09 AM
| To: Bickel, David
| Cc: Duncan Murdoch; r-help@stat.math.ethz.ch
| Subject: Re: [R] convolution of the double exponential distribution
| 
| Duncan Murdoch schrieb:
| 
| On 12/22/2005 7:56 PM, Bickel, David wrote:
|   
| 
| Is there any R function that computes the convolution of the double
| exponential distribution?
| 
| If not, is there a good way to integrate ((q+x)^n)*exp(-2x) 
| over x from
| 0 to Inf for any value of q and for any positive integer n? 
| I need to
| perform the integration within a function with q and n as 
| arguments. The
| function integrate() is giving me this message:
| 
| evaluation of function gave a result of wrong length
| 
| 
| 
| Under the substitution of y = q+x, that looks like a gamma integral. 
| The x = 0 to Inf range translates into y = q to Inf, so 
| you'll need an 
| incomplete gamma function, such as pgamma.  Be careful to get the 
| constant multiplier right.
| 
| 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
|   
| 
| 
| Hi,
| 
| you can use our package distr.
| 
| require(distr)
| ## define double exponential distribution
| loc - 0 # location parameter
| sca - 1 # scale parameter
| 
| rfun - function(n){ loc + scale * ifelse(runif(n)  0.5, 1, 
| -1) * rexp(n) }
| body(rfun) - substitute({ loc + scale * ifelse(runif(n)  
| 0.5, 1, -1) * 
| rexp(n) },
|  list(loc = loc, scale = sca))
| 
| dfun - function(x){ exp(-abs(x-loc)/scale)/(2*scale) }
| body(dfun) - substitute({ exp(-abs(x-loc)/scale)/(2*scale) 
| }, list(loc 
| = loc, scale = sca))
| 
| pfun - function(x){ 0.5*(1 + 
| sign(x-loc)*(1-exp(-abs(x-loc)/scale))) }
| body(pfun) - substitute({ 0.5*(1 + 
| sign(x-loc)*(1-exp(-abs(x-loc)/scale))) },
|  list(loc = loc, scale = sca))
| 
| qfun - function(x){ loc - scale*sign(x-0.5)*log(1 - 2*abs(x-0.5)) }
| body(qfun) - substitute({ loc - scale*sign(x-0.5)*log(1 - 
| 2*abs(x-0.5)) },
|  list(loc = loc, scale = sca))
| 
| D1 - new(AbscontDistribution, r = rfun, d = dfun, p = 
| pfun, q = qfun)
| plot(D1)
| 
| D2 - D1 + D1 # convolution based on FFT
| plot(D2)
| 
| hth,
| Matthias
| 
| -- 
| StaMatS - Statistik + Mathematik Service
| Dipl.Math.(Univ.) Matthias Kohl
| www.stamats.de
| 

This communication is for use by the intended recipient and ...{{dropped}}

__
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
  



-- 
StaMatS - Statistik + Mathematik Service
Dipl.Math.(Univ.) Matthias Kohl
Gottlieb-Keim-Straße 60
95448 Bayreuth
Phone: +49 921 50736 457
E-Mail: [EMAIL PROTECTED]
www.stamats.de

__
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 on Mandriva 2006

2005-12-28 Thread Ioannis Dimakos

On Τετ, Δεκέμβριος 28, 2005 9:11, Paolo Bulla wrote:

 Hello anyone,

 I'm trying to install R on Mandriva 2006 distribution via rpm file with
 the
 line

 urpmi R-2.0.0-1mdk.i586.rpm



 but I got an error message saying that the file is not accessible due to
 some
 info problem.

 I also tried with a source code in R-2.1.1.tar but I think that there is
 some
 problem concerning the new version of gcc (4.x), so I downgraded it to gcc
 3.4.5 but it does not work either.

 Could anyone help me with this installation, please?
 Thanks,
  Paolo

 --
 Paolo Bulla

 Istituto di Metodi Quantitativi
 Universitΰ L. Bocconi
 Tel. +39 02.5836.5651
 viale Isonzo 25
 20136 Milano
 [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



-- 
Ioannis C. Dimakos, Ph.D.
University of Patras
Department of Elementary Education
Patras, GR-26500 GREECE
http://www.elemedu.upatras.gr/dimakos/
http://yannishome.port5.com/

__
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] [Fwd: Re: R on Mandriva 2006]

2005-12-28 Thread Ioannis Dimakos
Apologies for the empty post that went to the list...

On Τετ, Δεκέμβριος 28, 2005 9:11, Paolo Bulla wrote:
 Hello anyone,
 I'm trying to install R on Mandriva 2006 distribution via rpm file with the
 line
 urpmi R-2.0.0-1mdk.i586.rpm
^^

This is an older rpm that Michele Alzeta contributed for Mandrake 10.0
(and that was a long time ago, before Mandrakesoft merged with Connectiva
to become Mandriva).  And it is for R-2.0.0

In my experience with Mandrake distros, I have found it is easy to
download the most recent sources and compile your own version of R.


 I also tried with a source code in R-2.1.1.tar but I think that there is
^^^

Unless you have a typo, this is also an older version of R.  Get the newer
sources and recompile.  I don't know if Michele is still active in
maintaining R for Mandrake.  But he has a site for R and Mandrake in
italian and this may provide some first clues.

HTH,

Ioannis
-- 
Ioannis C. Dimakos, Ph.D.
University of Patras
Department of Elementary Education
Patras, GR-26500 GREECE
http://www.elemedu.upatras.gr/dimakos/
http://yannishome.port5.com/

__
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] Which cluster function can be used to cluster a correlaiton matrix?

2005-12-28 Thread Vincent Deng
Hi,

I'd got a matrix of correaltion values. Which cluster method can I use
to cluster it?


Best Regards...

__
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 on Mandriva 2006

2005-12-28 Thread Prof Brian Ripley

Please consult the posting guide and use a current version of R, 2.2.1.
If that does not work, please report the information the posting guide 
requests, including the exact problems you found.


R 2.2.1 should have no problem with gcc4, but versions predating the 
release of gcc4 may well do.


On Wed, 28 Dec 2005, Paolo Bulla wrote:



Hello anyone,

I'm trying to install R on Mandriva 2006 distribution via rpm file with the
line

urpmi R-2.0.0-1mdk.i586.rpm

but I got an error message saying that the file is not accessible due to some
info problem.

I also tried with a source code in R-2.1.1.tar but I think that there is some
problem concerning the new version of gcc (4.x), so I downgraded it to gcc
3.4.5 but it does not work either.

Could anyone help me with this installation, please?
Thanks,
Paolo

--
Paolo Bulla

Istituto di Metodi Quantitativi
Università L. Bocconi
Tel. +39 02.5836.5651
viale Isonzo 25
20136 Milano
[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



--
Brian D. Ripley,  [EMAIL PROTECTED]
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford, Tel:  +44 1865 272861 (self)
1 South Parks Road, +44 1865 272866 (PA)
Oxford OX1 3TG, UKFax:  +44 1865 272595__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

[R] Omegahat sjava

2005-12-28 Thread Neil Eastep
I am trying to download and install Omegahat Sjava 
(http://www.omegahat.org/RSJava) to be able to call R from within Java.

The install instructions are as follows:

cd $RHOME/src/library
   unzip SJava_0.69-0.zip
   cd SJava
   ./configure.win $RHOME
   cd $RHOME/src/gnuwin32
   make pkg-SJava

However, my command prompt won't recognize unzip,./configure.win, or 
make.  What should I do to make this work?

Neil Eastep.

__
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] Which cluster function can be used to cluster a correlaiton matrix?

2005-12-28 Thread Martin Maechler
 Vincent == Vincent Deng [EMAIL PROTECTED]
 on Wed, 28 Dec 2005 17:34:27 +0800 writes:

Vincent Hi, I'd got a matrix of correaltion values. Which
Vincent cluster method can I use to cluster it?

almost everyone.

The clue is to transform correlations to dissimilarities.
There are several choices for that, and it depends on the
context what you should do. 
If 'Cx' is your correlation matrix, reasonable possibilities are

  Dx - as.dist(1 - Cx)
  Dx - as.dist(1 - abs(Cx))
  Dx - as.dist(sqrt(1 - Cx^2))

and then use  hclust(), agnes(), pam(), [the latter two from
package 'cluster'], ... 
with 'Dx' as dissimilarity

__
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] Omegahat sjava

2005-12-28 Thread Uwe Ligges
Neil Eastep wrote:
 I am trying to download and install Omegahat Sjava 
 (http://www.omegahat.org/RSJava) to be able to call R from within Java.
 
 The install instructions are as follows:
 
 cd $RHOME/src/library
unzip SJava_0.69-0.zip
cd SJava
./configure.win $RHOME
cd $RHOME/src/gnuwin32
make pkg-SJava

 However, my command prompt won't recognize unzip,./configure.win, or 
 make.  What should I do to make this work?

Please read the whole page you cited above and install the required 
tools. Which tools are required to build packages from source is also 
described in the R Installation and Administration manual.

Perhaps you can live with the CRAN package rJava (there is a binary 
Windows version available).

Uwe Ligges




 Neil Eastep.
 
 __
 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] Which cluster function can be used to cluster a correlaiton matrix?

2005-12-28 Thread Frank E Harrell Jr
Vincent Deng wrote:
 Hi,
 
 I'd got a matrix of correaltion values. Which cluster method can I use
 to cluster it?
 
library(Hmisc)
?varclus

__
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] Open a new script from R command prompt

2005-12-28 Thread Ronnie Babigumira
Hi, (this is a minor irritation), is it possible for me to call R's editor from 
the R command prompt (I searched for 
script but that didn't yield anything). (The mouse-file-new-script route is a 
minor irritation )

__
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] segmetation fault

2005-12-28 Thread Elizabeth Lawson
Hey,
   
  I don;t know if anyone has come across this error before...
   
  I am running R on the terminal of my MAC OS X 10.3.4 and I have written C 
code and compiled it using 
  R CMD SHLIB mycode.c
  There were no problems in compiling so I now have mycode.o and mycode.so.
  I used dyn.load(mycode.so) and again, no problems.  But when I try to use 
the code .C(mycode,x) I get the error Segmentation fault and R shuts down.  
Any ideas as to where my problem could be?
   
  Any ideas or help would be appreciated!
   
  Thanks,
   
  Elizabeth Lawson


-

 Ring in the New Year with Photo Calendars. Add photos, events, holidays, 
whatever.
[[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] [Fwd: Re: R on Mandriva 2006]

2005-12-28 Thread Christophe Pouzat
Hi Ioannis and Paolo,

As Ioannis recommends getting the last R source (R-2.2.1) is better and 
does not require much effort.
If you want the compilation to go smoothly on Mandriva 2006 you should 
first use drakconf to download and install:

gfortran
readline
blas

which are not installed by default by the powerpack (or free) distribution.

Then follow the basic Unix/Linux intructions (to compile from sources) 
on the R Installation and Administration Manual (ie, tar -xvzf 
R-2.2.1.tar.gz, cd R-2.2.1, ./configure, make, make check, 
make install).

Mandriva 2006 uses gcc-4.0.1, etc. On my machine (Intel PIV) all the 
tests went fine.

Christophe.

Ioannis Dimakos a écrit :

Apologies for the empty post that went to the list...

On Τετ, Δεκέμβριος 28, 2005 9:11, Paolo Bulla wrote:
  

Hello anyone,
I'm trying to install R on Mandriva 2006 distribution via rpm file with the
line
urpmi R-2.0.0-1mdk.i586.rpm


^^

This is an older rpm that Michele Alzeta contributed for Mandrake 10.0
(and that was a long time ago, before Mandrakesoft merged with Connectiva
to become Mandriva).  And it is for R-2.0.0

In my experience with Mandrake distros, I have found it is easy to
download the most recent sources and compile your own version of R.


  

I also tried with a source code in R-2.1.1.tar but I think that there is


^^^

Unless you have a typo, this is also an older version of R.  Get the newer
sources and recompile.  I don't know if Michele is still active in
maintaining R for Mandrake.  But he has a site for R and Mandrake in
italian and this may provide some first clues.

HTH,

Ioannis
  


__
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] parameterization of factor in R

2005-12-28 Thread Oana Mocila
Dear Prof Brian Ripley and Graves,

Thank you for your replies. MASS has been very helpful!

Oana


From: Spencer Graves [EMAIL PROTECTED]
To: Prof Brian Ripley [EMAIL PROTECTED]
CC: Oana Mocila [EMAIL PROTECTED], r-help@stat.math.ethz.ch
Subject: Re: [R] parameterization of factor in R
Date: Tue, 27 Dec 2005 12:27:05 -0800

 If you are not familiar with MASS (Modern Applied Statistics with S, 
 4th 
ed, Venables and Ripley 2002, Springer), I can assure you it is an 
excellent reference for learning R.  There are many books on R that I have 
not read, but among the books in my personal library, I refer to MASS 
fairly frequently.  If it is beyond your budget and not in a local library, 
I encourage you to investigate the possibility of having that library 
obtain a copy.  If the library needs justification, please explain what you 
know of the book, how it became recommended for you, the problems you hope 
it will help you solve, etc.

 Spencer Graves

Prof Brian Ripley wrote:

?contr.sum

And Chapter 6 of MASS would have explained all this to you, so if you have 
further questions please consult it.

On Tue, 27 Dec 2005, Oana Mocila wrote:


I encountered this problem with parameterization in R:

I have two factors in a regression. how about if I want to
set constraint so that for each factor, the sum of their
coefficients equals to zero(instead of choosing a reference
category)? for example, I have factor(variable) A(with three
categories) and factor(variable) B(with 4 categories), and I want
to parameterize so that the sum of the three coefficients of
A = 0, and sum of the four coefficients of B = 0? I
mean how to do it in R?



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


Re: [R] segmetation fault

2005-12-28 Thread Kort, Eric

Elizabeth Lawson Wrote:
 
 Hey,
 
   I don;t know if anyone has come across this error before...

More times than I care to remember.

 
   I am running R on the terminal of my MAC OS X 10.3.4 and I have
written
 C code and compiled it using
   R CMD SHLIB mycode.c
   There were no problems in compiling so I now have mycode.o and
mycode.so.

A segmentation fault occurs when you try to access memory you didn't
allocate for your use (see below).  In other words, you are trying to
use memory outside the segment allocated to your program (which, if
allowed, could result in corrupting memory being used by other
programs--which brings back unhappy memories of days gone by when an
error in one program could crash the whole system). So these kinds of
problems will not show up at compile time...only when you actually run
the program.

   I used dyn.load(mycode.so) and again, no problems.  But when I try
to
 use the code .C(mycode,x) I get the error Segmentation fault and R
shuts
 down.  Any ideas as to where my problem could be?

When I run into a segmentation fault, it is usually because I am trying
to access an element of an array that is beyond what I have allocated,
as in...

int main()
{
  int *a;
  a = (int*) malloc(3*sizeof(int));
  printf(Fasten your seatbelts...\n);
  a[4000] = 12;
  return(0);
}

One less obvious way this can happen is forgetting to initialize your
arrays to the proper length before passing a reference to them to your C
function.  

If you still are having trouble, you could post a small snippet of code
that recreates the error for us to examine.

HTH,
Eric


This email message, including any attachments, is for the so...{{dropped}}

__
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] Open a new script from R command prompt

2005-12-28 Thread bogdan romocea
Are you talking about Rgui on Windows? Use the shortcut, Alt-F-N.

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Ronnie
Babigumira
Sent: Wednesday, December 28, 2005 9:21 AM
To: R Help
Subject: [R] Open a new script from R command prompt


Hi, (this is a minor irritation), is it possible for me to call R's
editor from the R command prompt (I searched for
script but that didn't yield anything). (The mouse-file-new-script
route is a minor irritation )

__
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] lme X lmer results

2005-12-28 Thread Douglas Bates
On 12/26/05, Ronaldo Reis-Jr. [EMAIL PROTECTED] wrote:
 Hi,

 this is not a new doubt, but is a doubt that I cant find a good response.

 Look this output:

  m.lme - lme(Yvar~Xvar,random=~1|Plot1/Plot2/Plot3)

  anova(m.lme)
 numDF denDF  F-value p-value
 (Intercept) 1   860 210.2457  .0001
 Xvar1 2   1.2352  0.3821
  summary(m.lme)
 Linear mixed-effects model fit by REML
  Data: NULL
   AIC  BIClogLik
   5416.59 5445.256 -2702.295

 Random effects:
  Formula: ~1 | Plot1
 (Intercept)
 StdDev: 0.000745924

  Formula: ~1 | Plot2 %in% Plot1
 (Intercept)
 StdDev: 0.000158718

  Formula: ~1 | Plot3 %in% Plot2 %in% Plot1
 (Intercept) Residual
 StdDev: 0.000196583 5.216954

 Fixed effects: Yvar ~ Xvar
Value Std.Error  DF  t-value p-value
 (Intercept)2.3545454 0.2487091 860 9.467066  0.
 XvarFactor20.3909091 0.3517278   2 1.111397  0.3821

 Number of Observations: 880
 Number of Groups:
  Plot1   Plot2 %in% Plot1
  4  8
Plot3 %in% Plot2 %in% Plot1
 20

 This is the correct result, de correct denDF for Xvar.

 I make this using lmer.

  m.lmer - lmer(Yvar~Xvar+(1|Plot1)+(1|Plot1:Plot2)+(1|Plot3))
  anova(m.lmer)
 Analysis of Variance Table
Df Sum Sq Mean Sq  Denom F value Pr(F)
 Xvar  1  33.62   33.62 878.00  1.2352 0.2667
  summary(m.lmer)
 Linear mixed-effects model fit by REML
 Formula: Yvar ~ Xvar + (1 | Plot1) + (1 | Plot1:Plot2) + (1 | Plot3)
  AIC BIClogLik MLdeviance REMLdeviance
  5416.59 5445.27 -2702.295   5402.698  5404.59
 Random effects:
  GroupsNameVariance   Std.Dev.
  Plot3 (Intercept) 1.3608e-08 0.00011665
  Plot1:Plot2   (Intercept) 1.3608e-08 0.00011665
  Plot1 (Intercept) 1.3608e-08 0.00011665
  Residual  2.7217e+01 5.21695390
 # of obs: 880, groups: Plot3, 20; Plot1:Plot2, 8; Plot1, 4

 Fixed effects:
 Estimate Std. Error  DF t value Pr(|t|)
 (Intercept)  2.354550.24871 878  9.4671   2e-16 ***
 XvarFactor2  0.390910.35173 878  1.1114   0.2667
 ---
 Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

 Look the wrong P value, I know that it is wrong because the DF used. But, In
 this case, the result is not correct. Dont have any difference of the result
 using random effects with lmer and using a simple analyses with lm.

You are assuming that there is a correct value of the denominator
degrees of freedom.  I don't believe there is.  The statistic that is
quoted there doesn't have exactly an F distribution so there is no
correct degrees of freedom.

One thing you can do with lmer is to form a Markov Chain Monte Carlo
sample from the posterior distribution of the parameters so you can
check to see whether the value of zero is in the middle of the
distribution of XvarFactor2 or not.

It would be possible for me to recreate in lmer the rules used in lme
for calculating denominator degrees of freedom associated with terms
of the random effects.  However, the class of models fit by lmer is
larger than the class of models fit by lme (at least as far as the
structure of the random-effects terms goes).  In particular lmer
allows for random effects associated with crossed or partially crossed
grouping factors and the rules for denominator degrees of freedom in
lme only apply cleanly to nested grouping factors.  I would prefer to
have a set of rules that would apply to the general case.

Right now I would prefer to devote my time to other aspects of lmer -
in particular I am still working on code for generalized linear mixed
models using a supernodal Cholesky factorization.  I am willing to put
this aside and code up the rules for denominator degrees of freedom
with nested grouping factors BUT first I want someone to show me an
example demonstrating that there really is a problem.  The example
must show that the p-value calculated in the anova table or the
parameter estimates table for lmer is seriously wrong compared to an
empirical p-value - obtained from simulation under the null
distribution or through MCMC sampling or something like that.  Saying
that Software XYZ says there are n denominator d.f. and lmer says
there are m does NOT count as an example.  I will readily concede
that the denominator degrees of freedom reported by lmer are wrong but
so are the degrees of freedom reported by Software XYZ because there
is no right answer (in general - in a few simple balanced designs
there may be a right answer).


  m.lm - lm(Yvar~Xvar)
 
  anova(m.lm)
 Analysis of Variance Table

 Response: Nadultos
 Df  Sum Sq Mean Sq F value Pr(F)
 Xvar 133.633.6  1.2352 0.2667
 Residuals  878 23896.227.2
 
  summary(m.lm)

 Call:
 lm(formula = Yvar ~ Xvar)

 Residuals:
 Min  1Q  Median  3Q Max
 -2.7455 -2.3545 -1.7455  0.2545 

Re: [R] lme X lmer results

2005-12-28 Thread Douglas Bates
On 12/28/05, Douglas Bates [EMAIL PROTECTED] miswrote:
 It would be possible for me to recreate in lmer the rules used in lme
 for calculating denominator degrees of freedom associated with terms
 of the random effects.

I should have written fixed effects, not random effects at the end
of that sentence.

__
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] Axis/Ticks/Scale

2005-12-28 Thread R . C . GILL

Dear All,

Apologies for this simple question and thanks in advance for any help given.

Suppose I wanted to plot 1 million observations and produce the command

plot(rnorm(100))

The labels of the xaxis are 0, e+00 2 e+05 etc. These are clearly not very
attractive (The plots are for a PhD. thesis).

I would like the axes to be 0,2,4,6,8,10 with a *10^5 on the right hand
side.

Is there a simple command for this?

Best Wishes

Roger

__
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] Axis/Ticks/Scale

2005-12-28 Thread jim holtman
Here is one way to do it with a smaller set of data, but the 'range' is the
same:


 x - c(1,1000,100)
 y - pretty(range(x))
 y
[1] 0e+00 2e+05 4e+05 6e+05 8e+05 1e+06
 plot(x,1:3,xaxt='n', xlab=X * 10^5)
 axis(1, at=y, labels=y/10)




On 12/28/05, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:


 Dear All,

 Apologies for this simple question and thanks in advance for any help
 given.

 Suppose I wanted to plot 1 million observations and produce the command

 plot(rnorm(100))

 The labels of the xaxis are 0, e+00 2 e+05 etc. These are clearly not very
 attractive (The plots are for a PhD. thesis).

 I would like the axes to be 0,2,4,6,8,10 with a *10^5 on the right hand
 side.

 Is there a simple command for this?

 Best Wishes

 Roger

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




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

What the problem you are trying to solve?

[[alternative HTML version deleted]]

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


Re: [R] Axis/Ticks/Scale

2005-12-28 Thread P Ehlers
Try this:

x - c(1, 1e6); y - 0:1
par(mar = c(5, 4, 4, 5) + 0.1)  # make room at the right
plot(x, y, axes = FALSE)
box()
axis(2)
axis(1, at = 0:5 * 2 * 1e5, labels = 0:5 * 2)
mtext(text = expression(phantom(0)%*%10^5),
   side = 1, line = 1, at = 11.0 * 1e5)

Peter Ehlers

[EMAIL PROTECTED] wrote:
 Dear All,
 
 Apologies for this simple question and thanks in advance for any help given.
 
 Suppose I wanted to plot 1 million observations and produce the command
 
 plot(rnorm(100))
 
 The labels of the xaxis are 0, e+00 2 e+05 etc. These are clearly not very
 attractive (The plots are for a PhD. thesis).
 
 I would like the axes to be 0,2,4,6,8,10 with a *10^5 on the right hand
 side.
 
 Is there a simple command for this?
 
 Best Wishes
 
 Roger
 
 __
 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] Axis/Ticks/Scale

2005-12-28 Thread Marc Schwartz (via MN)
On Wed, 2005-12-28 at 20:15 +, [EMAIL PROTECTED] wrote:
 Dear All,
 
 Apologies for this simple question and thanks in advance for any help
 given.
 
 Suppose I wanted to plot 1 million observations and produce the
 command
 
 plot(rnorm(100))
 
 The labels of the xaxis are 0, e+00 2 e+05 etc. These are clearly not
 very
 attractive (The plots are for a PhD. thesis).
 
 I would like the axes to be 0,2,4,6,8,10 with a *10^5 on the right
 hand
 side.
 
 Is there a simple command for this?
 
 Best Wishes
 
 Roger


See ?plotmath for some additional examples and there are some others in
the list archives.

 set.seed(1)
 x - rnorm(100)

 # Now do the plot, but leave the x axis blank
 plot(x, xaxt = n)

 # Set the x axis label tick marks
 x.at - seq(0, 10, 2) * 10 ^ 5

 # Create the expressions for the tick mark labels
 # Using parse() takes the character vectors from paste()
 # and converts them to expressions for use in plotmath
 x.lab - parse(text = paste(seq(0, 10, 2), %*% 10^5))

 # Now do the axis labels
 axis(1, at = x.at, labels = x.lab)


HTH,

Marc Schwartz

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


Re: [R] segmetation fault and abort trap

2005-12-28 Thread Elizabeth Lawson
Sorry, one more thing.  Sometimes if crashes with Abort trap and sometimes it 
crashes with Segmentation fault.  Help!
   
  Thanks!

Elizabeth Lawson [EMAIL PROTECTED] wrote:
  I fixed the problem that I was having with the segmentation error and can 
load it with dyn.load.

I have one more problem now that I don't understand. I am using the .C in a for 
loop
for( i in 1:ncol(L.D)){
new[,i]-.C(mycode,as.double(L.D[,i]))
}

It crashes at different places each time I try to run it. So I tried
i-1
then running 
new[,i]-.C(mycode,as.double(L.D[,i]))
repeatedly.

It works for 3-6 times then will crash with the error 
abort trap

What does this mean?
Why does it work sometimes and not others?

Any suggestions?

Thanks,

Elizabeth Lawson
Kort, Eric wrote:

Elizabeth Lawson Wrote:
 
 Hey,
 
 I don;t know if anyone has come across this error before...

More times than I care to remember.

 
 I am running R on the terminal of my MAC OS X 10.3.4 and I have
written
 C code and compiled it using
 R CMD SHLIB mycode.c
 There were no problems in compiling so I now have mycode.o and
mycode.so.

A segmentation fault occurs when you try to access memory you didn't
allocate for your use (see below). In other words, you are trying to
use memory outside the segment allocated to your program (which, if
allowed, could result in corrupting memory being used by other
programs--which brings back unhappy memories of days gone by when an
error in one program could crash the whole system). So these kinds of
problems will not show up at compile time...only when you actually run
the program.

 I used dyn.load(mycode.so) and again, no problems. But when I try
to
 use the code .C(mycode,x) I get the error Segmentation fault and R
shuts
 down. Any ideas as to where my problem could be?

When I run into a segmentation fault, it is usually because I am trying
to access an element of an array that is beyond what I have allocated,
as in...

int main()
{
int *a;
a = (int*) malloc(3*sizeof(int));
printf(Fasten your seatbelts...\n);
a[4000] = 12;
return(0);
}

One less obvious way this can happen is forgetting to initialize your
arrays to the proper length before passing a reference to them to your C
function. 

If you still are having trouble, you could post a small snippet of code
that recreates the error for us to examine.

HTH,
Eric


This email message, including any attachments, is for the so...{{dropped}}

__
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
  



-


[[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] FW: R and read.irts

2005-12-28 Thread Mark Leeds
I have never worked with R before so I am
sorry if this is a bad question but I've
tried and tried ( all day ) and I can't figure this
problem out. I have the code below and I included the
data file as an attachment.
 
The code works in term of reading in the data
correctly but when the graph gets
created, the xaxis is really strangely/incorrectly
labelled. I have been trying
to understand this Posixct stuff in R but
I think this is where my knowledge is lacking and is maybe causing the
problem ?
Thank you very much.
 
I am using R in windows but through cygwin if that matters
but I doubt it does. Thanks again.
 
  Mark
 


-
 
postscript(file=burp.ps)
 
library(quadprog)
library(zoo)
library(tseries)
 
temp-read.irts('~/ml/research/data/highfreq.dat',format=%H:%M:%S,tz=
GMT,sep=,,header=FALSE,row.names=NULL,
col.names=c(transdate,transprice,transamount))
 
temp
 
plot(temp,type=l,xlab=Time,ylab=NULL,main=NULL,ylim=NULL)
 


-
 
 
 
 


**
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed.  If you have received this email in error please notify
the system manager.  This communication is for information purposes only and 
should not be regarded as an offer to sell or as a solicitation of an offer to 
buy any financial product.  Email transmission cannot be guaranteed to be 
secure or error-free. Therefore, we do not represent that this information is 
complete or accurate and it should not be relied upon as such.  All information 
is subject to change without notice.
**

__
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 and read.irts

2005-12-28 Thread Mark Leeds
I thought r-help let you
attach asci files but
I don't think it does now
so below is a sample of my data set.
 
Thanks again.
 
09:40:08.5238,67.00,33
09:40:09.1968,67.00,2
09:40:09.7945,67.00,2
09:40:09.7975,67.00,2
09:40:09.8318,66.99,-3
09:40:17.6335,66.95,3
09:41:09.3393,66.95,6
09:41:11.1482,66.95,-1
09:42:07.4552,66.90,-5
09:42:12.5823,66.85,-5
09:42:14.4329,66.80,-2
09:42:16.2443,66.75,-2
09:43:04.1058,66.70,-2
09:44:16.2121,66.65,-6
09:44:21.5150,66.60,-7
09:44:25.6575,66.57,-2
09:44:29.5285,66.55,-8
09:44:33.2789,66.54,-2
09:44:38.5528,66.55,1
09:44:39.2230,66.55,1
09:44:59.7104,66.58,12
09:45:00.7885,66.59,2
09:45:10.8272,66.62,1
09:45:11.6823,66.65,1
09:45:13.2348,66.75,7
09:45:14.4443,66.74,1
09:45:16.3109,66.75,2
09:45:18.3270,66.80,1
09:45:42.1371,66.86,-6
09:45:44.5825,66.80,-5
09:46:15.3339,66.97,1
09:46:15.9808,66.97,2
09:46:20.8899,67.00,5
09:46:31.2155,67.03,2
09:46:31.2191,67.00,-10
09:46:32.8894,67.03,-6
09:46:44.0140,67.50,53
09:46:56.0595,67.45,-1
09:46:57.2567,67.46,2
09:48:06.0436,67.30,6
09:48:07.7098,67.29,1
09:48:08.9179,67.26,-3
09:48:09.6386,67.26,-1
09:48:09.6518,67.26,-1
09:48:28.6469,67.26,-2
09:48:29.7615,67.25,-5
09:48:30.0150,67.25,-2
09:48:30.0286,67.26,2
09:48:31.3576,67.25,-3
09:48:31.3691,67.25,-1
09:48:31.6511,67.26,2
09:48:33.2846,67.26,10
09:48:33.8989,67.25,-4
09:48:34.9265,67.26,10
09:48:54.3861,67.26,3
09:48:56.2098,67.23,-3
09:48:59.0664,67.20,-1
09:49:27.1401,67.20,-1
09:49:33.7843,67.10,-2
09:50:01.0211,67.00,-7
09:50:01.8044,67.00,-1
09:50:18.6195,67.00,1
09:50:43.9515,67.01,3
09:50:44.2924,67.01,6
09:50:45.4829,67.01,5
09:50:49.1846,67.05,10
09:51:17.9104,67.05,7
09:51:20.3488,67.09,2
09:51:41.7684,67.09,-2
09:51:43.1375,67.09,-2
09:51:47.7718,67.09,1
09:51:48.4666,67.10,1
09:51:49.2406,67.10,2
09:52:14.1491,67.10,3
09:52:19.8536,67.05,-1
09:52:48.1685,67.09,1
09:53:45.2387,67.08,-1
09:53:51.6611,67.08,-2
09:53:54.0639,67.09,3
09:55:07.0671,66.99,5
09:55:12.5074,66.90,-7
 
 
 
-Original Message-
From: Mark Leeds 
Sent: Wednesday, December 28, 2005 6:42 PM
To: 'r-help@stat.math.ethz.ch'
Subject: FW: R and read.irts
 
I have never worked with R before so I am
sorry if this is a bad question but I've
tried and tried ( all day ) and I can't figure this
problem out. I have the code below and I included the
data file as an attachment.
 
The code works in term of reading in the data
correctly but when the graph gets
created, the xaxis is really strangely/incorrectly
labelled. I have been trying
to understand this Posixct stuff in R but
I think this is where my knowledge is lacking and is maybe causing the
problem ?
Thank you very much.
 
I am using R in windows but through cygwin if that matters
but I doubt it does. Thanks again.
 
  Mark
 


-
 
postscript(file=burp.ps)
 
library(quadprog)
library(zoo)
library(tseries)
 
temp-read.irts('~/ml/research/data/highfreq.dat',format=%H:%M:%S,tz=
GMT,sep=,,header=FALSE,row.names=NULL,
col.names=c(transdate,transprice,transamount))
 
temp
 
plot(temp,type=l,xlab=Time,ylab=NULL,main=NULL,ylim=NULL)
 


-
 
 
 
 


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

__
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] FW: R and read.irts

2005-12-28 Thread Gabor Grothendieck
The attachment did not come through.

Look at R News 4/1 in general for info on dates and times and
if you still have a problem repost running this and placing its
output into the body of your post so we can see what your
data look like.

   Lines - readLines(myfile)  # read in lines without parsing them
   dput(head(Lines))  # display first few lines in a way easy to read back in


On 12/28/05, Mark Leeds [EMAIL PROTECTED] wrote:
 I have never worked with R before so I am
 sorry if this is a bad question but I've
 tried and tried ( all day ) and I can't figure this
 problem out. I have the code below and I included the
 data file as an attachment.

 The code works in term of reading in the data
 correctly but when the graph gets
 created, the xaxis is really strangely/incorrectly
 labelled. I have been trying
 to understand this Posixct stuff in R but
 I think this is where my knowledge is lacking and is maybe causing the
 problem ?
 Thank you very much.

 I am using R in windows but through cygwin if that matters
 but I doubt it does. Thanks again.

  Mark

 
 
 -

 postscript(file=burp.ps)

 library(quadprog)
 library(zoo)
 library(tseries)

 temp-read.irts('~/ml/research/data/highfreq.dat',format=%H:%M:%S,tz=
 GMT,sep=,,header=FALSE,row.names=NULL,
 col.names=c(transdate,transprice,transamount))

 temp

 plot(temp,type=l,xlab=Time,ylab=NULL,main=NULL,ylim=NULL)

 
 
 -






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

__
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 and read.irts

2005-12-28 Thread Gabor Grothendieck
I guess we are posting at the same time since I got this after
I posted a prior reply.  Anyways, try this and also review the
R News article I mentioned previously as well as the zoo vignette
[i.e. library(zoo); vignette(zoo) ]

library(zoo)
library(chron)
z - read.zoo(myfile, FUN = times, sep = ,, col.names = letters[1:3])
plot(z)

On 12/28/05, Mark Leeds [EMAIL PROTECTED] wrote:
 I thought r-help let you
 attach asci files but
 I don't think it does now
 so below is a sample of my data set.

 Thanks again.

 09:40:08.5238,67.00,33
 09:40:09.1968,67.00,2
 09:40:09.7945,67.00,2
 09:40:09.7975,67.00,2
 09:40:09.8318,66.99,-3
 09:40:17.6335,66.95,3
 09:41:09.3393,66.95,6
 09:41:11.1482,66.95,-1
 09:42:07.4552,66.90,-5
 09:42:12.5823,66.85,-5
 09:42:14.4329,66.80,-2
 09:42:16.2443,66.75,-2
 09:43:04.1058,66.70,-2
 09:44:16.2121,66.65,-6
 09:44:21.5150,66.60,-7
 09:44:25.6575,66.57,-2
 09:44:29.5285,66.55,-8
 09:44:33.2789,66.54,-2
 09:44:38.5528,66.55,1
 09:44:39.2230,66.55,1
 09:44:59.7104,66.58,12
 09:45:00.7885,66.59,2
 09:45:10.8272,66.62,1
 09:45:11.6823,66.65,1
 09:45:13.2348,66.75,7
 09:45:14.4443,66.74,1
 09:45:16.3109,66.75,2
 09:45:18.3270,66.80,1
 09:45:42.1371,66.86,-6
 09:45:44.5825,66.80,-5
 09:46:15.3339,66.97,1
 09:46:15.9808,66.97,2
 09:46:20.8899,67.00,5
 09:46:31.2155,67.03,2
 09:46:31.2191,67.00,-10
 09:46:32.8894,67.03,-6
 09:46:44.0140,67.50,53
 09:46:56.0595,67.45,-1
 09:46:57.2567,67.46,2
 09:48:06.0436,67.30,6
 09:48:07.7098,67.29,1
 09:48:08.9179,67.26,-3
 09:48:09.6386,67.26,-1
 09:48:09.6518,67.26,-1
 09:48:28.6469,67.26,-2
 09:48:29.7615,67.25,-5
 09:48:30.0150,67.25,-2
 09:48:30.0286,67.26,2
 09:48:31.3576,67.25,-3
 09:48:31.3691,67.25,-1
 09:48:31.6511,67.26,2
 09:48:33.2846,67.26,10
 09:48:33.8989,67.25,-4
 09:48:34.9265,67.26,10
 09:48:54.3861,67.26,3
 09:48:56.2098,67.23,-3
 09:48:59.0664,67.20,-1
 09:49:27.1401,67.20,-1
 09:49:33.7843,67.10,-2
 09:50:01.0211,67.00,-7
 09:50:01.8044,67.00,-1
 09:50:18.6195,67.00,1
 09:50:43.9515,67.01,3
 09:50:44.2924,67.01,6
 09:50:45.4829,67.01,5
 09:50:49.1846,67.05,10
 09:51:17.9104,67.05,7
 09:51:20.3488,67.09,2
 09:51:41.7684,67.09,-2
 09:51:43.1375,67.09,-2
 09:51:47.7718,67.09,1
 09:51:48.4666,67.10,1
 09:51:49.2406,67.10,2
 09:52:14.1491,67.10,3
 09:52:19.8536,67.05,-1
 09:52:48.1685,67.09,1
 09:53:45.2387,67.08,-1
 09:53:51.6611,67.08,-2
 09:53:54.0639,67.09,3
 09:55:07.0671,66.99,5
 09:55:12.5074,66.90,-7



 -Original Message-
 From: Mark Leeds
 Sent: Wednesday, December 28, 2005 6:42 PM
 To: 'r-help@stat.math.ethz.ch'
 Subject: FW: R and read.irts

 I have never worked with R before so I am
 sorry if this is a bad question but I've
 tried and tried ( all day ) and I can't figure this
 problem out. I have the code below and I included the
 data file as an attachment.

 The code works in term of reading in the data
 correctly but when the graph gets
 created, the xaxis is really strangely/incorrectly
 labelled. I have been trying
 to understand this Posixct stuff in R but
 I think this is where my knowledge is lacking and is maybe causing the
 problem ?
 Thank you very much.

 I am using R in windows but through cygwin if that matters
 but I doubt it does. Thanks again.

  Mark

 
 
 -

 postscript(file=burp.ps)

 library(quadprog)
 library(zoo)
 library(tseries)

 temp-read.irts('~/ml/research/data/highfreq.dat',format=%H:%M:%S,tz=
 GMT,sep=,,header=FALSE,row.names=NULL,
 col.names=c(transdate,transprice,transamount))

 temp

 plot(temp,type=l,xlab=Time,ylab=NULL,main=NULL,ylim=NULL)

 
 
 -






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

 __
 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] Show graph integrated to GUI

2005-12-28 Thread Chihiro Kuraya
Hi,

Thank you for information..

I tried the TechingDemos package.
But it seems that the window which contains slider control 
and graph window is separated.

What I want to do is show slider control and graph
in one window simultaneiously.
It is possible ?

Chihiro Kuraya


Gregory Snow [EMAIL PROTECTED] wrote:

 The slider function in the TeachingDemos and relax packages (same
 function is in both packages you can use either) provides a way to do
 this using a Tk window.  There are also several functions in the
 TechingDemos package that use a lower level interface to a Tk window
 that you can look at their source code as an example to build your own
 (examples include: vis.gamma, rotate.persp, and run.power.examp).
 
 Hope this helps,
 
 
 -- 
 Gregory (Greg) L. Snow Ph.D.
 Statistical Data Center
 Intermountain Healthcare
 [EMAIL PROTECTED]
 (801) 408-8111
  
  
 
  -Original Message-
  From: [EMAIL PROTECTED] 
  [mailto:[EMAIL PROTECTED] On Behalf Of Chihiro Kuraya
  Sent: Saturday, December 24, 2005 9:53 PM
  To: r-help@stat.math.ethz.ch
  Subject: [R] Show graph integrated to GUI
  
  Hi all,
  
  It it posssible to show graph which is integrated to some GUI 
  (e.g. TclTk or R-wxPython).
  
  I want to make an application by R,
  for example, like the following picture:
  http://www.natch.co.uk/downloads/SigJenny/SJnScreenShot.gif
  
  Regards,
  Chihiro Kuraya
  
  --
  STOP HIV/AIDS.
  
  __
  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] Show graph integrated to GUI

2005-12-28 Thread Gabor Grothendieck
Try the example in ?tkrplot in package tkrplot.  That
shows a tcl-based plot interactively modified by a
slider all in a single window.

On 12/28/05, Chihiro Kuraya [EMAIL PROTECTED] wrote:
 Hi,

 Thank you for information..

 I tried the TechingDemos package.
 But it seems that the window which contains slider control
 and graph window is separated.

 What I want to do is show slider control and graph
 in one window simultaneiously.
 It is possible ?

 Chihiro Kuraya


 Gregory Snow [EMAIL PROTECTED] wrote:

  The slider function in the TeachingDemos and relax packages (same
  function is in both packages you can use either) provides a way to do
  this using a Tk window.  There are also several functions in the
  TechingDemos package that use a lower level interface to a Tk window
  that you can look at their source code as an example to build your own
  (examples include: vis.gamma, rotate.persp, and run.power.examp).
 
  Hope this helps,
 
 
  --
  Gregory (Greg) L. Snow Ph.D.
  Statistical Data Center
  Intermountain Healthcare
  [EMAIL PROTECTED]
  (801) 408-8111
 
 
 
   -Original Message-
   From: [EMAIL PROTECTED]
   [mailto:[EMAIL PROTECTED] On Behalf Of Chihiro Kuraya
   Sent: Saturday, December 24, 2005 9:53 PM
   To: r-help@stat.math.ethz.ch
   Subject: [R] Show graph integrated to GUI
  
   Hi all,
  
   It it posssible to show graph which is integrated to some GUI
   (e.g. TclTk or R-wxPython).
  
   I want to make an application by R,
   for example, like the following picture:
   http://www.natch.co.uk/downloads/SigJenny/SJnScreenShot.gif
  
   Regards,
   Chihiro Kuraya
  
   --
   STOP HIV/AIDS.
  
   __
   R-help@stat.math.ethz.ch mailing list
   https://stat.ethz.ch/mailman/listinfo/r-help
   PLEASE do read the posting guide!
   http://www.R-project.org/posting-guide.html
  

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


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


[R] trouble with S4 methods for group Summary

2005-12-28 Thread Parlamis Franklin
Hello.  This question concerns the Methods package.  I have created a  
new class and am trying to set a method for it for S4 group generic  
Summary.  I have run into some signature problems.  An example:

 setClass(track, representation(x=numeric, y=character))
[1] track
 setGeneric(max, group=Summary)
[1] max
 setMethod(Summary, signature(x=track), function(x, ..., na.rm)  
callGeneric([EMAIL PROTECTED], ..., na.rm))
[1] Summary
 dd-new(track, x=c(1,2), y=abc)
 max(dd)
[1] -Inf
Warning message:
no finite arguments to max; returning -Inf
 showMethods(max)

Function max:
na.rm = ANY
na.rm = track
na.rm = missing
(inherited from na.rm = ANY)

As you can see from the above, the method I tried to set for  
max (via Summary) was defined for the formal argument na.rm not  
x.  This makes sense because the standardGeneric created for max  
only allows methods to be defined for argument na.rm

 max
standardGeneric for max defined from package base
belonging to group(s): Summary

function (..., na.rm = FALSE)
standardGeneric(max)
environment: 0x19447a28
Methods may be defined for arguments: na.rm

However, group Summary purports to allow you to define methods for  
arguments x and na.rm.

 Summary
groupGenericFunction for Summary defined from package base

function (x, ..., na.rm = FALSE)
stop(function 'Summary' is a group generic; do not call it directly,
domain = NA)
environment: 0x16aef098
Methods may be defined for arguments: x, na.rm

How does this work?  Can someone point me to where I am going wrong,  
and explain how to define S4 methods for group Summary for argument  
x?  Perhaps I need to do more in my setGeneric call?  Thanks 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