Re: [R] SJAVA error

2004-06-09 Thread Vincent MUTEAUD
Hi,
I have the same error than you two weeks ago. As I have not found how to 
do, I give up my example.
Yunko, I am interesting if you found how to proceed.
Thanks

Vincent

A 01:07 09/06/2004 +0900, =?iso-2022-jp?B?GyRCTHBMbhsoQiAbJEI9ZztSGyhC?= a 
écrit :
Hi
I'm trying to use SJava and I have troubles. I try to run examples from 
"Calling R from Java"
but,I have an error that "fatal error: enable to open the base package"

I heard  SJAVA bug,
so,could you  send me your compiled SJava package with the modified 
REmbed.c because in Windows i'm not able to recompile!!!

--example
package org.omegahat.R.Java;
public class REvalSample {
public static void main(String[] args) {
String[] rargs = { "--slave", "--vanilla" };
System.out.println("Java$B$+$i(BR$B$r%3!<%k$9$k%W%m%0%i%`(B");
ROmegahatInterpreter interp =
new ROmegahatInterpreter(
ROmegahatInterpreter.fixArgs(rargs),
false);
REvaluator e = new REvaluator();
Object val = e.eval("x <- sin(seq(0, 2*pi, length=30))");
val = e.eval("x * 2.0");
if (val != null) {
double[] objects = (double[]) val;
for (int i = 0; i < objects.length; i++) {
System.err.println("(" + i + ") " + 
objects[i]);
}
}
}
}
-

Thank you

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


Re: [R] SJAVA error

2004-06-09 Thread Prof Brian Ripley
SJava is not part of R but rather of Omegahat, so this is the wrong list.
But as a hint, I think you have not set R_HOME, or not set it correctly.

But please consult the R posting guide for hints as to what information 
might be needed to help either of you, as neither or you have provided 
basic information like the OS, version of R, version of SJava 

On Wed, 9 Jun 2004, Vincent MUTEAUD wrote:

> Hi,
> I have the same error than you two weeks ago. As I have not found how to 
> do, I give up my example.
> Yunko, I am interesting if you found how to proceed.
> Thanks
> 
> Vincent
> 
> A 01:07 09/06/2004 +0900, =?iso-2022-jp?B?GyRCTHBMbhsoQiAbJEI9ZztSGyhC?= a 
> écrit :
> >Hi
> >
> >I'm trying to use SJava and I have troubles. I try to run examples from 
> >"Calling R from Java"
> >but,I have an error that "fatal error: enable to open the base package"
> >
> >I heard  SJAVA bug,
> >so,could you  send me your compiled SJava package with the modified 
> >REmbed.c because in Windows i'm not able to recompile!!!

EVERYONE should be able to compile under Windows as all the tools required
are free.

> >--example
> >package org.omegahat.R.Java;
> >
> >public class REvalSample {
> > public static void main(String[] args) {
> > String[] rargs = { "--slave", "--vanilla" };
> >
> > 
> >System.out.println("Java$B$+$i(BR$B$r%3!<%k$9$k%W%m%0%i%`(B");
> >
> > ROmegahatInterpreter interp =
> > new ROmegahatInterpreter(
> > ROmegahatInterpreter.fixArgs(rargs),
> > false);
> > REvaluator e = new REvaluator();
> >
> > Object val = e.eval("x <- sin(seq(0, 2*pi, length=30))");
> > val = e.eval("x * 2.0");
> >
> > if (val != null) {
> > double[] objects = (double[]) val;
> > for (int i = 0; i < objects.length; i++) {
> > System.err.println("(" + i + ") " + 
> > objects[i]);
> > }
> > }
> > }
> >}

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

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


Re: [R] Is there an R-version of rayplot

2004-06-09 Thread Martin Maechler
> "richard" == richard kittler <[EMAIL PROTECTED]>
> on Tue, 8 Jun 2004 09:19:51 -0700 writes:

richard> I need to make plots similar to those produced by
richard> the s-plus rayplot function but can't seem to find
richard> it in R.  These 'vector maps' plot a ray or vector
richard> at each specified location. Is there something
richard> similar in R ?  --Rich

Do 

   ?stars
   ?symbols

help further?
Also, maybe,
par(ask = TRUE)
example(stars)

Regards,
Martin Maechler

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


[R] nominal data

2004-06-09 Thread Bianca
Hi,

I am a new user of R. I have 2 series of nominal data (2 series of answers
for the same question) and I want to calculate the correlation between these
2 series. I've tried to use the correlation function (corr, ...) but all are
for numeric data... Does anyone know what function should I use for the
nominal data?

Thanks a lot,
Bianca

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


[R] Specifying xlevels in effects library

2004-06-09 Thread David J. Netherway
library(effects)
mod <- lm(Measurement ~ Age + Sex, data=d)
e <-effect("Sex",mod)
The effect is evaluated at the mean age.
> e
Sex effect
Sex
  FM  
43.33083 44.48531  
>
> e$model.matrix
  (Intercept)  Age SexM
11 130.58590
23   1 130.58591

To evaluate the effect at Age=120 I tried:
e <-effect("Sex",mod,xlevels=list(Age=c(120)))
but the effect was still evaluated at 130.5859.
Is this an incorrect usage of xlevels?
Thanks, David
__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] nominal data

2004-06-09 Thread Unung Istopo Hartanto
Hi,

try ?cor

but. I doubt it's your problem, and I think there's an another way to
make correlation with nominal data, not used ?cor. But, i've been
explore it yet.

ex. :
cbind(c("one","one","two","three","two","three"),c("one","three","three","three","two","two"))
 -> test

> test
 [,1][,2]
[1,] "one"   "one"
[2,] "one"   "three"
[3,] "two"   "three"
[4,] "three" "three"
[5,] "two"   "two"
[6,] "three" "two"

> data.frame(test)
 X1X2
1   one   one
2   one three
3   two three
4 three three
5   two   two
6 three   two

> data.frame(test) -> data

> cor(data$X1,data$X2)
[1] 0.5940885

I hope this helps,

Unung

On Wed, 2004-06-09 at 15:15, Bianca wrote:
> Hi,
> 
> I am a new user of R. I have 2 series of nominal data (2 series of answers
> for the same question) and I want to calculate the correlation between these
> 2 series. I've tried to use the correlation function (corr, ...) but all are
> for numeric data... Does anyone know what function should I use for the
> nominal data?
> 
> Thanks a lot,
> Bianca
>

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


Re: [R] SJAVA error

2004-06-09 Thread Vincent MUTEAUD
Thanks
I am using windows NT, R 1.9.0 and SJava 0.65 modified. I think my R_HOME 
is set correctly

A 08:26 09/06/2004 +0100, Prof Brian Ripley a écrit :
SJava is not part of R but rather of Omegahat, so this is the wrong list.
But as a hint, I think you have not set R_HOME, or not set it correctly.
But please consult the R posting guide for hints as to what information
might be needed to help either of you, as neither or you have provided
basic information like the OS, version of R, version of SJava 
On Wed, 9 Jun 2004, Vincent MUTEAUD wrote:
> Hi,
> I have the same error than you two weeks ago. As I have not found how to
> do, I give up my example.
> Yunko, I am interesting if you found how to proceed.
> Thanks
>
> Vincent
>
> A 01:07 09/06/2004 +0900, =?iso-2022-jp?B?GyRCTHBMbhsoQiAbJEI9ZztSGyhC?= a
> écrit :
> >Hi
> >
> >I'm trying to use SJava and I have troubles. I try to run examples from
> >"Calling R from Java"
> >but,I have an error that "fatal error: enable to open the base package"
> >
> >I heard  SJAVA bug,
> >so,could you  send me your compiled SJava package with the modified
> >REmbed.c because in Windows i'm not able to recompile!!!
EVERYONE should be able to compile under Windows as all the tools required
are free.
> >--example
> >package org.omegahat.R.Java;
> >
> >public class REvalSample {
> > public static void main(String[] args) {
> > String[] rargs = { "--slave", "--vanilla" };
> >
> >
> >System.out.println("Java$B$+$i(BR$B$r%3!<%k$9$k%W%m%0%i%`(B");
> >
> > ROmegahatInterpreter interp =
> > new ROmegahatInterpreter(
> > ROmegahatInterpreter.fixArgs(rargs),
> > false);
> > REvaluator e = new REvaluator();
> >
> > Object val = e.eval("x <- sin(seq(0, 2*pi, length=30))");
> > val = e.eval("x * 2.0");
> >
> > if (val != null) {
> > double[] objects = (double[]) val;
> > for (int i = 0; i < objects.length; i++) {
> > System.err.println("(" + i + ") " +
> > objects[i]);
> > }
> > }
> > }
> >}
--
Brian D. Ripley,  [EMAIL PROTECTED]
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford, Tel:  +44 1865 272861 (self)
1 South Parks Road, +44 1865 272866 (PA)
Oxford OX1 3TG, UKFax:  +44 1865 272595
__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] GlmmPQL

2004-06-09 Thread O Tosas Auguet

Dear all,


I have two questions concerning model simplification in GlmmPQL, for for random
and fixed effects:

1. Fixed effects: I don't know if I can simply specify anova(model) and trust
the table that comes up with the p value for each variable  in the fixed
effects formula. I have read that the only way to test for fixed effects is to
do approximate wald tests based on the standard errors of the models where I am
subsequently withdrawing one variable from the fixed effect formula at a time.
What does "aproximate" wald test mean? What is the best option?

2. Random effects: If AIC is not meaningful in GlmmPQL, how do I test for the
significance of the random effects?

3. I way to see if 1 single level of random effects is helpful in terms of
analysing the data, would be to comapre the GlmmPQL model with a glm models
without random effects, but again: what do I compare if AIC is not meaninful?
and if there is something I can compare, could I test for the significance of
that difference?

Could someone bring light to this?

Thanks,

Olga Tosas

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


[R] "attach" in R corr. to Spus one

2004-06-09 Thread Utsav Boobna
Hi,
I am a newbie to R, just trying to switch from
Splus. I am wondering to know if there is any such
command in R as "attach" in Splus which can be used to
attach the full directory.

Also, any idea/referrence about, how to load c
functions in R would be highly appreciated.

Thanks,
Utsav

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


Re: [R] SJAVA error

2004-06-09 Thread Wolski
Hi!

For Windows and mac os X use of rJava may help.
http://stats.math.uni-augsburg.de/iPlots/
>From there also as it seems a working older version of SJave can be downloaded.

Sincerely
Eryk



*** REPLY SEPARATOR  ***

On 6/9/2004 at 9:12 AM Vincent MUTEAUD wrote:

>>>Hi,
>>>I have the same error than you two weeks ago. As I have not found how to 
>>>do, I give up my example.
>>>Yunko, I am interesting if you found how to proceed.
>>>Thanks
>>>
>>>Vincent
>>>
>>>
>>>
>>>
>>>A 01:07 09/06/2004 +0900, =?iso-2022-jp?B?GyRCTHBMbhsoQiAbJEI9ZztSGyhC?=
>>>a 
>>>écrit :
Hi

I'm trying to use SJava and I have troubles. I try to run examples from 
"Calling R from Java"
but,I have an error that "fatal error: enable to open the base package"

I heard  SJAVA bug,
so,could you  send me your compiled SJava package with the modified 
REmbed.c because in Windows i'm not able to recompile!!!

--example
package org.omegahat.R.Java;

public class REvalSample {
 public static void main(String[] args) {
 String[] rargs = { "--slave", "--vanilla" };

 
System.out.println("Java$B$+$i(BR$B$r%3!<%k$9$k%W%m%0%i%`(B");

 ROmegahatInterpreter interp =
 new ROmegahatInterpreter(
 ROmegahatInterpreter.fixArgs(rargs),
 false);
 REvaluator e = new REvaluator();

 Object val = e.eval("x <- sin(seq(0, 2*pi,
>>>length=30))");
 val = e.eval("x * 2.0");

 if (val != null) {
 double[] objects = (double[]) val;
 for (int i = 0; i < objects.length; i++) {
 System.err.println("(" + i + ") " + 
 objects[i]);
 }
 }
 }
}
-

Thank you

Junko Yano
E-mail : [EMAIL PROTECTED]

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



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

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


Re: [R] SJAVA error

2004-06-09 Thread Prof Brian Ripley
Please do read what I said. This is *the wrong list*, so please use teh 
correct one.

On Wed, 9 Jun 2004, Vincent MUTEAUD wrote:

> Thanks
> I am using windows NT, R 1.9.0 and SJava 0.65 modified. I think my R_HOME 
> is set correctly

It cannot be or the base package would be found.  The relevant code in R 
is

fp = R_OpenLibraryFile("base");
if (fp == NULL) {
R_Suicide("unable to open the base package\n");
}

and

FILE *R_OpenLibraryFile(char *file)
{
char buf[256];
FILE *fp;

snprintf(buf, 256, "%s/library/base/R/%s", R_Home, file);
fp = R_fopen(buf, "r");
return fp;
}

> A 08:26 09/06/2004 +0100, Prof Brian Ripley a écrit :
> >SJava is not part of R but rather of Omegahat, so this is the wrong list.
> >But as a hint, I think you have not set R_HOME, or not set it correctly.
> >
> >But please consult the R posting guide for hints as to what information
> >might be needed to help either of you, as neither or you have provided
> >basic information like the OS, version of R, version of SJava 
> >
> >On Wed, 9 Jun 2004, Vincent MUTEAUD wrote:
> >
> > > Hi,
> > > I have the same error than you two weeks ago. As I have not found how to
> > > do, I give up my example.
> > > Yunko, I am interesting if you found how to proceed.
> > > Thanks
> > >
> > > Vincent
> > >
> > > A 01:07 09/06/2004 +0900, =?iso-2022-jp?B?GyRCTHBMbhsoQiAbJEI9ZztSGyhC?= a
> > > écrit :
> > > >Hi
> > > >
> > > >I'm trying to use SJava and I have troubles. I try to run examples from
> > > >"Calling R from Java"
> > > >but,I have an error that "fatal error: enable to open the base package"
> > > >
> > > >I heard  SJAVA bug,
> > > >so,could you  send me your compiled SJava package with the modified
> > > >REmbed.c because in Windows i'm not able to recompile!!!
> >
> >EVERYONE should be able to compile under Windows as all the tools required
> >are free.
> >
> > > >--example
> > > >package org.omegahat.R.Java;
> > > >
> > > >public class REvalSample {
> > > > public static void main(String[] args) {
> > > > String[] rargs = { "--slave", "--vanilla" };
> > > >
> > > >
> > > >System.out.println("Java$B$+$i(BR$B$r%3!<%k$9$k%W%m%0%i%`(B");
> > > >
> > > > ROmegahatInterpreter interp =
> > > > new ROmegahatInterpreter(
> > > > ROmegahatInterpreter.fixArgs(rargs),
> > > > false);
> > > > REvaluator e = new REvaluator();
> > > >
> > > > Object val = e.eval("x <- sin(seq(0, 2*pi, length=30))");
> > > > val = e.eval("x * 2.0");
> > > >
> > > > if (val != null) {
> > > > double[] objects = (double[]) val;
> > > > for (int i = 0; i < objects.length; i++) {
> > > > System.err.println("(" + i + ") " +
> > > > objects[i]);
> > > > }
> > > > }
> > > > }
> > > >}
> >
> >--
> >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
> 
> 
> 

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

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


Re: [R] GlmmPQL

2004-06-09 Thread Prof Brian Ripley
I think you need to read the references given in ?glmmPQL and its
reference to understand what PQL actually does.  If you don't know the
theory behind a statistical method, you should try to understand it before
trying to use it.

The same applies to AIC.  Even if AIC were computable, do you know its 
theoretical limitations (and it does not apply to testing if random 
effects have zero variance, for example)?

On Wed, 9 Jun 2004, O Tosas Auguet wrote:

> 
> Dear all,
> 
> 
> I have two questions concerning model simplification in GlmmPQL, for for
> random and fixed effects:
> 
> 1. Fixed effects: I don't know if I can simply specify anova(model) and
> trust the table that comes up with the p value for each variable in the
> fixed effects formula. I have read that the only way to test for fixed
> effects is to do approximate wald tests based on the standard errors of
> the models where I am subsequently withdrawing one variable from the
> fixed effect formula at a time. What does "aproximate" wald test mean?
> What is the best option?
> 
> 2. Random effects: If AIC is not meaningful in GlmmPQL, how do I test
> for the significance of the random effects?
> 
> 3. I way to see if 1 single level of random effects is helpful in terms
> of analysing the data, would be to comapre the GlmmPQL model with a glm
> models without random effects, but again: what do I compare if AIC is
> not meaninful? and if there is something I can compare, could I test for
> the significance of that difference?
> 
> Could someone bring light to this?

The references will.

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

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


[R] inconsistency on p-value calculation of anova for quasi binomial

2004-06-09 Thread Ulrich Halekoh
Hej,

providing the dispersion parameter estimate to 
the anova function
for a quasibinomial fit results in two different
ways to calculate the p-value for the same statistic.


In the following example I test for the interaction effect.

In the versions  (a1 and a2) the p-value is based on the
F_1_17 distribution,
in the version (a3) it is calculated via the normal.

I think  anova should behave (by default) in all versions either
 in the one or the other 
way.


#example based on the orobanche data set provoded with the dispmod-package
library(dispmod)
data(orobanche)
orobanche$y<-with(orobanche,cbind(germinated,seeds-germinated))
g1<-glm(y~host+variety,family=quasibinomial,data=orobanche)
g2<-glm(y~host+variety+host:variety,family=quasibinomial,data=orobanche)

a1<-anova(g2,g1,test='F',dispersion=summary(g2)$dispersion)
a2<-anova(g2,test='F')

a3<-anova(g2,test='F',dispersion=summary(g2)$dispersion)



ulrich

R 1.9.0
Windows 2000


==
Ulrich Halekoh,  PhD Phone: +45 8999 1825
Biometry Research Unit   Fax:   +45 8999 1300
Danish Institute of Agricultural SciencesE-mail: [EMAIL PROTECTED]
Research Centre Foulum, DK-8830 Tjele, Denmark

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


[R] Getting Pr from Summary(lm)

2004-06-09 Thread David J. Netherway
Hello,
I am trying to get the P values from the output of a summary for lm.
lm <- lm(y ~ age + sex)
s <- summary(lm)
I thought that I might be able to get them using a combination of scan, 
grep and sub.
But I got stuck on the first step - being able to process "s" as a text 
string.
I could perhaps write it to file than scan it back but there is probably 
an easier
way to do the whole thing.

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


Re: [R] "attach" in R corr. to Spus one

2004-06-09 Thread Petr Pikal
Hallo

On 9 Jun 2004 at 2:06, Utsav Boobna wrote:

> Hi,
> I am a newbie to R, just trying to switch from
> Splus. I am wondering to know if there is any such
> command in R as "attach" in Splus which can be used to
> attach the full directory.

I would recommend you to spent some time going through docummentation and 
especially FAQs. 

getwd and setwd for setting the working directory

but in R objects are stored in one file .Rdata.

OTOH in S+ objects are (were - I did not use it since quite a lot time) stored as 
separate files.

For attaching objects see

?attach

Cheers
Petr

> 
> Also, any idea/referrence about, how to load c
> functions in R would be highly appreciated.
> 
> Thanks,
> Utsav
> 
> __
> [EMAIL PROTECTED] mailing list
> https://www.stat.math.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide!
> http://www.R-project.org/posting-guide.html

Petr Pikal
[EMAIL PROTECTED]

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


Re: [R] Getting Pr from Summary(lm)

2004-06-09 Thread Peter Dalgaard
"David J. Netherway" <[EMAIL PROTECTED]> writes:

> Hello,
> 
> I am trying to get the P values from the output of a summary for lm.
> 
> lm <- lm(y ~ age + sex)
> s <- summary(lm)
> 
> I thought that I might be able to get them using a combination of
> scan, grep and sub.
> But I got stuck on the first step - being able to process "s" as a
> text string.
> I could perhaps write it to file than scan it back but there is
> probably an easier
> way to do the whole thing.
> 
> Help would be welcome, David

Summaries are (usually) R objects which can be manipulated
programmatically. They should be confused with what their print
methods print. Consider

example(summary.lm)
coef(sld90)[,4,drop=F]


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

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


Re: [R] Getting Pr from Summary(lm)

2004-06-09 Thread Prof Brian Ripley
coef(summary(lmfit))[, 4]

See ?summary.lm, and note that summary() methods in general produce an 
object which the print method then prints.

On Wed, 9 Jun 2004, David J. Netherway wrote:

> Hello,
> 
> I am trying to get the P values from the output of a summary for lm.
> 
> lm <- lm(y ~ age + sex)

Not a good choice of object name!

> s <- summary(lm)
> 
> I thought that I might be able to get them using a combination of scan, 
> grep and sub.
> But I got stuck on the first step - being able to process "s" as a text 
> string.
> I could perhaps write it to file than scan it back but there is probably 
> an easier
> way to do the whole thing.

You could sink to a textConnection if you really wanted the printed 
output.

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

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


Re: [R] Getting Pr from Summary(lm)

2004-06-09 Thread Torsten Hothorn

> Hello,
>
> I am trying to get the P values from the output of a summary for lm.
>
> lm <- lm(y ~ age + sex)
> s <- summary(lm)

s$coefficients

gives you a matrix with the P-values in the fourth column

Torsten

>
> I thought that I might be able to get them using a combination of scan,
> grep and sub.
> But I got stuck on the first step - being able to process "s" as a text
> string.
> I could perhaps write it to file than scan it back but there is probably
> an easier
> way to do the whole thing.
>
> Help would be welcome, David
>
> __
> [EMAIL PROTECTED] mailing list
> https://www.stat.math.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
>
>

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


Re: [R] nominal data

2004-06-09 Thread Jonathan Baron
On 06/09/04 10:15, Bianca wrote:
>Hi,
>
>I am a new user of R. I have 2 series of nominal data (2 series of answers
>for the same question) and I want to calculate the correlation between these
>2 series. I've tried to use the correlation function (corr, ...) but all are
>for numeric data... Does anyone know what function should I use for the
>nominal data?

In part this is a statistics question, and the answer depends
heavily on why you want to know.

But one way to do it is to use Cohen's kappa.  This is in the psy
contributed packages, and described in our "Notes on R for
psychology ..." (linked from my R search page - look under
"inter-rater agreement").

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

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


[R] testing effects of quantitative predictors on a categorical response variable

2004-06-09 Thread Avril Coghlan
Hello,

   I have a small statistics question, and
as I'm quite new to statistics and R, I'm not
sure if I'm doing things correctly. 

   I am looking at two quantitative
variables (x,y) that are correlated. 
When I divide the data set according to a categorical
variable z, then x and y are more poorly correlated
when z = A than when z = B (see attached figure).
In fact x and y are two (correlated) predictor
variables and z is a categorical response variable that
x and y affect.

   I would like to use R to make some statistical
test to show that you seem to get z = A when
the value of x is much less than y, while you
tend to get z = B when x is approximately the same as y. 
Can anybody tell me what I should be doing?
I tried a logistic regression:
> glm1 <- glm(z ~ y + x,family=binomial(),trace=T)
which gives Pr(>|z|) < 0.01 for both x and y, but
I'm not sure if this is valid to do, since x and y are correlated?

As well this test does not show that it is for values of
x << y that we tend to get z = A, and that for
values of x approx = y, that we tend to get z = B. I'm
not sure how to show this?
  
I'll be very grateful if anyone can help.

Avril


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

Re: [R] Getting Pr from Summary(lm)

2004-06-09 Thread jferrer
Hi David,

To see what is stored in an object, use names().
In your case you could try this:

> lm <- lm(y ~ age + sex)
> s <- summary(lm)
>  names(s)
 [1] "call"  "terms" "residuals" "coefficients"
 [5] "aliased"   "sigma" "df""r.squared"
 [9] "adj.r.squared" "fstatistic""cov.unscaled"
> s$coefficients
> s$coefficients[,4]

cheers,

JR

En respuesta a / Antwort zu / Reply to:

~~Hello,
~~
~~I am trying to get the P values from the output of a summary for lm.
~~
~~lm <- lm(y ~ age + sex)
~~s <- summary(lm)
~~
~~I thought that I might be able to get them using a combination of scan,
~~grep and sub.
~~But I got stuck on the first step - being able to process "s" as a text
~~string.
~~I could perhaps write it to file than scan it back but there is probably
~~an easier
~~way to do the whole thing.
~~
~~Help would be welcome, David
~~
~~__
[EMAIL PROTECTED] mailing list
~~https://www.stat.math.ethz.ch/mailman/listinfo/r-help
~~PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
~~

Dipl.-Biol. J.R. Ferrer Paris 
Laboratorio de Biología de Organismos - Centro de Ecología
   Instituto Venezolano de Investigaciones Científicas
 Apartado 21827 - Caracas 1020A
   REPUBLICA BOLIVARIANA DE VENEZUELA
 Tel:00-58-212-5041452 --- Fax: 00-58-212-5041088
~~ [EMAIL PROTECTED]

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


Re: [R] testing effects of quantitative predictors on a categorical response variable

2004-06-09 Thread jferrer
Hi Avril,

I'm not sure what you want to show. Do you want to know the effects of
each variable? or just predict when you get z=A and when z=B?

In the latter case, I think that, if x and y are in the same units, you
could simply try

w <- y-x
glm1 <- glm(z ~ w,family=binomial(),trace=T)

Hope it helps,

JR


En respuesta a / Antwort zu / Reply to:

~~Hello,
~~
~~   I have a small statistics question, and
~~as I'm quite new to statistics and R, I'm not
~~sure if I'm doing things correctly.
~~
~~   I am looking at two quantitative
~~variables (x,y) that are correlated.
~~When I divide the data set according to a categorical
~~variable z, then x and y are more poorly correlated
~~when z = A than when z = B (see attached figure).
~~In fact x and y are two (correlated) predictor
~~variables and z is a categorical response variable that
~~x and y affect.
~~
~~   I would like to use R to make some statistical
~~test to show that you seem to get z = A when
~~the value of x is much less than y, while you
~~tend to get z = B when x is approximately the same as y.
~~Can anybody tell me what I should be doing?
~~I tried a logistic regression:
~~> glm1 <- glm(z ~ y + x,family=binomial(),trace=T)
~~which gives Pr(>|z|) < 0.01 for both x and y, but
~~I'm not sure if this is valid to do, since x and y are correlated?
~~
~~As well this test does not show that it is for values of
~~x << y that we tend to get z = A, and that for
~~values of x approx = y, that we tend to get z = B. I'm
~~not sure how to show this?
~~
~~I'll be very grateful if anyone can help.
~~
~~Avril
~~

Dipl.-Biol. J.R. Ferrer Paris 
Laboratorio de Biología de Organismos - Centro de Ecología
   Instituto Venezolano de Investigaciones Científicas
 Apartado 21827 - Caracas 1020A
   REPUBLICA BOLIVARIANA DE VENEZUELA
 Tel:00-58-212-5041452 --- Fax: 00-58-212-5041088
~~ [EMAIL PROTECTED]

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


Re: [R] poisson regression with robust error variance ('eyestudy')

2004-06-09 Thread Lutz Ph. Breitling
okay, so now the bootcov works fine.
aren't the lower bootstrap variances just what Karla is talking about when 
she writes on the website describing the eyestudy that i was trying to redo 
in the first place:
"Using a Poisson model without robust error variances will result in a 
confidence interval that is too wide."
(Karla Lindquist, Senior Statistician in the Division of Geriatrics at UCSF)

but one more question: so i cannot get SANDWICH estimates of the standard 
error for a [R] glm or glmD?

many thanks for all your efforts!
lutz
At 13:46 05.06.2004, Frank E Harrell Jr wrote:
Sorry I didn't think of that sooner.  robcov needs the residuals method 
for the fitter to allow a type="score" or type="hscore" (for Efron's 
method) argument.  Until someone adds score residuals to residuals.glm 
robcov will not work for you.  residuals.lrm and residuals.coxph are 
examples where score residuals are computed.  You can get robust 
variance-covariance estimates with the bootstrap using bootcov for glmD 
fits.  Oddly in your example I am finding that the bootstrap variances are 
lower than the information-matrix-based ones.

Frank Harrell
=
Lutz Ph. Breitling
Unité des Recherches Médicale
Hôpital Albert Schweitzer
B.P. 118 Lambaréné (GABON) 

---



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

Re: [R] Is there an R-version of rayplot

2004-06-09 Thread joerg van den hoff
maybe this q&d try helps?
#=cut herer=
vectorplot <- function (field) {
  #input is a (N x 4 array) of N vectors:
  #   field[,1:2] - x/y position  of vectors
  #   field[,3:4] - x/y componnent of vectors
  # plotted are the 2-D vectors attached to  the specified positions
  if (is.null(dim(field))||dim(field)[2] != 4) stop("N x 4 array expected")
  loc <- field[,1:2]
  val <- field[,3:4]
  alpha <- rbind(loc[,1],loc[,1]+val[,1])
  omega <- rbind(loc[,2],loc[,2]+val[,2])
  matplot(alpha,omega,type='l',lty=1,col='black') #the vector lines
  points(loc) #the start points
  points(loc+val,pch=20) #the end points
}
#example:
loc=matrix(rnorm(100),50,2)
field <- cbind(loc,loc)
vectorplot(field)
#=cut herer=
there are no nice arrow heads, of course, but one could construct some...
for now, vectors start with open circles and end with filled circles.
joerg
__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] market-basket analysis in R

2004-06-09 Thread Wayne Jones


Hi there fellow R-users, 

Does anyone know if there exists a package for associated rules data mining
(market basket analysis) in R. 

I have tried searching CRAN but with no luck. 

Regards

Wayne


KSS Ltd
Seventh Floor  St James's Buildings  79 Oxford Street  Manchester  M1 6SS  England
Company Registration Number 2800886
Tel: +44 (0) 161 228 0040   Fax: +44 (0) 161 236 6305
mailto:[EMAIL PROTECTED]http://www.kssg.com


The information in this Internet email is confidential and m...{{dropped}}

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


[R] Greek fonts

2004-06-09 Thread Johannes SCHNITZLER
Dear all,

 

 

I need Greek text in titles, axis labels, etc. for graphs.

The Graphs are produced in png-format - to use them later on in HTML
pages.

As the output has to be multilingual they are produced in a loop (for
each language).

The strings for the titles, labels ... are stored in a text file (Greek,
English, French...).

 

The only way I found so far - for Greek - is:

1) change the Rdevga by adding Courier to the fonts (the only font
that worked for me).

2) Change the "language for non-unicode programs" in the windows
setting to Greek

 

Is there a way to avoid changing the "setting for non-unicode programs"
in windows. 

If I'm changing the setting to Greek, non uni-code characters of other
languages are not displayed correctly (ex. accents in French) 

 

Is there a way without changing the Rdevga in order to avoid
manipulation after installation of R. 

Something like par(font="Courier : plain")

 

 

I'm using 

R Version: 1.9

Windows: XP

 

Thank you in advance for any help

 

 

Johannes

 


[[alternative HTML version deleted]]

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


RE: [R] market-basket analysis in R

2004-06-09 Thread RINNER Heinrich
Hi,
I have asked a similar question quite a while ago, maybe you find the replys given in 
that thread useful:
http://finzi.psych.upenn.edu/R/Rhelp02/archive/3977.html.

Anyway, this is two years old now, so maybe there's some news in the meantime.

Regards
Heinrich.

> -Ursprüngliche Nachricht-
> Von: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] Im Auftrag von Wayne Jones
> Gesendet: Mittwoch, 09. Juni 2004 13:28
> An: [EMAIL PROTECTED]
> Betreff: [R] market-basket analysis in R
> 
> 
> 
> 
> Hi there fellow R-users, 
> 
> Does anyone know if there exists a package for associated 
> rules data mining
> (market basket analysis) in R. 
> 
> I have tried searching CRAN but with no luck. 
> 
> Regards
> 
> Wayne
> 
> 
> KSS Ltd
> Seventh Floor  St James's Buildings  79 Oxford Street  
> Manchester  M1 6SS  England
> Company Registration Number 2800886
> Tel: +44 (0) 161 228 0040 Fax: +44 (0) 161 236 6305
> mailto:[EMAIL PROTECTED]  http://www.kssg.com
> 
> 
> The information in this Internet email is confidential and 
> m...{{dropped}}
> 
> __
> [EMAIL PROTECTED] mailing list
> https://www.stat.math.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! 
> http://www.R-project.org/posting-guide.html
>

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


Re: [R] "attach" in R corr. to Spus one

2004-06-09 Thread Frank E Harrell Jr
Petr Pikal wrote:
Hallo
On 9 Jun 2004 at 2:06, Utsav Boobna wrote:

Hi,
   I am a newbie to R, just trying to switch from
Splus. I am wondering to know if there is any such
command in R as "attach" in Splus which can be used to
attach the full directory.

I would recommend you to spent some time going through docummentation and 
especially FAQs. 

getwd and setwd for setting the working directory
but in R objects are stored in one file .Rdata.
I prefer to control which objects are stored, and to use compression, by 
using save( ) and load( ), rather than using the .Rdata mechanism. 
save( ) can store one object or an entire series of objects in one .rda 
file.

Frank
OTOH in S+ objects are (were - I did not use it since quite a lot time) stored as 
separate files.

For attaching objects see
?attach
Cheers
Petr

Also, any idea/referrence about, how to load c
functions in R would be highly appreciated.
Thanks,
Utsav
__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide!
http://www.R-project.org/posting-guide.html

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

--
Frank E Harrell Jr   Professor and Chair   School of Medicine
 Department of Biostatistics   Vanderbilt University
__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


RE: [R] more obvious contribution mechanism?

2004-06-09 Thread Liaw, Andy
There's no paypal button, but it isn't that much harder:  Download the pdf
form, fill it out and fax it back.  How hard can that be?

Andy

> From: Jason Turner
> 
> On Wed, 2004-06-09 at 13:22, ivo welch wrote:
> > can we put a "how to donate money to R" on the R webpage?  
> perhaps with 
> > a paypal button?
> > 
> 
> Does the R Foundation link meet this need?
> 
http://www.r-project.org/foundation/main.html

Cheers

Jason

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


RE: [R] more obvious contribution mechanism?

2004-06-09 Thread Peter Flom
It certainly isn't hard to do it this way, but a PayPal button is even
easier.  I think adding one would bring in extra money.  

Just my opinion, of course

Peter

Peter L. Flom, PhD
Assistant Director, Statistics and Data Analysis Core
Center for Drug Use and HIV Research
National Development and Research Institutes
71 W. 23rd St
www.peterflom.com
New York, NY 10010
(212) 845-4485 (voice)
(917) 438-0894 (fax)



>>> "Liaw, Andy" <[EMAIL PROTECTED]> 6/9/2004 8:18:09 AM >>>
There's no paypal button, but it isn't that much harder:  Download the
pdf
form, fill it out and fax it back.  How hard can that be?

Andy

> From: Jason Turner
> 
> On Wed, 2004-06-09 at 13:22, ivo welch wrote:
> > can we put a "how to donate money to R" on the R webpage?  
> perhaps with 
> > a paypal button?
> > 
> 
> Does the R Foundation link meet this need?
> 
http://www.r-project.org/foundation/main.html 

Cheers

Jason

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

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


Re: [R] e1071, R1.9.0, Solaris 2.9, should I be worried?

2004-06-09 Thread Orit Harel (Gdalyahu)

Hi
How are you ?
Did you get any answer regarding "String literal converted to char*" ?

Thanks.

Thanks and regards,
Orit Harel
* 972-9-7767513
*   [EMAIL PROTECTED]




The information contained in this message is proprietary of Amdocs,
protected from disclosure, and may be privileged.
The information is intended to be conveyed only to the designated recipient(s)
of the message. If the reader of this message is not the intended recipient,
you are hereby notified that any dissemination, use, distribution or copying of
this communication is strictly prohibited and may be unlawful.
If you have received this communication in error, please notify us immediately
by replying to the message and deleting it from your computer.
Thank you.
[[alternative HTML version deleted]]

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


Re: [R] market-basket analysis in R

2004-06-09 Thread Christian Schulz
I don't know any package!?
 
 but you could try:

http://fuzzy.cs.uni-magdeburg.de/~borgelt/software.html
http://www.cs.umb.edu/~laur/ARtool/
http://www.cs.waikato.ac.nz/ml/weka/

regards,
Christian


Am Mittwoch, 9. Juni 2004 13:27 schrieb Wayne Jones:
> Hi there fellow R-users,
>
> Does anyone know if there exists a package for associated rules data mining
> (market basket analysis) in R.
>
> I have tried searching CRAN but with no luck.
>
> Regards
>
> Wayne
>
>
> KSS Ltd
> Seventh Floor  St James's Buildings  79 Oxford Street  Manchester  M1 6SS 
> England Company Registration Number 2800886
> Tel: +44 (0) 161 228 0040 Fax: +44 (0) 161 236 6305
> mailto:[EMAIL PROTECTED]  http://www.kssg.com
>
>
> The information in this Internet email is confidential and m...{{dropped}}
>
> __
> [EMAIL PROTECTED] mailing list
> https://www.stat.math.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide!
> http://www.R-project.org/posting-guide.html

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


[R] Re: more obvious contribution mechanism

2004-06-09 Thread ivo welch
hi:  thanks everyone for pointing me to the contribution page..
[a] it was not obvious to me how to find this page.  if you like 
contributions, please make it a bit more obvious.  I would think a 
button on the home page would be a good idea.

[b] any kind of trinket sale (a CD?) for money would be useful for 
research budget based donations.  now I will try to find out if my 
research budget allows me to send donations.  (how about buying some air 
for $100?)  g...

[c] for individuals, a paypal button to donate $x would be a very good idea.
[d] VISA works well internationally---but non-US check based items do 
not for our accounting.  especially if the R-project does not have a US 
bank account, paypal would be useful.

Andy: yes, the paypal-like scam is another phishing one.  the same 
applies to most other orgs these days (ebay, amazon, etc.)

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


RE: [R] "attach" in R corr. to Spus one

2004-06-09 Thread Liaw, Andy
> From: Frank E Harrell Jr
> 
> Petr Pikal wrote:
> > Hallo
> > 
> > On 9 Jun 2004 at 2:06, Utsav Boobna wrote:
> > 
> > 
> >>Hi,
> >>I am a newbie to R, just trying to switch from
> >>Splus. I am wondering to know if there is any such
> >>command in R as "attach" in Splus which can be used to
> >>attach the full directory.
> > 
> > 
> > I would recommend you to spent some time going through 
> docummentation and 
> > especially FAQs. 
> > 
> > getwd and setwd for setting the working directory
> > 
> > but in R objects are stored in one file .Rdata.
> 
> I prefer to control which objects are stored, and to use 
> compression, by 
> using save( ) and load( ), rather than using the .Rdata mechanism. 
> save( ) can store one object or an entire series of objects 
> in one .rda 
> file.

I mostly do the same.  For fairly large objects or objects that I do not
want to accidentally alter during a session, I use attach() instead of
load().  One convenience of attach() is that since the objects are not
loaded into .GlobalEnv, I would have a less cluttered .RData even if I do
save the workspace when I q().

Cheers,
Andy

 
> Frank
> 
> > 
> > OTOH in S+ objects are (were - I did not use it since quite 
> a lot time) stored as 
> > separate files.
> > 
> > For attaching objects see
> > 
> > ?attach
> > 
> > Cheers
> > Petr
> > 
> > 
> >>Also, any idea/referrence about, how to load c
> >>functions in R would be highly appreciated.
> >>
> >>Thanks,
> >>Utsav
> >>
> >>__
> >>[EMAIL PROTECTED] mailing list
> >>https://www.stat.math.ethz.ch/mailman/listinfo/r-help
> >>PLEASE do read the posting guide!
> >>http://www.R-project.org/posting-guide.html
> > 
> > 
> > Petr Pikal
> > [EMAIL PROTECTED]
> > 
> > __
> > [EMAIL PROTECTED] mailing list
> > https://www.stat.math.ethz.ch/mailman/listinfo/r-help
> > PLEASE do read the posting guide! 
> http://www.R-project.org/posting-guide.html
> > 
> 
> 
> -- 
> Frank E 
> Harrell Jr   Professor and Chair   School of Medicine
>   Department of Biostatistics   
> Vanderbilt University
> 
> __
> [EMAIL PROTECTED] mailing list
> https://www.stat.math.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! 
> http://www.R-project.org/posting-guide.html
> 
>

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


RE: [R] "attach" in R corr. to Spus one

2004-06-09 Thread Liaw, Andy
Now that I acutally read the original question:

If there are .RData files in other directories that you want to attach(),
you can certainly do that.  One difference between R and S-plus is that in
S-plus you can attach() a directory at position 1, effectively making that
the place that new objects are stored.  In R, attach()ing at position 1 is
not allowed.  I must say that I like the way R works better, as it does a
better job at preventing me from keeping garbage around.

Best,
Andy

> From: Liaw, Andy
> 
> > From: Frank E Harrell Jr
> > 
> > Petr Pikal wrote:
> > > Hallo
> > > 
> > > On 9 Jun 2004 at 2:06, Utsav Boobna wrote:
> > > 
> > > 
> > >>Hi,
> > >>I am a newbie to R, just trying to switch from
> > >>Splus. I am wondering to know if there is any such
> > >>command in R as "attach" in Splus which can be used to
> > >>attach the full directory.
> > > 
> > > 
> > > I would recommend you to spent some time going through 
> > docummentation and 
> > > especially FAQs. 
> > > 
> > > getwd and setwd for setting the working directory
> > > 
> > > but in R objects are stored in one file .Rdata.
> > 
> > I prefer to control which objects are stored, and to use 
> > compression, by 
> > using save( ) and load( ), rather than using the .Rdata mechanism. 
> > save( ) can store one object or an entire series of objects 
> > in one .rda 
> > file.
> 
> I mostly do the same.  For fairly large objects or objects 
> that I do not
> want to accidentally alter during a session, I use attach() instead of
> load().  One convenience of attach() is that since the objects are not
> loaded into .GlobalEnv, I would have a less cluttered .RData 
> even if I do
> save the workspace when I q().
> 
> Cheers,
> Andy
> 
>  
> > Frank
> > 
> > > 
> > > OTOH in S+ objects are (were - I did not use it since quite 
> > a lot time) stored as 
> > > separate files.
> > > 
> > > For attaching objects see
> > > 
> > > ?attach
> > > 
> > > Cheers
> > > Petr
> > > 
> > > 
> > >>Also, any idea/referrence about, how to load c
> > >>functions in R would be highly appreciated.
> > >>
> > >>Thanks,
> > >>Utsav
> > > 
> > > Petr Pikal
> > > [EMAIL PROTECTED]
> > > 
> > > __
> > > [EMAIL PROTECTED] mailing list
> > > https://www.stat.math.ethz.ch/mailman/listinfo/r-help
> > > PLEASE do read the posting guide! 
> > http://www.R-project.org/posting-guide.html
> > > 
> > 
> > 
> > -- 
> > Frank E 
> > Harrell Jr   Professor and Chair   School of Medicine
> >   Department of Biostatistics   
> > Vanderbilt University

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


Re: [R] GLMM(..., family=binomial(link="cloglog"))?

2004-06-09 Thread Göran Broström
On Tue, Jun 08, 2004 at 08:32:24AM -0700, Spencer Graves wrote:
> Hi, Doug: 
> 
>  Thanks.  I'll try the things you suggests.  The observed 
> proportions ranged from roughly 0.2 to 0.8 in 100 binomial random 
> samples where sigma is at most 0.05.  Jim Lindsey's "glmm" does 
> Gauss-Hermite quadrature, but I don't know if it bothers with the 
> adaptive step.  With it, I've seen estimates of the variance component 
> ranging from 0.4 to 0.7 or so.  Since I simulated normal 0 standard 
> deviation of 1, the algorithm was clearly underestimating what was 
> simulated.  My next step, I think, is to program adaptive Gauss-Hermite 
> quadrature for something closer to my real problem (as you just 
> suggested), and see what I get. 
[...]

> Douglas Bates wrote:
> 
> >Spencer Graves <[EMAIL PROTECTED]> writes:
> >
[...]
> >>  Consider the following:
> >>
> >>> set.seed(1); N <- 10
> >>> z <- rnorm(N)
> >>> pz <- inv.logit(z)
> >>> DF <- data.frame(z=z, pz=pz, y=rbinom(N, 100, pz)/100, n=100,
> >>> smpl=factor(1:N))
> >>
> >>> GLMM(y~1, family=binomial, data=DF, random=~1|smpl, weights=n)

I think the "weights=n" is the problem, i.e., you summarize Bernoulli
data to Bin(100, p) data, and that gives a completely different estimate of
the variance of the random effect. (This looks as an error in lme4 to me,
or am I missing something? Doug?) Really, the two ways of representing data
should give equivalent analyses, but it doesn't. The same phenomenon
appears in 'glm', i.e. without random effects, but only for the residual
sum of squares, df, and AIC. 

The following is a small function calling lme4 twice, first as
before, and then with data 'wrapped up' into Bernoulli data. I also run
'glmmML' in the latter case (since glmmML only allows the Bernoulli
representation):

---   
sim <- function(N = 10, grpSize = 10, std = 1){
require(glmmML)
require(lme4)

set.seed(1)
z <- rnorm(N, mean = 0, sd = std)
#pz <- inv.logit(z); is identical to (in 'stats')
pz <- plogis(z)
Y <- rbinom(N, grpSize, pz)

## 'Summary' data frame:

DF <- data.frame(z = z, pz = pz,
 y = Y / grpSize,
 n = grpSize,
 smpl = factor(1:N))

fit1 <- GLMM(y~1, family = binomial, data = DF,
 random = ~1|smpl, weights = n)
##fit1 <- glm(y~1, family = binomial, data = DF, weights = n)


## 'Individual' data frame:

n <- N * grpSize
z <- rep(z, rep(grpSize, N))
pz <- rep(pz, rep(grpSize, N))

y <- numeric(n)
for (i in 1:N) y[((i - 1) * grpSize + 1):((i-1)*grpSize + Y[i])] <- 1 
smpl <- as.factor(rep(1:N, rep(grpSize, N)))

bigDF <- data.frame(z = z, pz = pz, y = y,
smpl = smpl)
fit2 <- GLMM(y~1, family=binomial, data=bigDF, random=~1|smpl)
##fit2 <- glm(y~1, family=binomial, data=bigDF)

fitML <- glmmML(y ~ 1, family = binomial,
data = bigDF,
cluster = bigDF$smpl)

return(list(fit1 = fit1,
fit2 = fit2,
fitML = fitML
)
   )
}


Output:

$fit1
Generalized Linear Mixed Model

Family: binomial family with logit link
Fixed: y ~ 1 
Data: DF 
 log-likelihood:  -11.59919 
Random effects:
 Groups NameVariance   Std.Dev.  
 smpl   (Intercept) 3.0384e-10 1.7431e-05

Estimated scale (compare to 1)  1.391217 

Fixed effects:
Estimate Std. Error z value Pr(>|z|)
(Intercept)  0.489550.20602  2.3762  0.01749

Number of Observations: 10
Number of Groups: 10 

$fit2
Generalized Linear Mixed Model

Family: binomial family with logit link
Fixed: y ~ 1 
Data: bigDF 
 log-likelihood:  -64.8084 
Random effects:
 Groups NameVariance Std.Dev.
 smpl   (Intercept) 0.58353  0.7639  

Estimated scale (compare to 1)  0.9563351 

Fixed effects:
Estimate Std. Error z value Pr(>|z|)
(Intercept)  0.528110.32286  1.6357   0.1019

Number of Observations: 100
Number of Groups: 10 

$fitML

Call:  glmmML(formula = y ~ 1, data = bigDF, 
  cluster = bigDF$smpl, family = binomial) 


  coef se(coef) z Pr(>|z|)
(Intercept) 0.5587   0.3313 1.686   0.0917

Standard deviation in mixing distribution:  0.764 
Std. Error: 0.3655 

Residual deviance: 129.5 on 98 degrees of freedom   AIC: 133.5 
---
Note the big difference in estimated random effect 'sd' in the two lme4
runs! Note further how close to each other the corresponding estimates for
the second run of lme4 and of glmmML are.

[...]

Göran
-- 
 Göran Broströmtel: +46 90 786 5223
 Department of Statistics  fax: +46 90 786 6614
 Umeå University   http://www.stat.umu.se/egna/gb/
 SE-90187 Umeå, Sweden e-mail: [EMAIL PROTECTED]


RE: [R] Specifying xlevels in effects library

2004-06-09 Thread Liaw, Andy
Prof. Fox will be able to give the definitive answer, but from my reading of
?effect, xlevels refers to the values of the factor whose effect you're
interested in, not the ones being `marginalized'.  I believe you need to
play with the `typical' argument.

HTH,
Andy

> From: David J. Netherway
> 
> library(effects)
> mod <- lm(Measurement ~ Age + Sex, data=d)
> e <-effect("Sex",mod)
>  
> The effect is evaluated at the mean age.
>  
>  > e
> Sex effect
> Sex
>FM  
> 43.33083 44.48531  
>  >
>  > e$model.matrix
>(Intercept)  Age SexM
> 11 130.58590
> 23   1 130.58591
>  
> To evaluate the effect at Age=120 I tried:
> e <-effect("Sex",mod,xlevels=list(Age=c(120)))
> but the effect was still evaluated at 130.5859.
>  
> Is this an incorrect usage of xlevels?
> 
> Thanks, David
> 
> __
> [EMAIL PROTECTED] mailing list
> https://www.stat.math.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! 
> http://www.R-project.org/posting-guide.html
> 
>

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


Re: [R] SJAVA error

2004-06-09 Thread $BLpLn(B $B=g;R(B
I am using windows xp, R 1.9.0 and SJava 0.65 modified. 
(Bperhaps I set correctly.
(B 
(Bcould you  send me your compiled SJava package with the 
(Bmodified REmbed.c because in Windows i'm not able to recompile!!!
(Bcould you provide me your solution.
(B
(B---
(BCLASSPATH
(B C:\Program Files\R\rw1090\library\SJava;
(B C:\Program Files\R\rw1090\library\SJava\org\omegahat\Jars\antlr.jar;
(B C:\Program 
(BFiles\R\rw1090\library\SJava\org\omegahat\Jars\Environment.jar;
(B C:\Program Files\R\rw1090\library\SJava\org\omegahat\Jars\jas.jar;
(B C:\Program Files\R\rw1090\library\SJava\org\omegahat\Jars\jhall.jar;
(B C:\Program 
(BFiles\R\rw1090\library\SJava\org\omegahat\Jars\ROmegahatExamples.jar
(B 
(B JAVA_HOME
(B C:\j2sdk1.4.1_03
(B path
(B C:\j2sdk1.4.1_03\jre\bin\client;
(B C:\Program Files\R\rw1090\library\SJava\libs;
(B C:\Program Files\R\rw1090\bin
(B 
(B R_HOME
(B C:\Program Files\R\rw1090
(B 
(B SJAVA
(B C:\Program Files\R\rw1090\library\SJava
(B
(Bthank you
(B
(BJunko Yano
(BE-mail : [EMAIL PROTECTED]
(B
(B
(B
(B
(B
(B>From: Vincent MUTEAUD <[EMAIL PROTECTED]>
(B>To: Prof Brian Ripley <[EMAIL PROTECTED]>
(B>CC: $BLpLn(B $B=g;R(B <[EMAIL PROTECTED]>,<[EMAIL PROTECTED]>
(B>Subject: Re: [R] SJAVA error
(B>Date: Wed, 09 Jun 2004 10:48:15 +0200
(B>
(B>Thanks
(B>I am using windows NT, R 1.9.0 and SJava 0.65 modified. I think my 
(B>R_HOME is set correctly
(B>
(B>A 08:26 09/06/2004 +0100, Prof Brian Ripley a $BqD(Brit :
(B>>SJava is not part of R but rather of Omegahat, so this is the wrong 
(B>>list.
(B>>But as a hint, I think you have not set R_HOME, or not set it 
(B>>correctly.
(B>>
(B>>But please consult the R posting guide for hints as to what 
(B>>information
(B>>might be needed to help either of you, as neither or you have 
(B>>provided
(B>>basic information like the OS, version of R, version of SJava 
(B>>
(B>>On Wed, 9 Jun 2004, Vincent MUTEAUD wrote:
(B>>
(B>> > Hi,
(B>> > I have the same error than you two weeks ago. As I have not 
(B>>found how to
(B>> > do, I give up my example.
(B>> > Yunko, I am interesting if you found how to proceed.
(B>> > Thanks
(B>> >
(B>> > Vincent
(B>> >
(B>> > A 01:07 09/06/2004 +0900, 
(B>>=?iso-2022-jp?B?GyRCTHBMbhsoQiAbJEI9ZztSGyhC?= a
(B>> > $BqD(Brit :
(B>> > >Hi
(B>> > >
(B>> > >I'm trying to use SJava and I have troubles. I try to run 
(B>>examples from
(B>> > >"Calling R from Java"
(B>> > >but,I have an error that "fatal error: enable to open the base 
(B>>package"
(B>> > >
(B>> > >I heard  SJAVA bug,
(B>> > >so,could you  send me your compiled SJava package with the 
(B>>modified
(B>> > >REmbed.c because in Windows i'm not able to recompile!!!
(B>>
(B>>EVERYONE should be able to compile under Windows as all the tools 
(B>>required
(B>>are free.
(B>>
(B>> > >--example
(B>> > >package org.omegahat.R.Java;
(B>> > >
(B>> > >public class REvalSample {
(B>> > > public static void main(String[] args) {
(B>> > > String[] rargs = { "--slave", "--vanilla" };
(B>> > >
(B>> > >
(B>> > >System.out.println("Java$B$+$i(BR$B$r%3!<%k$9$k%W%m%0%i%`(B");
(B>> > >
(B>> > > ROmegahatInterpreter interp =
(B>> > > new ROmegahatInterpreter(
(B>> > > 
(B>>ROmegahatInterpreter.fixArgs(rargs),
(B>> > > false);
(B>> > > REvaluator e = new REvaluator();
(B>> > >
(B>> > > Object val = e.eval("x <- sin(seq(0, 2*pi, 
(B>>length=30))");
(B>> > > val = e.eval("x * 2.0");
(B>> > >
(B>> > > if (val != null) {
(B>> > > double[] objects = (double[]) val;
(B>> > > for (int i = 0; i < objects.length; 
(B>>i++) {
(B>> > > System.err.println("(" + i + 
(B>>") " +
(B>> > > objects[i]);
(B>> > > }
(B>> > > }
(B>> > > }
(B>> > >}
(B>>
(B>>--
(B>>Brian D. Ripley,  [EMAIL PROTECTED]
(B>>Professor of Applied Statistics,  
(B>>http://www.stats.ox.ac.uk/~ripley/
(B>>University of Oxford, Tel:  +44 1865 272861 (self)
(B>>1 South Parks Road, +44 1865 272866 (PA)
(B>>Oxford OX1 3TG, UKFax:  +44 1865 272595
(B>
(B
(B__
(B[EMAIL PROTECTED] mailing list
(Bhttps://www.stat.math.ethz.ch/mailman/listinfo/r-help
(BPLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

RE: [R] Specifying xlevels in effects library

2004-06-09 Thread Liaw, Andy
Here's an example:

> library(effects)
> age <- round(rnorm(100, mean=30, sd=5))
> sex <- factor(sample(c("M","F"), 100, replace=TRUE))
> y <- rnorm(100)
> fit <- lm(y ~ age + sex)
> eff <- effect("sex", fit, typical=function(...) 25)
> eff

 sex effect
sex
  F   M 
-0.23387685  0.07063834 

Now we can check if that looks right:

> predict(fit, newdata=data.frame(age=c(25, 25), sex=factor(c("M","F"
  1   2 
 0.07063834 -0.23387685 

HTH,
Andy



> From: Liaw, Andy
> 
> Prof. Fox will be able to give the definitive answer, but 
> from my reading of
> ?effect, xlevels refers to the values of the factor whose 
> effect you're
> interested in, not the ones being `marginalized'.  I believe 
> you need to
> play with the `typical' argument.
> 
> HTH,
> Andy
> 
> > From: David J. Netherway
> > 
> > library(effects)
> > mod <- lm(Measurement ~ Age + Sex, data=d)
> > e <-effect("Sex",mod)
> >  
> > The effect is evaluated at the mean age.
> >  
> >  > e
> > Sex effect
> > Sex
> >FM  
> > 43.33083 44.48531  
> >  >
> >  > e$model.matrix
> >(Intercept)  Age SexM
> > 11 130.58590
> > 23   1 130.58591
> >  
> > To evaluate the effect at Age=120 I tried:
> > e <-effect("Sex",mod,xlevels=list(Age=c(120)))
> > but the effect was still evaluated at 130.5859.
> >  
> > Is this an incorrect usage of xlevels?
> > 
> > Thanks, David
> > 
> > __
> > [EMAIL PROTECTED] mailing list
> > https://www.stat.math.ethz.ch/mailman/listinfo/r-help
> > PLEASE do read the posting guide! 
> > http://www.R-project.org/posting-guide.html
> > 
> >
> 
> __
> [EMAIL PROTECTED] mailing list
> https://www.stat.math.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! 
> http://www.R-project.org/posting-guide.html
> 
> 
> --
> 
> Notice:  This e-mail message, together with any attachments, 
> contains information of Merck & Co., Inc. (One Merck Drive, 
> Whitehouse Station, New Jersey, USA 08889), and/or its 
> affiliates (which may be known outside the United States as 
> Merck Frosst, Merck Sharp & Dohme or MSD and in Japan, as 
> Banyu) that may be confidential, proprietary copyrighted 
> and/or legally privileged. It is intended solely for the use 
> of the individual or entity named on this message.  If you 
> are not the intended recipient, and have received this 
> message in error, please notify us immediately by reply 
> e-mail and then delete it from your system.
> --
> 
>

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


RE: [R] fast mkChar

2004-06-09 Thread Paulo Nuin
Hello everyone

This is my first message to the list and I believe the question I am
including is a simple one.

I have a matrix where I need to calculate ANOVA for the rows as the
columns represent a different treatment. I would like to know if there
is a command or a series of commans that I can enter to do that. 

At the moment I have a external script that extracts each row from the
matrix, transforms it in a column, another factor columns is add and the
text file is thrown to Rterm --vanilla.

Any help is appreciated.

Thanks a lot

Paulo Nuin

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


RE: [R] "attach" in R corr. to Spus one

2004-06-09 Thread Petr Pikal
Hallo Andy,

Well, my original respond was to Utsav's question if it is possible to attach a 
directory in R as in S+.

I personally prefer to start R session from a directory where I have all data and 
results from certain project (txt, doc, xls, png, pdf). Therefore I use only 
.RData and I usually store histories of my work in separate files, so as basically all 
my data and my knowledge of attaching different directories in one session is not 
at all comprehensive. 

But if I am not mistaken you cannot attach a directory without some suitable file 
(.RData or saved file) in it but you can specify different working directory by 
setwd() and list files in it by list.files(). I presume that after setwd() I can 
attach(".RData") to get access to objects from it but ls() still gives me list of 
objects stored in an .RData file in the directory from which R was started.

OTOH saving an object by save(object, file="myfile") saves the object to 
directory specified by setwd().

Cheers
Petr

On 9 Jun 2004 at 9:00, Liaw, Andy wrote:

> Now that I acutally read the original question:
> 
> If there are .RData files in other directories that you want to
> attach(), you can certainly do that.  One difference between R and
> S-plus is that in S-plus you can attach() a directory at position 1,
> effectively making that the place that new objects are stored.  In R,
> attach()ing at position 1 is not allowed.  I must say that I like the
> way R works better, as it does a better job at preventing me from
> keeping garbage around.
> 
> Best,
> Andy
> 
> > From: Liaw, Andy
> > 
> > > From: Frank E Harrell Jr
> > > 
> > > Petr Pikal wrote:
> > > > Hallo
> > > > 
> > > > On 9 Jun 2004 at 2:06, Utsav Boobna wrote:
> > > > 
> > > > 
> > > >>Hi,
> > > >>I am a newbie to R, just trying to switch from
> > > >>Splus. I am wondering to know if there is any such
> > > >>command in R as "attach" in Splus which can be used to
> > > >>attach the full directory.
> > > > 
> > > > 
> > > > I would recommend you to spent some time going through 
> > > docummentation and 
> > > > especially FAQs. 
> > > > 
> > > > getwd and setwd for setting the working directory
> > > > 
> > > > but in R objects are stored in one file .Rdata.
> > > 
> > > I prefer to control which objects are stored, and to use 
> > > compression, by 
> > > using save( ) and load( ), rather than using the .Rdata mechanism.
> > > save( ) can store one object or an entire series of objects in one
> > > .rda file.
> > 
> > I mostly do the same.  For fairly large objects or objects 
> > that I do not
> > want to accidentally alter during a session, I use attach() instead
> > of load().  One convenience of attach() is that since the objects
> > are not loaded into .GlobalEnv, I would have a less cluttered .RData
> > even if I do save the workspace when I q().
> > 
> > Cheers,
> > Andy
> > 
> >  
> > > Frank
> > > 
> > > > 
> > > > OTOH in S+ objects are (were - I did not use it since quite 
> > > a lot time) stored as 
> > > > separate files.
> > > > 
> > > > For attaching objects see
> > > > 
> > > > ?attach
> > > > 
> > > > Cheers
> > > > Petr
> > > > 
> > > > 
> > > >>Also, any idea/referrence about, how to load c
> > > >>functions in R would be highly appreciated.
> > > >>
> > > >>Thanks,
> > > >>Utsav
> > > > 
> > > > Petr Pikal
> > > > [EMAIL PROTECTED]
> > > > 
> > > > __
> > > > [EMAIL PROTECTED] mailing list
> > > > https://www.stat.math.ethz.ch/mailman/listinfo/r-help
> > > > PLEASE do read the posting guide! 
> > > http://www.R-project.org/posting-guide.html
> > > > 
> > > 
> > > 
> > > -- 
> > > Frank E 
> > > Harrell Jr   Professor and Chair   School of Medicine
> > >   Department of Biostatistics   
> > > Vanderbilt University
> 
> __
> [EMAIL PROTECTED] mailing list
> https://www.stat.math.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide!
> http://www.R-project.org/posting-guide.html

Petr Pikal
[EMAIL PROTECTED]

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


[R] Giovanna Jonalasinio è fuori ufficio- away from the office

2004-06-09 Thread Giovanna . Jonalasinio





Sarò fuori ufficio a partire dal 09/06/04 fino al 12/06/04

Sono al congresso SIS2004 a Bari.
Non so se avrò accesso alla posta elettronica.

I'll be away from the 09th to the 12th of June (SIS Conference in Bari) and I'm
not sure I'll be able to read my mail
[[alternative HTML version deleted]]

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


[R] Re: fighting with ps.options and xlim/ylim

2004-06-09 Thread ivo welch
Thanks again for all the messages.
Is the 4% in par('usr') hardcoded?  if so, may I suggest making this a 
user-changeable parameter for x and y axis?

I looked at psfrag, and it seems like a great package.  alas, I have 
switched to pdflatex, and pdffrag does not exist.  :-(

I also discovered that there is a pdf device now.  neat.  now I need to 
experiment with it.  of course, for curiosity, I looked at google to 
determine when it was added, but "R changes pdf" gives me everything 
except R related entries... :-(.

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


RE: [R] "attach" in R corr. to Spus one

2004-06-09 Thread Liaw, Andy
Hi Petr,

I don't think I've said anything that is inconsistent with what you said,
have I?

The strategy that you mentioned is the one that is recommended, and I use it
myself.  However, life is not always that simple.  There are times when the
task at hand involves data/code/whatever that live in a different directory
(perhaps most likely either the parent- or sub-directory of pwd).

.RData is just a .rda file, and thus can be attach()ed, and that's what I
said in my sentence.  E.g., I can attach("subdirectory/.RData"), then use
ls(2) to see what's in there.  (ls() does have a few optional arguments.)
Regarding save(), you can save to anywhere by using full path in the file
name (otherwise it wouldn't be terribly useful).

Best,
Andy

> From: Petr Pikal
> 
> Hallo Andy,
> 
> Well, my original respond was to Utsav's question if it is 
> possible to attach a 
> directory in R as in S+.
> 
> I personally prefer to start R session from a directory where 
> I have all data and 
> results from certain project (txt, doc, xls, png, pdf). 
> Therefore I use only 
> .RData and I usually store histories of my work in separate 
> files, so as basically all 
> my data and my knowledge of attaching different directories 
> in one session is not 
> at all comprehensive. 
> 
> But if I am not mistaken you cannot attach a directory 
> without some suitable file 
> (.RData or saved file) in it but you can specify different 
> working directory by 
> setwd() and list files in it by list.files(). I presume that 
> after setwd() I can 
> attach(".RData") to get access to objects from it but ls() 
> still gives me list of 
> objects stored in an .RData file in the directory from which 
> R was started.
> 
> OTOH saving an object by save(object, file="myfile") saves 
> the object to 
> directory specified by setwd().
> 
> Cheers
> Petr
> 
> On 9 Jun 2004 at 9:00, Liaw, Andy wrote:
> 
> > Now that I acutally read the original question:
> > 
> > If there are .RData files in other directories that you want to
> > attach(), you can certainly do that.  One difference between R and
> > S-plus is that in S-plus you can attach() a directory at position 1,
> > effectively making that the place that new objects are 
> stored.  In R,
> > attach()ing at position 1 is not allowed.  I must say that 
> I like the
> > way R works better, as it does a better job at preventing me from
> > keeping garbage around.
> > 
> > Best,
> > Andy
> > 
> > > From: Liaw, Andy
> > > 
> > > > From: Frank E Harrell Jr
> > > > 
> > > > Petr Pikal wrote:
> > > > > Hallo
> > > > > 
> > > > > On 9 Jun 2004 at 2:06, Utsav Boobna wrote:
> > > > > 
> > > > > 
> > > > >>Hi,
> > > > >>I am a newbie to R, just trying to switch from
> > > > >>Splus. I am wondering to know if there is any such
> > > > >>command in R as "attach" in Splus which can be used to
> > > > >>attach the full directory.
> > > > > 
> > > > > 
> > > > > I would recommend you to spent some time going through 
> > > > docummentation and 
> > > > > especially FAQs. 
> > > > > 
> > > > > getwd and setwd for setting the working directory
> > > > > 
> > > > > but in R objects are stored in one file .Rdata.
> > > > 
> > > > I prefer to control which objects are stored, and to use 
> > > > compression, by 
> > > > using save( ) and load( ), rather than using the .Rdata 
> mechanism.
> > > > save( ) can store one object or an entire series of 
> objects in one
> > > > .rda file.
> > > 
> > > I mostly do the same.  For fairly large objects or objects 
> > > that I do not
> > > want to accidentally alter during a session, I use 
> attach() instead
> > > of load().  One convenience of attach() is that since the objects
> > > are not loaded into .GlobalEnv, I would have a less 
> cluttered .RData
> > > even if I do save the workspace when I q().
> > > 
> > > Cheers,
> > > Andy
> > > 
> > >  
> > > > Frank
> > > > 
> > > > > 
> > > > > OTOH in S+ objects are (were - I did not use it since quite 
> > > > a lot time) stored as 
> > > > > separate files.
> > > > > 
> > > > > For attaching objects see
> > > > > 
> > > > > ?attach
> > > > > 
> > > > > Cheers
> > > > > Petr
> > > > > 
> > > > > 
> > > > >>Also, any idea/referrence about, how to load c
> > > > >>functions in R would be highly appreciated.
> > > > >>
> > > > >>Thanks,
> > > > >>Utsav
> > > > > 
> > > > > Petr Pikal
> > > > > [EMAIL PROTECTED]
> > > > > 
> > > > > __
> > > > > [EMAIL PROTECTED] mailing list
> > > > > https://www.stat.math.ethz.ch/mailman/listinfo/r-help
> > > > > PLEASE do read the posting guide! 
> > > > http://www.R-project.org/posting-guide.html
> > > > > 
> > > > 
> > > > 
> > > > -- 
> > > > Frank E 
> > > > Harrell Jr   Professor and Chair   School of Medicine
> > > >   Department of Biostatistics   
> > > > Vanderbilt University
> > 
> > __
> > [EMAIL PROTECTED] mailing list
> > https://www.stat.math.ethz.ch/ma

Re: [R] SJAVA error

2004-06-09 Thread Uwe Ligges
$BLpLn(B $B=g;R(B wrote:
(B
(B> I am using windows xp, R 1.9.0 and SJava 0.65 modified. perhaps I set 
(B> correctly.
(B> 
(B> could you  send me your compiled SJava package with the modified 
(B> REmbed.c because in Windows i'm not able to recompile!!!
(B> could you provide me your solution.
(B
(BYou can compile yourself! Please read readme.packages which tells you
(Bhow to set up our system in order to compile packages.
(B
(BUwe Ligges
(B
(B
(B> ---
(B> CLASSPATH
(B> C:\Program Files\R\rw1090\library\SJava;
(B> C:\Program Files\R\rw1090\library\SJava\org\omegahat\Jars\antlr.jar;
(B> C:\Program 
(B> Files\R\rw1090\library\SJava\org\omegahat\Jars\Environment.jar;
(B> C:\Program Files\R\rw1090\library\SJava\org\omegahat\Jars\jas.jar;
(B> C:\Program Files\R\rw1090\library\SJava\org\omegahat\Jars\jhall.jar;
(B> C:\Program 
(B> Files\R\rw1090\library\SJava\org\omegahat\Jars\ROmegahatExamples.jar
(B> 
(B> JAVA_HOME
(B> C:\j2sdk1.4.1_03
(B> path
(B> C:\j2sdk1.4.1_03\jre\bin\client;
(B> C:\Program Files\R\rw1090\library\SJava\libs;
(B> C:\Program Files\R\rw1090\bin
(B> 
(B> R_HOME
(B> C:\Program Files\R\rw1090
(B> 
(B> SJAVA
(B> C:\Program Files\R\rw1090\library\SJava
(B> 
(B> thank you
(B> 
(B> Junko Yano
(B> E-mail : [EMAIL PROTECTED]
(B> 
(B> 
(B> 
(B> 
(B> 
(B>> From: Vincent MUTEAUD <[EMAIL PROTECTED]>
(B>> To: Prof Brian Ripley <[EMAIL PROTECTED]>
(B>> CC: $BLpLn(B $B=g;R(B <[EMAIL PROTECTED]>,
(B>> <[EMAIL PROTECTED]>
(B>> Subject: Re: [R] SJAVA error
(B>> Date: Wed, 09 Jun 2004 10:48:15 +0200
(B>>
(B>> Thanks
(B>> I am using windows NT, R 1.9.0 and SJava 0.65 modified. I think my 
(B>> R_HOME is set correctly
(B>>
(B>> A 08:26 09/06/2004 +0100, Prof Brian Ripley a $BqD(Brit :
(B>>
(B>>> SJava is not part of R but rather of Omegahat, so this is the wrong 
(B>>> list.
(B>>> But as a hint, I think you have not set R_HOME, or not set it correctly.
(B>>>
(B>>> But please consult the R posting guide for hints as to what information
(B>>> might be needed to help either of you, as neither or you have provided
(B>>> basic information like the OS, version of R, version of SJava 
(B>>>
(B>>> On Wed, 9 Jun 2004, Vincent MUTEAUD wrote:
(B>>>
(B>>> > Hi,
(B>>> > I have the same error than you two weeks ago. As I have not found 
(B>>> how to
(B>>> > do, I give up my example.
(B>>> > Yunko, I am interesting if you found how to proceed.
(B>>> > Thanks
(B>>> >
(B>>> > Vincent
(B>>> >
(B>>> > A 01:07 09/06/2004 +0900, 
(B>>> =?iso-2022-jp?B?GyRCTHBMbhsoQiAbJEI9ZztSGyhC?= a
(B>>> > $BqD(Brit :
(B>>> > >Hi
(B>>> > >
(B>>> > >I'm trying to use SJava and I have troubles. I try to run examples 
(B>>> from
(B>>> > >"Calling R from Java"
(B>>> > >but,I have an error that "fatal error: enable to open the base 
(B>>> package"
(B>>> > >
(B>>> > >I heard  SJAVA bug,
(B>>> > >so,could you  send me your compiled SJava package with the modified
(B>>> > >REmbed.c because in Windows i'm not able to recompile!!!
(B>>>
(B>>> EVERYONE should be able to compile under Windows as all the tools 
(B>>> required
(B>>> are free.
(B>>>
(B>>> > >--example
(B>>> > >package org.omegahat.R.Java;
(B>>> > >
(B>>> > >public class REvalSample {
(B>>> > > public static void main(String[] args) {
(B>>> > > String[] rargs = { "--slave", "--vanilla" };
(B>>> > >
(B>>> > >
(B>>> > >System.out.println("Java$B$+$i(BR$B$r%3!<%k$9$k%W%m%0%i%`(B");
(B>>> > >
(B>>> > > ROmegahatInterpreter interp =
(B>>> > > new ROmegahatInterpreter(
(B>>> > > ROmegahatInterpreter.fixArgs(rargs),
(B>>> > > false);
(B>>> > > REvaluator e = new REvaluator();
(B>>> > >
(B>>> > > Object val = e.eval("x <- sin(seq(0, 2*pi, 
(B>>> length=30))");
(B>>> > > val = e.eval("x * 2.0");
(B>>> > >
(B>>> > > if (val != null) {
(B>>> > > double[] objects = (double[]) val;
(B>>> > > for (int i = 0; i < objects.length; i++) {
(B>>> > > System.err.println("(" + i + ") " +
(B>>> > > objects[i]);
(B>>> > > }
(B>>> > > }
(B>>> > > }
(B>>> > >}
(B>>>
(B>>> -- 
(B>>> Brian D. Ripley,  [EMAIL PROTECTED]
(B>>> Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
(B>>> University of Oxford, Tel:  +44 1865 272861 (self)
(B>>> 1 South Parks Road, +44 1865 272866 (PA)
(B>>> Oxford OX1 3TG, UKFax:  +44 1865 272595
(B>>
(B>>
(B> 
(B> __
(B> [EMAIL PROTECTED] mailing list
(B> https://www.stat.math.ethz.ch/mailman/listinfo/r-help
(B> PLEASE do read the posting gu

Re: [R] Re: fighting with ps.options and xlim/ylim

2004-06-09 Thread Uwe Ligges
ivo welch wrote:
Thanks again for all the messages.
Is the 4% in par('usr') hardcoded?  if so, may I suggest making this a 
user-changeable parameter for x and y axis?
See ?par and its argumets xaxp, yaxp which can be set to "i".

I looked at psfrag, and it seems like a great package.  alas, I have 
switched to pdflatex, and pdffrag does not exist.  :-(

I also discovered that there is a pdf device now.  neat.  
Since R-1.3.0, as the News file tells us.
Uwe Ligges

now I need to 
experiment with it.  of course, for curiosity, I looked at google to 
determine when it was added, but "R changes pdf" gives me everything 
except R related entries... :-(.

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


[R] Dot chart question

2004-06-09 Thread Peter Flom
Running R 1.8.1 on  a Windows machine

In dotchart, I would like to shrink the labels on the tick marks (that
is, the numbers) without shrinking anything else.  I could not find this
in either the Rhelp archives or in ?dotchart, which recmmends cex to
avoid 'label overlap', but cex shrinks all the characters in the plot.

Is there a way to do this?

Thanks

Peter

Peter L. Flom, PhD
Assistant Director, Statistics and Data Analysis Core
Center for Drug Use and HIV Research
National Development and Research Institutes
71 W. 23rd St
www.peterflom.com
New York, NY 10010
(212) 845-4485 (voice)
(917) 438-0894 (fax)

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


Re: [R] Dot chart question

2004-06-09 Thread Chuck Cleland
  See cex.axis and other cex.* arguments to par() in ?par.  For example:
> data(VADeaths)
>  dotchart(VADeaths, main = "Death Rates in Virginia - 1940")
> par(cex.axis = .6)
>  dotchart(VADeaths, main = "Death Rates in Virginia - 1940")
hope this helps,
Chuck Cleland
Peter Flom wrote:
Running R 1.8.1 on  a Windows machine
In dotchart, I would like to shrink the labels on the tick marks (that
is, the numbers) without shrinking anything else.  I could not find this
in either the Rhelp archives or in ?dotchart, which recmmends cex to
avoid 'label overlap', but cex shrinks all the characters in the plot.
Is there a way to do this?
--
Chuck Cleland, Ph.D.
NDRI, Inc.
71 West 23rd Street, 8th floor
New York, NY 10010
tel: (212) 845-4495 (Tu, Th)
tel: (732) 452-1424 (M, W, F)
fax: (917) 438-0894
__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] GLMM(..., family=binomial(link="cloglog"))?

2004-06-09 Thread Spencer Graves
Hi, Go"ran:
(B
(BThanks for the analysis. Unfortunately, it still leaves me with 2
(Bproblems. First, I'm dealing with extremely small defect rates involving
(Bthousands and millions of Bernoulli trials, so creating bigDF would
(Brequire computers with much more memory and processing speed available.
(B
(BSecond, there still seems to be substantial bias in the estimates. Do
(Byou have any thoughts about the origins of this bias and what I can do
(Babout it? Maybe I should try your bigDF GLMM call with method="Laplace".
(BSince Lindsey's "glmm" claims to be doing Gauss-Hermite quadrature, I
(Bwonder if adaptive Gauss-Hermite will fix this bias problem. I guess
(BI'll just have to try it and find out.
(B
(BThanks again.
(BSpencer Graves
(B
(BGo"ran Brostro"m wrote:
(B
(B>On Tue, Jun 08, 2004 at 08:32:24AM -0700, Spencer Graves wrote:
(B>  
(B>
(B>>Hi, Doug: 
(B>>
(B>> Thanks.  I'll try the things you suggests.  The observed 
(B>>proportions ranged from roughly 0.2 to 0.8 in 100 binomial random 
(B>>samples where sigma is at most 0.05.  Jim Lindsey's "glmm" does 
(B>>Gauss-Hermite quadrature, but I don't know if it bothers with the 
(B>>adaptive step.  With it, I've seen estimates of the variance component 
(B>>ranging from 0.4 to 0.7 or so.  Since I simulated normal 0 standard 
(B>>deviation of 1, the algorithm was clearly underestimating what was 
(B>>simulated.  My next step, I think, is to program adaptive Gauss-Hermite 
(B>>quadrature for something closer to my real problem (as you just 
(B>>suggested), and see what I get. 
(B>>
(B>>
(B>[...]
(B>
(B>  
(B>
(B>>Douglas Bates wrote:
(B>>
(B>>
(B>>
(B>>>Spencer Graves <[EMAIL PROTECTED]> writes:
(B>>>
(B>>>  
(B>>>
(B>[...]
(B>  
(B>
(B  Consider the following:
(B
(B
(B
(B>set.seed(1); N <- 10
(B>z <- rnorm(N)
(B>pz <- inv.logit(z)
(B>DF <- data.frame(z=z, pz=pz, y=rbinom(N, 100, pz)/100, n=100,
(B>smpl=factor(1:N))
(B>  
(B>
(B>GLMM(y~1, family=binomial, data=DF, random=~1|smpl, weights=n)
(B>  
(B>
(B>
(B>I think the "weights=n" is the problem, i.e., you summarize Bernoulli
(B>data to Bin(100, p) data, and that gives a completely different estimate of
(B>the variance of the random effect. (This looks as an error in lme4 to me,
(B>or am I missing something? Doug?) Really, the two ways of representing data
(B>should give equivalent analyses, but it doesn't. The same phenomenon
(B>appears in 'glm', i.e. without random effects, but only for the residual
(B>sum of squares, df, and AIC. 
(B>
(B>The following is a small function calling lme4 twice, first as
(B>before, and then with data 'wrapped up' into Bernoulli data. I also run
(B>'glmmML' in the latter case (since glmmML only allows the Bernoulli
(B>representation):
(B>
(B>---   
(B>sim <- function(N = 10, grpSize = 10, std = 1){
(B>require(glmmML)
(B>require(lme4)
(B>
(B>set.seed(1)
(B>z <- rnorm(N, mean = 0, sd = std)
(B>#pz <- inv.logit(z); is identical to (in 'stats')
(B>pz <- plogis(z)
(B>Y <- rbinom(N, grpSize, pz)
(B>
(B>## 'Summary' data frame:
(B>
(B>DF <- data.frame(z = z, pz = pz,
(B> y = Y / grpSize,
(B> n = grpSize,
(B> smpl = factor(1:N))
(B>
(B>fit1 <- GLMM(y~1, family = binomial, data = DF,
(B> random = ~1|smpl, weights = n)
(B>##fit1 <- glm(y~1, family = binomial, data = DF, weights = n)
(B>
(B>
(B>## 'Individual' data frame:
(B>
(B>n <- N * grpSize
(B>z <- rep(z, rep(grpSize, N))
(B>pz <- rep(pz, rep(grpSize, N))
(B>
(B>y <- numeric(n)
(B>for (i in 1:N) y[((i - 1) * grpSize + 1):((i-1)*grpSize + Y[i])] <- 1 
(B>smpl <- as.factor(rep(1:N, rep(grpSize, N)))
(B>
(B>bigDF <- data.frame(z = z, pz = pz, y = y,
(B>smpl = smpl)
(B>fit2 <- GLMM(y~1, family=binomial, data=bigDF, random=~1|smpl)
(B>##fit2 <- glm(y~1, family=binomial, data=bigDF)
(B>
(B>fitML <- glmmML(y ~ 1, family = binomial,
(B>data = bigDF,
(B>cluster = bigDF$smpl)
(B>
(B>return(list(fit1 = fit1,
(B>fit2 = fit2,
(B>fitML = fitML
(B>)
(B>   )
(B>}
(B>
(B>
(B>Output:
(B>
(B>$fit1
(B>Generalized Linear Mixed Model
(B>
(B>Family: binomial family with logit link
(B>Fixed: y ~ 1 
(B>Data: DF 
(B> log-likelihood:  -11.59919 
(B>Random effects:
(B> Groups NameVariance   Std.Dev.  
(B> smpl   (Intercept) 3.0384e-10 1.7431e-05
(B>
(B>Estimated scale (compare to 1)  1.391217 
(B>
(B>Fixed effects:
(B>Estimate Std. Error z value Pr(>|z|)
(B>(Intercept)  0.489

[R] X-12-ARIMA

2004-06-09 Thread Paul Gilbert
(subject changed from "[R] a doubt" )
The fortran source code for X-12-ARIMA seems to be available at 
. Incorporating 
this into a standard R package would be a much better approach than 
trying to hack an OS specific version with system calls to a .exe file. 
I expect there will be a fair amount of work in either case, and I don't 
have time to look at it now. If anyone wants to do the real work then I 
would be interested in using it (but using calls to a .exe would not be 
very useful to me). The first thing to check would be the license, as I 
have not looked at it. The next is probably the question of whether the 
fortran is nicely organized in subroutines without IO, so R can call 
those and avoid fortran IO problems.

(Perhaps there are R users at the U.S. Census Bureau that would be 
willing to help?)

Paul Gilbert
Martínez Ovando Juan Carlos wrote:
Hello again,
In a previous message I request your help, but I don't have been clear in my problem. Specifically, I'm trying to create an interface in R for the X-12-ARIMA and TRAMO SEATS, for the versions that run in MS-DOS. This problem awake in me the interest for make interfaces to comparing some Bayesian models for classification that where implemented in MS-DOS to. The question for you is if you know about the existence of an R function that allows me to run -in Windows- executable files in MS-DOS from the R command window. 

The function 'dos' in Matlab that I have mention in the previous message allows to run '.exe' programs for a specific directory.  

Many thanks.  

Saludos,
   Juan Carlos
 

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


Re: [R] Dot chart question

2004-06-09 Thread Peter Flom
Thanks, this worked.  I had tried

fx.dotchart2(freqrelig[order(freqrelig)],
 label = levels(religfact)[order(freqrelig)],
 main = 'Religions among young adults in Bushwick \n (log scale)',
 xlab = 'Frequency', log = 'x', cex.axis = .7)

which did nothing...

Peter

>>> Chuck Cleland <[EMAIL PROTECTED]> 6/9/2004 10:39:04 AM >>>
   See cex.axis and other cex.* arguments to par() in ?par.  For
example:

 > data(VADeaths)
 >  dotchart(VADeaths, main = "Death Rates in Virginia - 1940")
 > par(cex.axis = .6)
 >  dotchart(VADeaths, main = "Death Rates in Virginia - 1940")

hope this helps,

Chuck Cleland

Peter Flom wrote:
> Running R 1.8.1 on  a Windows machine
> 
> In dotchart, I would like to shrink the labels on the tick marks
(that
> is, the numbers) without shrinking anything else.  I could not find
this
> in either the Rhelp archives or in ?dotchart, which recmmends cex to
> avoid 'label overlap', but cex shrinks all the characters in the
plot.
> 
> Is there a way to do this?

-- 
Chuck Cleland, Ph.D.
NDRI, Inc.
71 West 23rd Street, 8th floor
New York, NY 10010
tel: (212) 845-4495 (Tu, Th)
tel: (732) 452-1424 (M, W, F)
fax: (917) 438-0894

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


[R] Anova question

2004-06-09 Thread Paulo Nuin
Hello everyone

This is my first message to the list and I believe the question I am
including is a simple one.

I have a matrix where I need to calculate ANOVA for the rows as the
columns represent a different treatment. I would like to know if there
is a command or a series of commans that I can enter to do that. 

At the moment I have a external script that extracts each row from the
matrix, transforms it in a column, another factor columns is add and the
text file is thrown to Rterm --vanilla.

Any help is appreciated.

Thanks a lot

Paulo Nuin

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


[R] robust correlation in R

2004-06-09 Thread Xavier . Abulker




Dear R user group,

I'm looking for a robust mesure of correlation in R.
I found a very interesting article by Dr Rich Herrington on
http://www.unt.edu/benchmarks/archives/2001/december01/rss.htm and I'd like
to implement
exaclty this method but my problem is that everything is here developped in
R language and is very slow when the correlation matrix is important.
I'm wondering if someone has maybe developped the same (or equivalent)
method using  functions in C like it is currently developped in r for the
covariance and variance.
Thank you for your help.

Xavier


*
Ce message et toutes les pieces jointes (ci-apres le "messag...{{dropped}}

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


Reshaping matrix (was: [R] fast mkChar)

2004-06-09 Thread Duncan Murdoch
On 09 Jun 2004 09:52:27 -0400, Paulo Nuin <[EMAIL PROTECTED]> wrote :

>Hello everyone
>
>This is my first message to the list and I believe the question I am
>including is a simple one.
>
>I have a matrix where I need to calculate ANOVA for the rows as the
>columns represent a different treatment. I would like to know if there
>is a command or a series of commans that I can enter to do that. 
>
>At the moment I have a external script that extracts each row from the
>matrix, transforms it in a column, another factor columns is add and the
>text file is thrown to Rterm --vanilla.

Welcome to the list.  One suggestion:  you should use a subject line
that matches the topic of your question, or your question is likely to
get lost.

Most of the modelling functions in R assume that data is in a vector.
You can convert a matrix to a vector using the as.numeric() function.
To get the treatments associated with each one, you could apply
as.numeric() to the col() function. You should also convert this to a
factor, for the anova.

For example,

> original <- matrix(1:12, 3, 4)
> vector <- as.numeric(original)
> treatments <- as.factor(as.numeric(col(original)))
> vector
 [1]  1  2  3  4  5  6  7  8  9 10 11 12
> treatments
 [1] 1 1 1 2 2 2 3 3 3 4 4 4
Levels: 1 2 3 4
> anova(lm(vector ~ treatments))
Analysis of Variance Table

Response: vector
   Df Sum Sq Mean Sq F valuePr(>F)
treatments  3135  45  45 2.356e-05 ***
Residuals   8  8   1  
---
Signif. codes:  0 `***' 0.001 `**' 0.01 `*' 0.05 `.' 0.1 ` ' 1 

You can read the help pages on each of these functions to see what
options are available.

Duncan Murdoch

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


[R] robust correlation in R

2004-06-09 Thread Xavier . Abulker





Dear R user group,

I'm looking for a robust mesure of correlation in R.
I found a very interesting article by Dr Rich Herrington on
http://www.unt.edu/benchmarks/archives/2001/december01/rss.htm and I'd like
to implement
exaclty this method but my problem is that everything is here developped in
R language and is very slow when the correlation matrix is important.
I'm wondering if someone has maybe developped the same (or equivalent)
method using  functions in C like it is currently developped in r for the
covariance and variance.
Thank you for your help.

Xavier



*
Ce message et toutes les pieces jointes (ci-apres le "messag...{{dropped}}

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


[R] ask for data manipulation!

2004-06-09 Thread vinkwai wong
i have such a data:
V1   V2   V3  V4
abc   e
afd   NA
bde   f
hdNA  NA
adf   e
……
(V1,V2,V3,V4 can be any one of a, b, c, d, e, f, g, h. that is to say ,it has 8 
possible values.)

and i want to change it the the following form:
abcdefgh
8762.5   5   2.5  2.5  2.5#2.5is the mean of (4+3+2+1)
833 637   33  #3 is the mean of (5+4+3+2+1)
2.5  82.5   765   2.5   2.5#2.5is the mean of (4+3+2+1)
3.5 3.5   3.5   73.5  3.5  3.5   8   #3.5is the mean of (6+54+3+2+1)
8   2.5   2.5   756   2.52.5
……

i want to know if there is some easy way to achieve my goal using R?

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


Re: [R] X-12-ARIMA

2004-06-09 Thread Dirk Eddelbuettel
On Wed, Jun 09, 2004 at 10:41:58AM -0400, Paul Gilbert wrote:
> (subject changed from "[R] a doubt" )
> 
> The fortran source code for X-12-ARIMA seems to be available at 
> . Incorporating 
> this into a standard R package would be a much better approach than 
> trying to hack an OS specific version with system calls to a .exe file. 
> I expect there will be a fair amount of work in either case, and I don't 
> have time to look at it now. If anyone wants to do the real work then I 
> would be interested in using it (but using calls to a .exe would not be 
> very useful to me). The first thing to check would be the license, as I 
> have not looked at it. The next is probably the question of whether the 
> fortran is nicely organized in subroutines without IO, so R can call 
> those and avoid fortran IO problems.

Couldn't agree more.

GNU Gretl, a sleek intro- to intermediate econometrics program, actually has
interfaces to both x12a and tramo-seats, the latter being more of a problem
as it is not available in source from the Bank of Spain. Gretl works on (at
least) Windows, OS X and Linux.  I maintain the Debian package too.

Would be nice if someone looking for a decent code project took Census' x12a
sources and brought the dreadful text-file based interface forward into this
century by linking it to R.

Dirk


> 
> (Perhaps there are R users at the U.S. Census Bureau that would be 
> willing to help?)
> 
> Paul Gilbert
> 
> Mart?nez Ovando Juan Carlos wrote:
> 
> >Hello again,
> >
> >In a previous message I request your help, but I don't have been clear in 
> >my problem. Specifically, I'm trying to create an interface in R for the 
> >X-12-ARIMA and TRAMO SEATS, for the versions that run in MS-DOS. This 
> >problem awake in me the interest for make interfaces to comparing some 
> >Bayesian models for classification that where implemented in MS-DOS to. 
> >The question for you is if you know about the existence of an R function 
> >that allows me to run -in Windows- executable files in MS-DOS from the R 
> >command window. 
> >
> >The function 'dos' in Matlab that I have mention in the previous message 
> >allows to run '.exe' programs for a specific directory.  
> >
> >Many thanks.  
> >
> >Saludos,
> >
> >   Juan Carlos
> >
> > 
> >
> 
> __
> [EMAIL PROTECTED] mailing list
> https://www.stat.math.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! 
> http://www.R-project.org/posting-guide.html
> 

-- 
FEATURE:  VW Beetle license plate in California

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


Wrong question [Wasn't: Re: [R] fast mkChar]

2004-06-09 Thread Matej Cepl
On Wednesday 09 of June 2004 09:52, you wrote:
> This is my first message to the list and I believe the question
> I am including is a simple one.

http://www.r-project.org/posting-guide.html

-- 
Matej Cepl, http://www.ceplovi.cz/matej
GPG Finger: 89EF 4BC6 288A BF43 1BAB  25C3 E09F EF25 D964 84AC
138 Highland Ave. #10, Somerville, Ma 02143, (617) 623-1488
 
Of course I'm respectable. I'm old. Politicians, ugly buildings,
and whores all get respectable if they last long enough.
  --John Huston in "Chinatown."

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


[R] Multiple regression

2004-06-09 Thread Manoj - Hachibushu Capital
Hi,
I am trying to do multiple regression on a set of data using backward stepwise 
regressionhowever backward stepwise regression is critised for overfitting data. 
To actually observe the bias and to come up with a better method to use..Could you all 
stats experts kindly give me pointers to any alternative procedure (or references) to 
use over backward stepwise regression from your experience? 

TIA.

Manoj

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


RE: [R] Is there an R-version of rayplot

2004-06-09 Thread richard . kittler
Thanks for this example.  I have since found the 'arrows' function which is not as 
comprehensive as rayplot but seems to work well for basic vector field plots, e.g. 

 y <- rep(1:5,rep(5,5))  
 x <- rep(1:5,5) 

 x1 <- x-sqrt(x*x + y*y)/25
 y1 <- y-2*x/125

 plot(x,y,,main='Sample Vector Plot',type='n')
 arrows(x,y,x1,y1,length=0.1) 


--Rich

Richard Kittler 
AMD TDG
408-749-4099

-Original Message-
From: joerg van den hoff [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, June 09, 2004 4:10 AM
Cc: Kittler, Richard; [EMAIL PROTECTED]
Subject: Re: [R] Is there an R-version of rayplot


maybe this q&d try helps?


#=cut herer=

vectorplot <- function (field) {

   #input is a (N x 4 array) of N vectors:
   #   field[,1:2] - x/y position  of vectors
   #   field[,3:4] - x/y componnent of vectors
   # plotted are the 2-D vectors attached to  the specified positions

   if (is.null(dim(field))||dim(field)[2] != 4) stop("N x 4 array expected")

   loc <- field[,1:2]
   val <- field[,3:4]

   alpha <- rbind(loc[,1],loc[,1]+val[,1])
   omega <- rbind(loc[,2],loc[,2]+val[,2])

   matplot(alpha,omega,type='l',lty=1,col='black') #the vector lines
   points(loc) #the start points
   points(loc+val,pch=20) #the end points
}

#example:

loc=matrix(rnorm(100),50,2)
field <- cbind(loc,loc)
vectorplot(field)

#=cut herer=

there are no nice arrow heads, of course, but one could construct some... for now, 
vectors start with open circles and end with filled circles.

joerg

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


Re: [R] Multiple regression

2004-06-09 Thread Dimitris Rizopoulos
Have a look at Prof. Harrell's book (Chapters 4 and 5)

@Book{harrell:01,
  author= {F. E. Harrell, Jr.},
  title = {Regression Modeling Strategies: With Applications to
Linear Models, Logistic Regression and Survival
Analysis},
  year  = {2001},
  address   = {New York},
  publisher = {Springer-Verlag}
}

Best,
Dimitris


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

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


- Original Message - 
From: "Manoj - Hachibushu Capital" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, June 09, 2004 5:13 PM
Subject: [R] Multiple regression


> Hi,
> I am trying to do multiple regression on a set of data using
backward stepwise regressionhowever backward stepwise regression
is critised for overfitting data. To actually observe the bias and to
come up with a better method to use..Could you all stats experts
kindly give me pointers to any alternative procedure (or references)
to use over backward stepwise regression from your experience?
>
> TIA.
>
> Manoj
>
> __
> [EMAIL PROTECTED] mailing list
> https://www.stat.math.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide!
http://www.R-project.org/posting-guide.html

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


Re: [R] market-basket analysis in R

2004-06-09 Thread Christian Schulz
Hi,

when i want start more than one year ago
with a fuzzy-association rule algorithm to
learn programming in r  i have to work in business
and it's too bad that here  until now nobody need a tool 
for market basket analysis  in  r  :-).

regards,Christian


Am Mittwoch, 9. Juni 2004 15:38 schrieb Wayne Jones:
> Hi Christian,
>
> Thanks for that. The links will be very useful.
>
> Im surprised that no package exists in R though!!
>
> Regards
>
> Wayne
>
>
> -Original Message-
> From: Christian Schulz [mailto:[EMAIL PROTECTED]
> Sent: 09 June 2004 13:52
> To: [EMAIL PROTECTED]
> Cc: Wayne Jones
> Subject: Re: [R] market-basket analysis in R
>
>
> I don't know any package!?
>
>  but you could try:
>
> http://fuzzy.cs.uni-magdeburg.de/~borgelt/software.html
> http://www.cs.umb.edu/~laur/ARtool/
> http://www.cs.waikato.ac.nz/ml/weka/
>
> regards,
> Christian
>
> Am Mittwoch, 9. Juni 2004 13:27 schrieb Wayne Jones:
> > Hi there fellow R-users,
> >
> > Does anyone know if there exists a package for associated rules data
>
> mining
>
> > (market basket analysis) in R.
> >
> > I have tried searching CRAN but with no luck.
> >
> > Regards
> >
> > Wayne
> >
> >
> > KSS Ltd
> > Seventh Floor  St James's Buildings  79 Oxford Street  Manchester  M1 6SS
> > England Company Registration Number 2800886
> > Tel: +44 (0) 161 228 0040   Fax: +44 (0) 161 236 6305
> > mailto:[EMAIL PROTECTED]http://www.kssg.com
> >
> >
> > The information in this Internet email is confidential and
> > m...{{dropped}}
> >
> > __
> > [EMAIL PROTECTED] mailing list
> > https://www.stat.math.ethz.ch/mailman/listinfo/r-help
> > PLEASE do read the posting guide!
> > http://www.R-project.org/posting-guide.html

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


Re: [R] Dot chart question

2004-06-09 Thread Frank E Harrell Jr
Peter Flom wrote:
Running R 1.8.1 on  a Windows machine
In dotchart, I would like to shrink the labels on the tick marks (that
is, the numbers) without shrinking anything else.  I could not find this
in either the Rhelp archives or in ?dotchart, which recmmends cex to
avoid 'label overlap', but cex shrinks all the characters in the plot.
Is there a way to do this?
Thanks
Peter
Peter L. Flom, PhD
Assistant Director, Statistics and Data Analysis Core
Center for Drug Use and HIV Research
National Development and Research Institutes
71 W. 23rd St
www.peterflom.com
New York, NY 10010
(212) 845-4485 (voice)
(917) 438-0894 (fax)
There are probably many ways, but one is to use dotchart2 in Hmisc, I think.
Frank
__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

--
Frank E Harrell Jr   Professor and Chair   School of Medicine
 Department of Biostatistics   Vanderbilt University
__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] About dll from c++ routine

2004-06-09 Thread Rui
Hi folks,
 
My system is Windows98 + R1.9.0. 
The path for my system is c:\perl\bin; c:\mingw\bin; c:\rtools;
c:\windows; c:\windows\command; c:\rw1090\bin.
 
I created three files followed the examples in “Writing R extensions” in
the directory c:\temp:
// X.hh
class X {
public: X (); ~X ();
};
class Y {
public: Y (); ~Y ();
};
 
// X.cc
#include 
#include "X.hh"
static Y y;
X::X() { std::cout << "constructor X" << std::endl; }
X::~X() { std::cout << "destructor X" << std::endl; }
Y::Y() { std::cout << "constructor Y" << std::endl; }
Y::~Y() { std::cout << "destructor Y" << std::endl; }
 
 
// X_main.cc:
#include "X.hh"
extern "C" {
void X_main () {
X x;
}
} // extern "C"
 
Then I followed the instructions in “R for windows FAQ” using the
command:
C:\temp>RCMD SHLIB X.CC X_MAIN.CC
 
However, I got the following message: 
In file included from x_main.cc:2:
x.hh:7:3: Warning: no newline at end of the file
making convolve.d from convolve.cc
g++   -IC: /R/RW1090/src/include –Wall –o2  -c  x.cc  -o  x.o
In file included from x.cc:3:
x.hh:7:3: Warning: no newline at end of the file
make: *** No rule to make target ‘x_main.o’, needed by ‘X.a’. Stop
 
I guess I failed to get the dll file finally. 
 
Any suggestion would be greatly appreciated.
 
Rui
 
Phone: (403)220-4501
Email: [EMAIL PROTECTED]
Department of Mathematics and Statistics
University of Calgary
 

[[alternative HTML version deleted]]

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


RE: [R] Comparing two pairs of non-normal datasets in R?

2004-06-09 Thread Lutz Prechelt
> Here are the boxplots if that helps:
> http://www.ps.masny.dk/guests/misc/A1.png
> http://www.ps.masny.dk/guests/misc/A2.png
> http://www.ps.masny.dk/guests/misc/C1.png
> http://www.ps.masny.dk/guests/misc/C2.png

Here is how I would do it:
It looks like your distributions can be characterized by
just a single parameter.

Then your question is:
   Is the change in the parameter value from A1 to A2
   larger than that from C1 to C2?
(Larger meaning what?: Difference? Ratio?)

So I suggest
- you estimate your four parameters
- compute your two differences or ratios
- compute the difference of those
- and repeat all this for many resamples (bootstrapping)

Then you get a bootstrap distribution of the 
value that you hope is significantly non-zero.
>From that distribution you can read your p-value.
(Preferably based on a BCa confidence interval)

library(boot)

Does that make sense?

  Lutz

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


Re: [R] Re: fighting with ps.options and xlim/ylim

2004-06-09 Thread Marc Schwartz
On Wed, 2004-06-09 at 09:30, Uwe Ligges wrote:
> ivo welch wrote:
> 
> > 
> > Thanks again for all the messages.
> > 
> > Is the 4% in par('usr') hardcoded?  if so, may I suggest making this a 
> > user-changeable parameter for x and y axis?
> 
> See ?par and its argumets xaxp, yaxp which can be set to "i".

Quick correction. That should be xaxs and yaxs. See my initial reply.

xaxp and yaxp are for the positions of the tick marks.

> > I looked at psfrag, and it seems like a great package.  alas, I have 
> > switched to pdflatex, and pdffrag does not exist.  :-(

One option to point out, is that if the functionality in psfrag is
important to you, you can use 'ps2pdf' to convert a ps file to a pdf
file. ps2pdf filters the ps file through ghostscript to create the pdf
file.

It means a three step process (latex, dvips and ps2pdf), but it can
provide additional functionality that pdflatex does not support, such as
the use of \special as in the package 'pstricks'. pdf does not have any
programming language functionality as does postscript, so there are some
tradeoffs and likely why there is no pdffrag.

Food for thought.

> > I also discovered that there is a pdf device now.  neat.  
> 
> Since R-1.3.0, as the News file tells us.
> 
> Uwe Ligges

HTH,

Marc

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


Re: [R] Anova question

2004-06-09 Thread Adaikalavan Ramasamy
On Wed, 2004-06-09 at 15:36, Paulo Nuin wrote:
> Hello everyone
> 
> This is my first message to the list and I believe the question I am
> including is a simple one.
> 
> I have a matrix where I need to calculate ANOVA for the rows as the
> columns represent a different treatment. I would like to know if there
> is a command or a series of commans that I can enter to do that. 

let us say x represents the measurements. Further suppose that the first
10 columns represent Treatment A and the next 10 Treatment B.

x <- rnorm(20) # simulated value for response
g <- as.factor( rep(c("A", "B"), each=10) ) # treatments

model <- lm(x ~ g)
summary(model)
anova(model)

For more information, see help(lm) and help(aov). The books cited in
these references are pretty good and worth looking into. You might also
find the introductory book on R by Peter Daalgard or online
documentations helpful.

> At the moment I have a external script that extracts each row from the
> matrix, transforms it in a column, another factor columns is add and the
> text file is thrown to Rterm --vanilla.

You do not have to do this manually. You can use the apply function to
apply the ANOVA each row. Example

g <- as.factor( rep(c("A", "B"), each=10) ) # treatments
apply( my.matrix, 1, function(x) {
 model <- lm(x ~ g)
 print(summary(model))
})

If you have hundreds of rows, then you way just store specific output
(test statistics, p-value) instead of printing it. Example coef(model),
summary(model)$coefficients.

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


Re: [R] About dll from c++ routine

2004-06-09 Thread Prof Brian Ripley
On Wed, 9 Jun 2004, Rui wrote:

> Hi folks,
>  
> My system is Windows98 + R1.9.0. 
> The path for my system is c:\perl\bin; c:\mingw\bin; c:\rtools;
> c:\windows; c:\windows\command; c:\rw1090\bin.
>  
> I created three files followed the examples in “Writing R extensions” in
> the directory c:\temp:
> // X.hh
> class X {
> public: X (); ~X ();
> };
> class Y {
> public: Y (); ~Y ();
> };
>  
> // X.cc
> #include 
> #include "X.hh"
> static Y y;
> X::X() { std::cout << "constructor X" << std::endl; }
> X::~X() { std::cout << "destructor X" << std::endl; }
> Y::Y() { std::cout << "constructor Y" << std::endl; }
> Y::~Y() { std::cout << "destructor Y" << std::endl; }
>  
>  
> // X_main.cc:
> #include "X.hh"
> extern "C" {
> void X_main () {
> X x;
> }
> } // extern "C"



> Then I followed the instructions in “R for windows FAQ” using the
> command:
> C:\temp>RCMD SHLIB X.CC X_MAIN.CC
>  
> However, I got the following message: 
> In file included from x_main.cc:2:
> x.hh:7:3: Warning: no newline at end of the file
> making convolve.d from convolve.cc
> g++   -IC: /R/RW1090/src/include –Wall –o2  -c  x.cc  -o  x.o
> In file included from x.cc:3:
> x.hh:7:3: Warning: no newline at end of the file
> make: *** No rule to make target ‘x_main.o’, needed by ‘X.a’. Stop
>  
> I guess I failed to get the dll file finally. 
>  
> Any suggestion would be greatly appreciated.

Add newlines at the end of your files as warned.

It would help to name your files consistently, e.g. x_main.cc and not 
X_main.cc and X_MAIN.CC.

If you follow the instructions carefully, this does work.

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

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


[R] lsoda with arbitrary zero thresholds

2004-06-09 Thread Martin Henry H. Stevens
using R 2.0.0
I am trying to do some population modeling with lsoda, where I set 
arbitrary zero population sizes when values get close to zero, but am 
having no luck.
As an example of what I have tried, I use code below from the help page 
on lsoda in which I include my modification bordered by ###

parms <- c(k1=0.04, k2=1e4, k3=3e7)
my.atol <- c(1e-6,  1e-10,  1e-6)
times <- seq(0,)
lsexamp <- function(t, y, p)
  { ### The next line is where I try to insert the threshold
ifelse(y < 0.4,  0, y)
## all else is unchanged
yd1 <- -p["k1"] * y[1] + p["k2"] * y[2]*y[3]
yd3 <- p["k3"] * y[2]^2
list(c(yd1,-yd1-yd3,yd3),c(massbalance=sum(y)))
  }
out <- lsoda(c(.5,0,.5),times,lsexamp, parms, rtol=1e-4, atol= my.atol) 
# Initial values differ from help page
matplot(out[,1],out[,2:5], type="l")
out[dim(out)[1],] # The intent of my could was to cause population 1 to 
fall to zero as soon as it reached < 0.4

Any thoughts would be appreciated. Thanks!
Hank Stevens
Dr. Martin Henry H. Stevens, Assistant Professor
338 Pearson Hall
Botany Department
Miami University
Oxford, OH 45056
Office: (513) 529-4206
Lab: (513) 529-4262
FAX: (513) 529-4243
http://www.cas.muohio.edu/botany/bot/henry.html
http://www.muohio.edu/ecology/
http://www.muohio.edu/botany/
"E Pluribus Unum"
__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] Specifying xlevels in effects library

2004-06-09 Thread John Fox
Dear David and Andy,

First, my apologies for somehow missing the original message.

Andy has it right: xlevels refers to the predictors in the term
corresponding to the effect to be computed. His solution is clever -- I
wouldn't have thought of it -- but it could get you into trouble in a
more complicated model.

Another possibility is to specify an effect that includes both
predictors (i.e., the Sex*Age effect, which is higher-order to the
terms actually in the model), and to set Age to the desired value in
xlevels. At present, effect() wants more than one value for each
variable in the xlevels list. I'll look at changing that, but at
present you could do something like

effect("Sex*Age", mod, xlevels=(Age=c(120,120)))

This should get you what you want, albeit redundantly.

I hope that this helps,
 John


On Wed, 9 Jun 2004 09:40:49 -0400
 "Liaw, Andy" <[EMAIL PROTECTED]> wrote:
> Prof. Fox will be able to give the definitive answer, but from my
> reading of
> ?effect, xlevels refers to the values of the factor whose effect
> you're
> interested in, not the ones being `marginalized'.  I believe you need
> to
> play with the `typical' argument.
> 
> HTH,
> Andy
> 
> > From: David J. Netherway
> > 
> > library(effects)
> > mod <- lm(Measurement ~ Age + Sex, data=d)
> > e <-effect("Sex",mod)
> >  
> > The effect is evaluated at the mean age.
> >  
> >  > e
> > Sex effect
> > Sex
> >FM  
> > 43.33083 44.48531  
> >  >
> >  > e$model.matrix
> >(Intercept)  Age SexM
> > 11 130.58590
> > 23   1 130.58591
> >  
> > To evaluate the effect at Age=120 I tried:
> > e <-effect("Sex",mod,xlevels=list(Age=c(120)))
> > but the effect was still evaluated at 130.5859.
> >  
> > Is this an incorrect usage of xlevels?
> > 
> > Thanks, David
> > 
> > __
> > [EMAIL PROTECTED] mailing list
> > https://www.stat.math.ethz.ch/mailman/listinfo/r-help
> > PLEASE do read the posting guide! 
> > http://www.R-project.org/posting-guide.html
> > 
> >
> 
> __
> [EMAIL PROTECTED] mailing list
> https://www.stat.math.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide!
> http://www.R-project.org/posting-guide.html



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

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


[R] question related to S-Plus

2004-06-09 Thread Rick Picard
Dear r-help,
 Having used S-Plus for many years, it has
been suggested to me that I could benefit from
learning R.  A question to this end, though.
Would all of my existing S-Plus arrays, functions,
and so on have to be re-created from scratch in R,
or is there a way to copy them into the .Rdata
directory?  The answer to this question has major
implications for the extent to which R is attractive
in the near term, and any enlightenment would be
much appreciated.
Thanks,
Rick Picard
__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] lsoda with arbitrary zero thresholds (with psuedo-solution)

2004-06-09 Thread Martin Henry H. Stevens
I have  a new and less distressing, but potentially more interesting, 
problem.
I realized the major flaw my old "solution" and now have a solution 
that kind of works but is rather inelegant and I think may be 
problematic in difficult systems.
Borrowing from the lsoda example again I once again highlight the code 
that I have changed to put in place arbitrary thresholds:

parms <- c(k1=0.04, k2=1e4, k3=3e7)
my.atol <- c(1e-6,  1e-10,  1e-6)
times <- seq(0,1000)
lsexamp <- function(t, y, p)
  {
if(y[1] < .4) yd1 <- -y[1] ### These if, else statements are new
else yd1 <- -p["k1"] * y[1] + p["k2"] * y[2]*y[3]
if(y[3] < .4) yd3 <- -y[3]   ### These if,else statements are new
else yd3 <- p["k3"] * y[2]^2
list(c(yd1,-yd1-yd3,yd3),c(massbalance=sum(y)))
  }
out <- lsoda(c(.5,0,.5),times,lsexamp, parms, rtol=1e-4, atol= my.atol, 
hmax=.1)
matplot(out[,1],out[,2:5], type="l")
out[dim(out)[1],] # The intent of my could was to cause population 1 to 
fall to zero as soon as it reached < 0.4. However, the populations 1 
and 2 reach approximations of 0 (4e-281 and 5e-11).

So, I have two questions:
Can I set thresholds in a more elegant and simpler way?
Are the approximate zero values close enough?
Thank you kindly, as ever.
Sincerely,
Hank
On Jun 9, 2004, at 12:45 PM, Martin Henry H. Stevens wrote:
using R 2.0.0
I am trying to do some population modeling with lsoda, where I set 
arbitrary zero population sizes when values get close to zero, but am 
having no luck.
As an example of what I have tried, I use code below from the help 
page on lsoda in which I include my modification bordered by ###

parms <- c(k1=0.04, k2=1e4, k3=3e7)
my.atol <- c(1e-6,  1e-10,  1e-6)
times <- seq(0,)
lsexamp <- function(t, y, p)
  { ### The next line is where I try to insert the threshold
ifelse(y < 0.4,  0, y)
## all else is unchanged
yd1 <- -p["k1"] * y[1] + p["k2"] * y[2]*y[3]
yd3 <- p["k3"] * y[2]^2
list(c(yd1,-yd1-yd3,yd3),c(massbalance=sum(y)))
  }
out <- lsoda(c(.5,0,.5),times,lsexamp, parms, rtol=1e-4, atol= 
my.atol) # Initial values differ from help page
matplot(out[,1],out[,2:5], type="l")
out[dim(out)[1],] # The intent of my could was to cause population 1 
to fall to zero as soon as it reached < 0.4

Any thoughts would be appreciated. Thanks!
Hank Stevens
Dr. Martin Henry H. Stevens, Assistant Professor
338 Pearson Hall
Botany Department
Miami University
Oxford, OH 45056
Office: (513) 529-4206
Lab: (513) 529-4262
FAX: (513) 529-4243
http://www.cas.muohio.edu/botany/bot/henry.html
http://www.muohio.edu/ecology/
http://www.muohio.edu/botany/
"E Pluribus Unum"
__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! 
http://www.R-project.org/posting-guide.html


Dr. Martin Henry H. Stevens, Assistant Professor
338 Pearson Hall
Botany Department
Miami University
Oxford, OH 45056
Office: (513) 529-4206
Lab: (513) 529-4262
FAX: (513) 529-4243
http://www.cas.muohio.edu/botany/bot/henry.html
http://www.muohio.edu/ecology/
http://www.muohio.edu/botany/
"E Pluribus Unum"
__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] [R-pkgs] gregmisc 1.11.2 including read.xls()

2004-06-09 Thread Warnes, Gregory R

Release 1.11.2 of the gregmisc() package of functions is now available on
CRAN at http://cran.r-project.org/src/contrib/Descriptions/gregmisc.html for
both Unix and Windows systems.

The most notable enhancement provided by this release is:

- read.xls(), a function to read Microsoft Excel files by
  translating them to csv files via the xls2csv.pl script has
  been added.  I've also provided Unix and MS-Windows scripts 
  in /gregmisc/bin which allow you to call 
  xls2csv directly.  The code uses perl libraries which are
  included in the package, so perl must be in the execution path.

Other enhancements include:

- Improvements to CrossTable() by Marc Schwartz <[EMAIL PROTECTED]>

- Improvements to ooplot() by Lodewijk Bonebakker <[EMAIL PROTECTED]>

- plotCI() and plotmeans() now have improved argument handling.

- The running() function now has an additional parameter `simplify'
  which controls whether the returned values are simplified into a
  vector/matrix or left as a list.

- A makefile that will download and attempt to install all available
  packages from CRAN and Bioconductor is now provided in
  $PACKAGE$/gregmisc/tools/

- space() can now space points along the 'y' dimension.

- Fix an error in the permutations code for repeats.allow=T and r>2.
  Both the bug report and fix are from Elizabeth Purdom
  <[EMAIL PROTECTED]>.

- Various fixes for compatibility with R 1.9.X.

See the NEWS and ChangeLog files in the .tar.gz file for additional details.

-Greg

Gregory R. Warnes
Manager, Non-Clinical Statistics
Pfizer Global Research and Development



LEGAL NOTICE\ Unless expressly stated otherwise, this messag...{{dropped}}

___
R-packages mailing list
[EMAIL PROTECTED]
https://www.stat.math.ethz.ch/mailman/listinfo/r-packages

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


[R] Re: R equivalent of Splus rowVars function

2004-06-09 Thread David Brahm

Mark Leeds <[EMAIL PROTECTED]> wrote (to S-News):
> does anyone know the R equivalent of the SPlus rowVars function ?

Andy Liaw <[EMAIL PROTECTED]> replied:
> More seriously, I seem to recall David Brahms at one time had created an R
> package with these dimensional summary statistics, using C code.  (And I
> pointed him to the `two-pass' algorithm for variance.)

Here are the functions that didn't make it into R's base package, which should
be very similar to the S-Plus functions of the same names.  The "twopass"
argument determines whether Andy's two-pass algorithm (Chan Golub & LeVegue) is
used (it's slower but more accurate).  In real life I set the "twopass" default
to FALSE, because in finance noise is always bigger than signal.

I am cc'ing to R-help, as this is really an R question.
-- 
  -- David Brahm ([EMAIL PROTECTED])


colVars <- function(x, na.rm=FALSE, dims=1, unbiased=TRUE, SumSquares=FALSE,
twopass=TRUE) {
  if (SumSquares) return(colSums(x^2, na.rm, dims))
  N <- colSums(!is.na(x), FALSE, dims)
  Nm1 <- if (unbiased) N-1 else N
  if (twopass) {x <- if (dims==length(dim(x))) x - mean(x, na.rm=na.rm) else
 sweep(x, (dims+1):length(dim(x)), colMeans(x,na.rm,dims))}
  (colSums(x^2, na.rm, dims) - colSums(x, na.rm, dims)^2/N) / Nm1
}

rowVars <- function(x, na.rm=FALSE, dims=1, unbiased=TRUE, SumSquares=FALSE,
twopass=TRUE) {
  if (SumSquares) return(rowSums(x^2, na.rm, dims))
  N <- rowSums(!is.na(x), FALSE, dims)
  Nm1 <- if (unbiased) N-1 else N
  if (twopass) {x <- if (dims==0) x - mean(x, na.rm=na.rm) else
 sweep(x, 1:dims, rowMeans(x,na.rm,dims))}
  (rowSums(x^2, na.rm, dims) - rowSums(x, na.rm, dims)^2/N) / Nm1
}

colStdevs <- function(x, ...) sqrt(colVars(x, ...))

rowStdevs <- function(x, ...) sqrt(rowVars(x, ...))

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


[R] Building package on Windows: No rule to make target '-llapack'

2004-06-09 Thread Zhu Wang
Dear all,

I have a problem to build a package on Windows XP while there is no problem on Linux. 
The Makefile is something like:
###
LIBNAME=cts

PKG_LIBS = $(LAPACK_LIBS) $(BLAS_LIBS) $(FLIBS)

OBJS=file1.o ... file20.o -llapack -lblas

$(LIBNAME)$(SHLIB_EXT): $(OBJS)
$(SHLIB_LD) $(SHLIB_LDFLAGS) -o $@ $(OBJS) $(FLIBS)

clean:
@rm -f *.o *.$(SHLIB_EXT)

realclean: clean
#

To build the package on Windows XP, I have followed the instructions to install 
tools/software required and it seems the 
'make' worked fine, except for the error message:

make[3]: No rule to make target 'llapack', needed by 'cts.a'. stop.

Now I think maybe two problems: one is that maybe I do not have Lapack and Blas 
installed
on Windows XP and second is that I do not set up a correct file, something like 
'configure'.
Maybe there are more problems. I have read some files in \src\gnuwin32, but I did not 
find
what I needed.

Thanks for any advice.

Zhu Wang

Statistical Science Department
Southern Methodist University

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


Re: [R] Building package on Windows: No rule to make target '-llapack'

2004-06-09 Thread A.J. Rossini
Zhu Wang <[EMAIL PROTECTED]> writes:

> Now I think maybe two problems: one is that maybe I do not have Lapack and Blas 
> installed

I think this definitely needs to be solved.

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

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

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


RE: [R] fast mkChar

2004-06-09 Thread Vadim Ogranovich
Thank you for the lead, Peter. It may be useful for other packages I
write.

As to the strings, I think I have to take what is already there. I agree
that strings would be better managed in malloc-style fashion (probably
with reference counter) and not by gc(). However I don't want to have a
system with two different string classes, such close relatives seldom
coexist peacefully.

BTW, the slowness of mkChar explains why R is so slow when it needs to
compute names for long vectors.

Thank you for an interesting discussion,
Vadim 

> -Original Message-
> From: Peter Dalgaard [mailto:[EMAIL PROTECTED] 
> Sent: Tuesday, June 08, 2004 3:35 PM
> To: Vadim Ogranovich
> Cc: R-Help
> Subject: Re: [R] fast mkChar
> 
> "Vadim Ogranovich" <[EMAIL PROTECTED]> writes:
> 
> > I am no expert in memory management in R so it's hard for 
> me to tell 
> > what is and what is not doable. From reading the code of 
> allocVector() 
> > in memory.c I think that the critical part is to vectorize 
> > CLASS_GET_FREE_NODE and use the vectorized version along 
> the lines of 
> > the code fragment below (taken from memory.c).
> > 
> > if (node_class < NUM_SMALL_NODE_CLASSES) {
> > CLASS_GET_FREE_NODE(node_class, s);
> > 
> > If this is possible than the rest is just a matter of code 
> refactoring.
> > 
> > By vectorizing I mean writing a macro 
> CLASS_GET_FREE_NODE2(node_class, 
> > s, n) which in one go allocates n little objects of class 
> node_class 
> > and "inscribes" them into the elements of vector s, which 
> is assumed 
> > to be long enough to hold these objects.
> > 
> > If this is doable than the only missing piece would be a 
> new function 
> > setChar(CHARSXP rstr, const char * cstr) which copies 
> 'cstr' into 'rstr'
> > and (re)allocates the heap memory if necessary. Here the setChar() 
> > macro is safe since s[i]-s are all brand new and thus are 
> not shared 
> > with any other object.
> 
> I had a similar idea initially, but I don't think it can fly: 
> First, allocating n objects at once is not likely to be much 
> faster than allocating them one-by-one, especially when you 
> consider the implications of having to deal with 
> near-out-of-memory conditions.
> Second, you have to know the string lengths when allocating, 
> since the structure of a vector object (CHARSXP) is a header 
> immediately followed by the data.
> 
> A more interesting line to pursue is that - depending on what 
> it really is that you need - you might be able to create a 
> different kind of object that could "walk and quack" like a 
> character vector, but is stored differently internally. E.g. 
> you could set up a representation that is just a block of 
> pointers, pointing to strings that are being maintained in 
> malloc-style.
> 
> Have a look at External pointers and finalization.
> 
> 
> -- 
>O__   Peter Dalgaard Blegdamsvej 3  
>   c/ /'_ --- Dept. of Biostatistics 2200 Cph. N   
>  (*) \(*) -- University of Copenhagen   Denmark  Ph: 
> (+45) 35327918
> ~~ - ([EMAIL PROTECTED]) FAX: 
> (+45) 35327907
> 
>

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


[R] how to initialize random seed properly ?

2004-06-09 Thread ryszard . czerminski
I want to start R processes on multiple processors from single shell 
script
and I want all of them to have different random seeds.
One way of doing this is

sleep 2 # (with 'sleep 1' I am often getting the same number)
   ...
set.seed(unclass(Sys.time()))

Is there a simpler way without a need to sleep between invoking
different R processes ?

Ryszard

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


[R] direct data frame entry

2004-06-09 Thread ivo welch
hi:  I searched the last 2 hours for a way to enter a data frame 
directly in my program.  (I know how to read from a file.)  that is, I 
would like to say something like

   d <- this.is.a.data.frame(   c("obs1name", 0.2, 0.3),
 c("obs2name", 0.4, 1.0),
 c("obs3name", 0.6, 2.0) , 
varnames=c("name", "val1", "val2")  );

everything I have tried sofar (usually, building with rbind and then 
names(d)) has come out with factors for the numbers, which is obviously 
not what I want.   this must be a pretty elementary request, so it 
should probably be an example under data.frame (or read.table).  of 
course, it is probably somewhere---just I have do not remember it and 
could not find it after 2 hours of searching.  I also tried the r-help 
archives---at the very least, I hope we will get the answer there for 
future lookups.

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


RE: [R] direct data frame entry

2004-06-09 Thread Liaw, Andy
?data.frame says:

Usage:

 data.frame(..., row.names = NULL, check.rows = FALSE, check.names =
TRUE)

Arguments:

 ...: these arguments are of either the form 'value' or
  'tag=value'.  Component names are created based on the tag
  (if present) or the deparsed argument itself.

which means you need to do the `transpose' of what you did: give
data.frame() columns, rather than rows.  E.g.,

dat <- data.frame(x=factor(c("A", "B", "A", "C"), y=1:4,
rownames=LETTERS[1:4])

It's hard to build a data frame by row, because one needs to check and make
sure data in each column are consistent, that data in a factor column have
the right levels, etc.

Andy

> From: ivo welch
> 
> hi:  I searched the last 2 hours for a way to enter a data frame 
> directly in my program.  (I know how to read from a file.)  
> that is, I 
> would like to say something like
> 
> d <- this.is.a.data.frame(   c("obs1name", 0.2, 0.3),
>   c("obs2name", 0.4, 1.0),
>   c("obs3name", 0.6, 2.0) , 
> varnames=c("name", "val1", "val2")  );
> 
> everything I have tried sofar (usually, building with rbind and then 
> names(d)) has come out with factors for the numbers, which is 
> obviously 
> not what I want.   this must be a pretty elementary request, so it 
> should probably be an example under data.frame (or read.table).  of 
> course, it is probably somewhere---just I have do not remember it and 
> could not find it after 2 hours of searching.  I also tried 
> the r-help 
> archives---at the very least, I hope we will get the answer there for 
> future lookups.
> 
> regards, /iaw
> 
> __
> [EMAIL PROTECTED] mailing list
> https://www.stat.math.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! 
> http://www.R-project.org/posting-guide.html
> 
>

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


Re: [R] direct data frame entry

2004-06-09 Thread Tony Plate
easy to do it by column:
> d <- 
data.frame(name=c("obs1name","obs2name","obs3name"),val1=c(0.2,0.4,0.6),val2=c(0.3,1.0,2.0),row.names=c("r1","r2","r3"))
> d
   name val1 val2
r1 obs1name  0.2  0.3
r2 obs2name  0.4  1.0
r3 obs3name  0.6  2.0
>

(when you do it by row, you get the numbers as factors because 
c("obs1name", 0.2, 0.3) etc. are character vectors)

At Wednesday 01:29 PM 6/9/2004, ivo welch wrote:
hi:  I searched the last 2 hours for a way to enter a data frame directly 
in my program.  (I know how to read from a file.)  that is, I would like 
to say something like

   d <- this.is.a.data.frame(   c("obs1name", 0.2, 0.3),
 c("obs2name", 0.4, 1.0),
 c("obs3name", 0.6, 2.0) , 
varnames=c("name", "val1", "val2")  );

everything I have tried sofar (usually, building with rbind and then 
names(d)) has come out with factors for the numbers, which is obviously 
not what I want.   this must be a pretty elementary request, so it should 
probably be an example under data.frame (or read.table).  of course, it is 
probably somewhere---just I have do not remember it and could not find it 
after 2 hours of searching.  I also tried the r-help archives---at the 
very least, I hope we will get the answer there for future lookups.

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


Re: [R] how to initialize random seed properly ?

2004-06-09 Thread A.J. Rossini

For reproducibility, you probably want to specify the starting seeds.
I'd worry about using systime.   (for selecting the seeds, you might
consider random draws from a uniform).

best,
-tony

[EMAIL PROTECTED] writes:

> I want to start R processes on multiple processors from single shell 
> script
> and I want all of them to have different random seeds.
> One way of doing this is
>
> sleep 2 # (with 'sleep 1' I am often getting the same number)
>...
> set.seed(unclass(Sys.time()))
>
> Is there a simpler way without a need to sleep between invoking
> different R processes ?
>
> Ryszard
>
> __
> [EMAIL PROTECTED] mailing list
> https://www.stat.math.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
>

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

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

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


[R] moving data and output?

2004-06-09 Thread Martin Klaffenboeck
Hello,
I have a few questions now:
1.  How can I move data the following way:
I have 2 variables:
one two
1   5  ^
3   4  |
1   3  |
4   4  |
Now I want to move the two one arround (sorry I don't know how to say  
that in english).  That means:  I want to move the first item at the  
end of my column and move the second at the first place, the third at  
the second, and so on.  You can see it at the arrow next to the 'two'  
column.  The colum named 'one' should be as it is.

2. How can I make outputs of the grafics (plot, hist, ...) into a file?
3. Can I make latex output of the grafics (any tool, like texdraw or  
pictex ...)?

4. I know about sink().  But can I format the output for LaTeX, like a  
\begin{tabular} ... \end{tabular} for a dist() matrix or similar?

5. Acording to the other questions, where can I find answers for this  
questions, if I'm not the first one who is asking?

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


Re: [R] direct data frame entry

2004-06-09 Thread ivo welch
thank you, chaps.  ok, so this is not as straightforward as I had 
thought.  perhaps the read.table() function should have the ability to 
read inline (terminated, e.g., by two newlines, or a usersettable 
string), rather than just from a file.  this would be a nice feature.

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


Re: [R] Comparing two pairs of non-normal datasets in R?

2004-06-09 Thread Peter Sebastian Masny
On Wednesday 09 June 2004 08:58 am, Lutz Prechelt wrote:
...
> Does that make sense?
>
>   Lutz


Thanks, everyone, very much for your replies.  I think I'm getting a little 
out of my league with quantile regession estimates and bootstrap tests of 
distribution parameters.  It makes sense, but I'm going to have to invoke 
some local help to make sure I get it right.

Thanks again,

Peter

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


Re: [R] direct data frame entry

2004-06-09 Thread Wolski
Hi Ivo!


https://www.stat.math.ethz.ch/pipermail/r-help/2004-June/050601.html



Sincerely
Eryk

*** REPLY SEPARATOR  ***

On 6/9/2004 at 3:29 PM ivo welch wrote:

>>>hi:  I searched the last 2 hours for a way to enter a data frame 
>>>directly in my program.  (I know how to read from a file.)  that is, I 
>>>would like to say something like
>>>
>>>d <- this.is.a.data.frame(   c("obs1name", 0.2, 0.3),
>>>  c("obs2name", 0.4, 1.0),
>>>  c("obs3name", 0.6, 2.0) , 
>>>varnames=c("name", "val1", "val2")  );
>>>
>>>everything I have tried sofar (usually, building with rbind and then 
>>>names(d)) has come out with factors for the numbers, which is obviously 
>>>not what I want.   this must be a pretty elementary request, so it 
>>>should probably be an example under data.frame (or read.table).  of 
>>>course, it is probably somewhere---just I have do not remember it and 
>>>could not find it after 2 hours of searching.  I also tried the r-help 
>>>archives---at the very least, I hope we will get the answer there for 
>>>future lookups.
>>>
>>>regards, /iaw
>>>
>>>__
>>>[EMAIL PROTECTED] mailing list
>>>https://www.stat.math.ethz.ch/mailman/listinfo/r-help
>>>PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html



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

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


[R] Two-dimensional Kolmogorov-Smirnov test

2004-06-09 Thread Rich Grenyer
Hi - is the 2-D Kolmogorov-Smirnov test of Fasano & Francheschini 
(1987) implemented in any of the R-packages at present? The algorithm 
and code exist in the Numerical Recipes series (e.g. Press et al. 1992) 
but I thought I should check before playing with .C() and dyn.load() 
for the first time...

Thanks in advance,
Rich
Fasano G and Franceschini A 1987 A multi-dimensional version of the 
Kolmorogov–Smirnov test Mon. Not. R. Astron. Soc. 225 155–70
Press W H, Teukolsky S A, Vettering W T and Flannery B P 1992 Numerical 
Recipes in FORTRAN: The Art of Scientific Computing (Cambridge: 
Cambridge University Press) p 640ff


Rich Grenyer, Ph.D.
Biology Department - University of Virginia
Gilmer Hall
Charlottesville, Virginia
VA 22904
United States of America
tel: (+1) 434 982 5629
fax: (+1) 434 982 5626
http://faculty.virginia.edu/gittleman/rich
__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] direct data frame entry

2004-06-09 Thread Gabor Grothendieck
ivo welch  yale.edu> writes:

> thank you, chaps.  ok, so this is not as straightforward as I had 
> thought.  perhaps the read.table() function should have the ability to 
> read inline (terminated, e.g., by two newlines, or a usersettable 
> string), rather than just from a file.  this would be a nice feature.

Have a look at the my.stdin function at:

  https://stat.ethz.ch/pipermail/r-help/2003-June/033622.html

It is intended to be used in a sourced file as shown in the
example there.

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


Re: [R] Help with a Lattice plot that fails with an empty unique combination

2004-06-09 Thread Deepayan Sarkar
On Wednesday 09 June 2004 01:58, Tom Mulholland wrote:
> While using Lattice I received the following error.
>
> Error in if (xx != 0) xx/10 else z/10 : argument is of length zero
> In addition: Warning messages:
> 1: is.na() applied to non-(list or vector) in: is.na(x)
> 2: is.na() applied to non-(list or vector) in: is.na(x)
> 3: no finite arguments to min; returning Inf
> 4: no finite arguments to max; returning -Inf
> 5: NaNs produced in: log(x, base)
> Can anyone point me in the right direction.

A traceback() shows that this is happening due to jitter() being called 
with a length-0 numeric. I have added a check in panel.stripplot. Until 
the next release, you can work around it by:


assignInNamespace("panel.stripplot", 
function(x, y, jitter.data = FALSE, factor = 0.5,
 horizontal = TRUE, groups = NULL, ...)
{
if (length(x) < 1) return()
x <- as.numeric(x)
y <- as.numeric(y)
y.jitter  <-
if (horizontal && jitter.data) 
jitter(y, factor = factor) else y
x.jitter  <-
if (!horizontal && jitter.data) 
jitter(x, factor = factor) else x
if (is.null(groups)) panel.xyplot(x = x.jitter, 
y = y.jitter, ...) else 
panel.superpose(x = x.jitter, y = y.jitter, 
groups = groups, ...)
}, "lattice")


Deepayan

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


Re: [R] bar plot patterns

2004-06-09 Thread Paul Murrell
Hi
Osman wrote:
> Thank you for your answer. I have about 7 stacks it is not very
> appealing to have just stripes with changing angles. I was wondering
> if there is a way to have varying patters in black and white.
R graphics is inherently vector-based;  there is no native support for 
bitmaps so bitmap fill patterns are not really an option.  (There is the 
pixmap package for drawing bitmaps as a rectangle per pixel)

Of course, it is possible to do vector fill patterns, but again there is 
little convenient support for this sort of thing currently.  The code 
below shows one way that this sort of thing could be done.  It might be 
a useful starting point if your barplot is a one-off.

Paul
### R code ###
library(grid)
gridLocns <- function(sep=unit(0.25, "inches"),
  startx=0.5*runif(1)*sep,
  starty=0.5*runif(1)*vshift) {
  # hshift and vshift between rows of dots
  # Only really makes sense if sep is "absolute"
  if (round(convertWidth(sep, "inches", valueOnly=TRUE) -
convertHeight(sep, "inches", valueOnly=TRUE), 5) > 0)
stop("sep must be absolute")
  hshift <- sep*cos(pi*60/180)
  vshift <- sep*sin(pi*60/180)
  # How many sep steps to take in each direction in
  # order to guarantee to fill current viewport?
  nsepx <- 1/convertWidth(sep, "npc", valueOnly=TRUE) + 2
  nsepy <- 1/convertHeight(hshift, "npc", valueOnly=TRUE) + 2
  list(x=startx + rep(1:nsepx - 2, nsepy)*sep +
   rep(rep(0:1, each=nsepx), nsepy/2)*hshift,
   y=starty + rep(1:nsepy - 2, each=nsepx)*vshift)
}
dotFill <- function(size=unit(2, "mm"),
sep=unit(0.25, "inches")) {
  locns <- gridLocns(sep)
  grid.circle(locns$x, locns$y, 0.5*size, gp=gpar(fill="black"))
}
charFill <- function(char="+",
 sep=unit(0.25, "inches")) {
  locns <- gridLocns(sep)
  grid.text(char, locns$x, locns$y, gp=gpar(fontsize=20))
}
N <- 6
counts <- runif(N)
fill <- c(dotFill, charFill)
pushViewport(plotViewport(c(5,4,4,2)))
pushViewport(viewport(xscale=c(0, N+1), yscale=c(0, max(counts)*1.1)))
# Draw a filled bar for each count
for (i in 1:N) {
  pushViewport(viewport(x=i, y=0, height=counts[i], width=0.5,
default.units="native",
just=c("centre", "bottom"),
clip=TRUE))
  fill[[i %% length(fill) + 1]]()
  grid.rect()
  popViewport()
}
grid.xaxis(at=1:N)
grid.yaxis()
grid.rect()
popViewport(2)
### R code ###
> Osman - Original Message - From: Petr Pikal To: Osman Cc:
> [EMAIL PROTECTED] Sent: Monday, May 31, 2004 5:01 AM Subject:
> Re: [R] bar plot patterns
>
>
>
>
>
>
> On 29 May 2004 at 16:54, Osman wrote:
>
>
>> Dear R users,
>>
>> Is there a package or function that can produce multiple fill
>> patterns to be used instead of colors in barplots or pie charts?
>> Shades of grey are difficult to differentiate if more than 3 to 5..
>>
>
>
> Hi
>
>
> This is what help page says about colours and shading lines
>
>
> density: a vector giving the density of shading lines, in lines per
> inch, for the bars or bar components. The default value of 'NULL'
> means that no shading lines are drawn. Non-positive values of
> 'density' also inhibit the drawing of shading lines.
>
>
> angle: the slope of shading lines, given as an angle in degrees
> (counter-clockwise), for the bars or bar components.
>
>
> col: a vector of colors for the bars or bar components.
>
>
>
>
>
>
> Do you want something else than
>
>
> barplot(1:3, col=c(2,3,3),density=c(2,4,6), angle=c(30,60,90))
>
>
> Cheers Petr
>
>
>>
>> Osman [[alternative HTML version deleted]]
>>
>> __
>> [EMAIL PROTECTED] mailing list
>> https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do
>> read the posting guide! http://www.R-project.org/posting-guide.html
>>
>
>
>
>
> Petr Pikal [EMAIL PROTECTED] [[alternative HTML version
> deleted]]
>
> __
> [EMAIL PROTECTED] mailing list
> https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read
> the posting guide! http://www.R-project.org/posting-guide.html
--
Dr Paul Murrell
Department of Statistics
The University of Auckland
Private Bag 92019
Auckland
New Zealand
64 9 3737599 x85392
[EMAIL PROTECTED]
http://www.stat.auckland.ac.nz/~paul/
__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] Specifying xlevels in effects library

2004-06-09 Thread David J. Netherway
Andy and John,
I looked at typical when xlevels did not work but when I saw that it was 
a function I went no further. Setting the function to a constant was a 
good idea.
John's method seems to require that I change the model:

> eff <-effect("sex*age",mod,xlevel=(Age=c(120,120)))
Error in all(!(factors[, term1] & (!factors[, term2]))) : 
   subscript out of bounds
In addition: Warning message: 
sex:age does not appear in the model in: effect("sex*age", mod, xlevel = 
(age = c(120, 120))) 

Andy's method works as suggested for this simple case.
Thanks for your time.
Cheers, David
__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] Getting Pr from Summary(lm)

2004-06-09 Thread David J. Netherway
Thanks for all the relies.
I recently discovered "names" and applied it to "lm" objects but did not 
think to apply it to the "summary" object.

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


RE: [R] Specifying xlevels in effects library

2004-06-09 Thread John Fox
Dear David,

You don't have to change the model, but you do have to name the variable age
(or Age) consistently, and give a list as the xlevels argument. Hence, if
the variable names are really lower-case:   eff <- effect("sex*age", mod,
xlevels=list(age=c(120,120))).

Regards,
 John

> -Original Message-
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On Behalf Of David 
> J. Netherway
> Sent: Wednesday, June 09, 2004 8:27 PM
> To: [EMAIL PROTECTED]
> Subject: Re: [R] Specifying xlevels in effects library
> 
> Andy and John,
> 
> I looked at typical when xlevels did not work but when I saw 
> that it was a function I went no further. Setting the 
> function to a constant was a good idea.
> John's method seems to require that I change the model:
> 
>  > eff <-effect("sex*age",mod,xlevel=(Age=c(120,120)))
> Error in all(!(factors[, term1] & (!factors[, term2]))) : 
> subscript out of bounds
> In addition: Warning message: 
> sex:age does not appear in the model in: effect("sex*age", 
> mod, xlevel = (age = c(120, 120))) 
> 
> Andy's method works as suggested for this simple case.
> 
> Thanks for your time.
> 
> Cheers, David
> 
> __
> [EMAIL PROTECTED] mailing list
> https://www.stat.math.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! 
> http://www.R-project.org/posting-guide.html

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


RE: [R] Specifying xlevels in effects library [2]

2004-06-09 Thread John Fox
Dear David,

An addendum: Looking at my original posting, I see that failing to specify a
list as the xlevels argument was my error.

Sorry,
 John

> -Original Message-
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On Behalf Of David 
> J. Netherway
> Sent: Wednesday, June 09, 2004 8:27 PM
> To: [EMAIL PROTECTED]
> Subject: Re: [R] Specifying xlevels in effects library
> 
> Andy and John,
> 
> I looked at typical when xlevels did not work but when I saw 
> that it was a function I went no further. Setting the 
> function to a constant was a good idea.
> John's method seems to require that I change the model:
> 
>  > eff <-effect("sex*age",mod,xlevel=(Age=c(120,120)))
> Error in all(!(factors[, term1] & (!factors[, term2]))) : 
> subscript out of bounds
> In addition: Warning message: 
> sex:age does not appear in the model in: effect("sex*age", 
> mod, xlevel = (age = c(120, 120))) 
> 
> Andy's method works as suggested for this simple case.
> 
> Thanks for your time.
> 
> Cheers, David
> 
> __
> [EMAIL PROTECTED] mailing list
> https://www.stat.math.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! 
> http://www.R-project.org/posting-guide.html

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


Re: [R] X-12-ARIMA

2004-06-09 Thread Alistair Gray
Dear All,
I've used the X-12-ARIMA or its earlier versions from S+ and R under both Unix 
and Windows platforms for many years using the klugey approach of calling an 
executable using in R the system function.  I've found this serviceable  for the 
following reasons.

1) Paul Gilbert's hunch is correct that many of the subroutines have extensive 
IO calls (especially the X-11 engine) and so it is not straightfoward to call 
using .Fortran.

2) X-12-ARIMA has in the Unix final version 0.2.10 which I use 15 different 
commands with their own parameters covering about six pages of description so 
it's not clear to me having a long R function parameter list is a great advantage.

My experience with people who have ported X-12-ARIMA into other econometrics 
software is that they port a limited range of the commands and options. (I'd be 
interested to know from Dirk Eddelbuettel if this is the case for GNU-Gretl.)

3) X-12_ARIMA through its specification files (particularly the metafiles) is 
set up to handle multiple runs on different time series with different parameter 
settings. I'm not sure I'd want to re-invent it. Secondly I find it an OK way to 
keep track of what I've done.

However, I'd be a grateful user of a less klugey approach.
Below is a clearer explanation of my klugey approach and functions which I've 
used successfully. Feel free to use them.

# create data file for the series to be read by  x12 fortran pgm
# blp is a object of class ts written to file blp.dat in the x12 datevalue
# format
writex12in(blp,"blp")
# create the specification file using your favourite editor say blp.spc to be
# read by x12 fortran pgm
# a vanilla specification file might have the following
# series{
#   title="building consents"
#   start=1973.01
#   span=(1973.01, 2000.12) 
#   period=12
#   file="blp.dat"
#   format="datevalue"
# }
# x11{
#   mode=mult
#   sigmalim=(1.8 2.8)
#   seasonalma=x11default
#   trendma=13
#   appendfcst=no
#   save=(b1 c17 d10 d11 d12 d13)
#   savelog=(m1 m2 m3 m4 m5 m6 m7 m8 m9 m10 m11 q q2 msr icr fb1 fd8 msf ids)
# }
# execute the  x12 fortran pgm. executable x12a stored in /home/fred/x12a
system("/home/fred/x12a/x12a blp")
# read  x12 fortran pgm output tables back into R
blp.x12 <- readx12out("blp", adtype="M", calendar=F, tblnames=NULL)
# basic versions of writex12in  and readx12out
writex12in <- function(tso,file){
  write.table(cbind(time(tso) %/% 1, cycle(tso), tso),
  file=paste(file,".dat",sep=""),
  sep=" ", quote=F, row.names=F, col.names=F)
}
readx12out <- function(file, adtype = "M", calendar = F, tblnames = NULL) {
	notbls <- 6 + (calendar != F) + length(tblnames)
	comp <- vector("list", notbls)
	if(calendar == F) {
		names(comp) <- c("original", "seasonal", "adjusted", "trend",
 "irregular", "weights", tblnames)
		tblnames <- c("b1", "d10", "d11", "d12", "d13", "c17", tblnames)
	}
	else {
		names(comp) <- c("original", "seasonal", "adjusted", "trend",
 "irregular", "calendar", "weights", tblnames)
		if(calendar == "C")
			tblnames <- c("b1", "d10", "d11", "d12", "d13", "xca", "c17",
tblnames)
		else tblnames <- c("b1", "d10", "d11", "d12", "d13", "c16", "c17",
tblnames)
	}
	for(i in seq(along = comp)) {
		series <- read.table(paste(file, ".", tblnames[i], sep = ""),
			as.is = T, skip = 2)
times <- series[,1]
begin <- c(times[1]%/%100,times[1]%%100)
freq <- max(times%%100)
		comp[[i]] <- ts(data = series[,2], start = begin, frequency = freq)
	}
# for the log transform the adjusted series is the log of the original
# also x12 transforms trend, seasonal, etc back into original scale
# i.e. making a multiplicative decomposition in which case 1.0 needs to be
# subtracted from seasonal, irregular and calendar to be consistent with
# multiplicative. Also x12 makes correction for bias to trend in original scale
# so best to treat as multiplicative decomposition rather than decomposition in
# transformed scale
	if(adtype == "L") {
		comp$transformed <- comp$original
		comp$seasonal <- comp$seasonal - 1
		comp$irregular <- comp$irregular - 1
		if(calendar != F)
			comp$calendar <- comp$calendar - 1
		comp$power <- "log additive presented as multiplicative. 1.0 has been 
subtracted from seasonal, irregular & calendar (if present)"
	}
	else if(adtype == "M") {
		comp$transformed <- comp$original
		comp$seasonal <- comp$seasonal - 1
		comp$irregular <- comp$irregular - 1
		if(calendar != F)
			comp$calendar <- comp$calendar - 1
		comp$power <- "multiplicative. 1.0 has been subtracted from seasonal, 
irregular & calendar (if present)"
	}
	else if(adtype == "A") {
		comp$original <- rtso
		comp$power <- "additive"
	}
	return(comp)
}


--
Alistair Gray   Email:  [EMAIL PROTECTED]
Statistics Research Associates Ltd  Web:www.statsresearch.co.nz
PO Box 12 649, Thorndon, Wellington Phone:  +64 +4 972 6531
NEW ZEALAND   

Re: [R] X-12-ARIMA

2004-06-09 Thread Dirk Eddelbuettel

Alistair,

That look like a very good way of getting things done. I had at one point in
the past thought about undertaking a similar approach of dealing with the
input/output files to x12arima from R. 

However, my job priorities changed and I didn't have the need for x12arima
any more.  For the same reason, I never really dug into what gretl does --
you'd need to see for yourself: http://gretl.sourceforge.net/

Regards, Dirk

-- 
FEATURE:  VW Beetle license plate in California

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


Re: [R] moving data and output?

2004-06-09 Thread Jason Turner
> Hello,
>
> I have a few questions now:

Yes.  Since the mail is archived to help other people, in future please
send a small mail for each question, with a descriptive subject line for
each.  This makes it easier for everyone.

> 1.  How can I move data the following way:
>
> I have 2 variables:
>
> one   two
> 1 5  ^
> 3 4  |
> 1 3  |
> 4 4  |
>
> Now I want to move the two one arround (sorry I don't know how to say
> that in english).  That means:  I want to move the first item at the
> end of my column and move the second at the first place, the third at
> the second, and so on.  You can see it at the arrow next to the 'two'
> column.  The colum named 'one' should be as it is.

By using indexing.  If this is a matrix called mymatrix:

mymatrix[,2] <- mymatrix[c(4,1:3),2]

If it's a data frame called mydf:

mydf$two <- mydf$two[c(4,1:3)]



> 2. How can I make outputs of the grafics (plot, hist, ...) into a file?

See the help pages and examples...

?postscript
?Devices
?pdf

> 3. Can I make latex output of the grafics (any tool, like texdraw or
> pictex ...)?

I use either eps or pdf for inclusion into LaTeX.  You also have the fig
file format, so you can use xfig to edit before inclusion.

> 4. I know about sink().  But can I format the output for LaTeX, like a
> \begin{tabular} ... \end{tabular} for a dist() matrix or similar?

Two ways:
1) Install the Hmisc package, and see ?latex
2) Install the xtable package, and see ?xtable.

> 5. Acording to the other questions, where can I find answers for this
> questions, if I'm not the first one who is asking?

1) help.search("some keyword")
2) go to http://cran.r-project.org, and follow the "Search" link to search
the mail archives.

Cheers

Jason

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


Re: [R] Building package on Windows: No rule to make target '-llapack'

2004-06-09 Thread Prof Brian Ripley
On Wed, 9 Jun 2004, Zhu Wang wrote:

> I have a problem to build a package on Windows XP while there is no
> problem on Linux. The Makefile is something like:

There would be a problem on Linux, if that Makefile were used.  I suspect
it is not used.

> ###
> LIBNAME=cts
> 
> PKG_LIBS = $(LAPACK_LIBS) $(BLAS_LIBS) $(FLIBS)

(You should not need $(FLIBS) here.)

> OBJS=file1.o ... file20.o -llapack -lblas

The last two are not objects, and -llapack refers to something like 
liblapack.a.  I don't see how this can work anywhere.  On the other hand, 
you have lapack and blas selected in PKG_LIBS, but you are not using that 
macro.

> $(LIBNAME)$(SHLIB_EXT): $(OBJS)
> $(SHLIB_LD) $(SHLIB_LDFLAGS) -o $@ $(OBJS) $(FLIBS)
> 
> clean:
> @rm -f *.o *.$(SHLIB_EXT)
> 
> realclean: clean
> #
> 
> To build the package on Windows XP, I have followed the instructions to
> install tools/software required and it seems the 'make' worked fine,
> except for the error message:
> 
> make[3]: No rule to make target 'llapack', needed by 'cts.a'. stop.
> 
> Now I think maybe two problems: one is that maybe I do not have Lapack and Blas 
> installed
> on Windows XP and second is that I do not set up a correct file, something like 
> 'configure'.
> Maybe there are more problems. I have read some files in \src\gnuwin32, but I did 
> not find
> what I needed.

What are you actually trying to do?  It is not normal for a package to
have a Makefile in its src directory, which is what I guess (but only
guess) you have presented.  All that is normally needed is a Makevars
file.  Take a look at e.g. that in mclust.

Is this your package or someone else's (in which case why are you not
asking the author)?  Either you or that author needs to read `Writing R 
Extensions' and look at some of the many examples in CRAN packages.

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

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


Re: [R] Re: R equivalent of Splus rowVars function

2004-06-09 Thread Diethelm Wuertz
Rmetrics availalble from www.rmetrics.org has implemented several R 
functions
which deal with column statistics, row statistics and rolling analysis.

Diethelm Wuertz



David Brahm wrote:

>Mark Leeds <[EMAIL PROTECTED]> wrote (to S-News):
>  
>
>>does anyone know the R equivalent of the SPlus rowVars function ?
>>
>>
>
>Andy Liaw <[EMAIL PROTECTED]> replied:
>  
>
>>More seriously, I seem to recall David Brahms at one time had created an R
>>package with these dimensional summary statistics, using C code.  (And I
>>pointed him to the `two-pass' algorithm for variance.)
>>
>>
>
>Here are the functions that didn't make it into R's base package, which should
>be very similar to the S-Plus functions of the same names.  The "twopass"
>argument determines whether Andy's two-pass algorithm (Chan Golub & LeVegue) is
>used (it's slower but more accurate).  In real life I set the "twopass" default
>to FALSE, because in finance noise is always bigger than signal.
>
>I am cc'ing to R-help, as this is really an R question.
>  
>


[[alternative HTML version deleted]]

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


[R] Failure to compile on Itanium

2004-06-09 Thread F. Tusell
I am trying to compile R on an Itanium machine running Red Hat 7.2 and 
gcc version 2.96.
The build fails with the following symptoms:

g77  -fPIC  -g -O2 -c cmplx.f -o cmplx.lo
g77  -fPIC  -g -O2 -c cmplxblas.f -o cmplxblas.lo
gcc -shared -L/usr/local/lib  -o libRlapack.so dlapack0.lo dlapack1.lo
dlapack2.lo dlapack3.lo cmplx.lo  cmplxblas.lo  -L/usr/local/lib
-L/usr/lib/gcc-lib/ia64-redhat-linux/2.96
-L/usr/lib/gcc-lib/ia64-redhat-linux/2.96/../../.. -lg2c -lm
/usr/bin/ld: open.o: @gprel relocation against dynamic symbol f__buflen
/usr/bin/ld: open.o: @gprel relocation against dynamic symbol f__buflen
/usr/bin/ld: open.o: @gprel relocation against dynamic symbol f__buflen
/usr/bin/ld: open.o: @gprel relocation against dynamic symbol f__buflen
/usr/bin/ld: open.o: @gprel relocation against dynamic symbol f__buflen
/usr/bin/ld: open.o: @gprel relocation against dynamic symbol f__buflen
collect2: ld returned 1 exit status
make[4]: *** [libRlapack.so] Error 1
make[4]: Leaving directory `/home/etptupaf/R-1.9.0/src/modules/lapack'
make[3]: *** [R] Error 2
make[3]: Leaving directory `/home/etptupaf/R-1.9.0/src/modules/lapack'
make[2]: *** [R] Error 1
make[2]: Leaving directory `/home/etptupaf/R-1.9.0/src/modules'
make[1]: *** [R] Error 1
make[1]: Leaving directory `/home/etptupaf/R-1.9.0/src'
make: *** [R] Error 1
I searched and found in
 _http://tolstoy.newcastle.edu.au/R/devel/04a/0679.html_
an answer from BD Ripley to a query with exactly the same problem, 
suggesting that a newer
version of gcc be used.

This solution is out of reach for me, as the system managers are not 
willing to undertake
any changes. They suggest instead that I use the "recommended" compilers,
ecc and ecf. I have tried to do so with no success so far: the  
configure script fails to find
convenient values for the different flags to be set. I have set some 
manually (in config.site),
to no avail so far. Has anyone compiled R with ecc and ecf? Or with 
gcc-2.96? I would be
grateful if he/she could share his/her config.site settings. Best, ft.

--
Fernando TUSELLe-mail:
Departamento de Econometría y Estadística   [EMAIL PROTECTED] 
Facultad de CC.EE. y Empresariales Tel:   (+34)94.601.3733
Avenida Lendakari Aguirre, 83  Fax:   (+34)94.601.3754
E-48015 BILBAO  (Spain)Secr:  (+34)94.601.3740

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


  1   2   >