[R] How to intepret a factor response model?

2005-05-04 Thread Maciej Bliziński
Hello,

I'd like to create a model with a factor-type response variable. This is
an example:

> mydata <- data.frame(factor_var = as.factor(c(rep('one', 100), rep('two', 
> 100), rep('three', 100))), real_var = c(rnorm(150), rnorm(150) + 5))
> summary(mydata)
 factor_var real_var
 one  :100   Min.   :-2.742877  
 three:100   1st Qu.:-0.009493  
 two  :100   Median : 2.361669  
 Mean   : 2.490411  
 3rd Qu.: 4.822394  
 Max.   : 6.924588  
> mymodel = glm(factor_var ~ real_var, family = 'binomial', data = mydata)
> summary(mymodel)

Call:
glm(formula = factor_var ~ real_var, family = "binomial", data = mydata)

Deviance Residuals: 
Min   1Q   Median   3Q  Max  
-1.7442  -0.6774   0.1849   0.3133   2.1187  

Coefficients:
Estimate Std. Error z value Pr(>|z|)
(Intercept)  -0.6798 0.1882  -3.613 0.000303 ***
real_var  0.8971 0.1066   8.417  < 2e-16 ***
---
Signif. codes:  0 `***' 0.001 `**' 0.01 `*' 0.05 `.' 0.1 ` ' 1 

(Dispersion parameter for binomial family taken to be 1)

Null deviance: 381.91  on 299  degrees of freedom
Residual deviance: 213.31  on 298  degrees of freedom
AIC: 217.31

Number of Fisher Scoring iterations: 6

-

For models with real-type response variable it's easy to figure out,
what's the equation for the response variable (in the model). But here
- how do I interpret the model?

-- 
God made the world in six days, and was arrested on the seventh.

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


[R] lmer error:flist must be a non-empty list

2005-05-04 Thread Margaret Gardiner-Garden
Hi,

I was wondering if anyone could give me advice regarding using the lmer
command in lme4 package to do logistic regression (mixed effects model).

I use the following command
lmer(ISH ~ArrayPathology2, random=~1|PatientID, data=HSDB4.noNA,
family="binomial")

where ISH is outcome(0 or 1), ArrayPathology2 is the variable of
interest(factor), PatientID is random effect(factor), and HSDB4.noNA is the
complete dataframe (column names ArrayPathology2, Patient ID and ISH etc)

There are no NAs in the data.

I get the following error regardless of the R version (2.0.1, 2.1.0, or
2.1.0devel)

> lmer(ISH ~ArrayPathology2, random=~1|PatientID, data=HSDB4.noNA,
family="binomial")
Error in lmer(ISH ~ ArrayPathology2, random = ~1 | PatientID, data =
HSDB4.noNA,  :
flist must be a non-empty list

Below is the sessionInfo() for R version 2.1.0

R version 2.1.0, 2005-04-18, i386-pc-mingw32

attached base packages:
[1] "methods"   "stats" "graphics"  "grDevices" "utils" "datasets"
[7] "base"

other attached packages:
lme4 latticeExtra  lattice   Matrix
"0.95-6"  "0.1-3" "0.11-6" "0.95-7"

I got the same error if I used the older version of lme4  "0.95-1" which was
mentioned in a mail to this list serve on 11th April 2005

I am using Microsoft Windows XP Professional Version 2002.

I would really appreciate any advice!!

Thanks so much

Dr Margaret Gardiner-Garden
Garvan Institute of Medical Research
Sydney Australia

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


Re: [R] lmer error:flist must be a non-empty list

2005-05-04 Thread Dimitris Rizopoulos
Hi Margaret,
if you look at the help page of lmer() you'll see that there is no 
'random' argument (as there is in lme() in the nlme package). The way 
to specify random-effects structure in lmer() is through the 'formula' 
argument. So in your case try this:

lmer(ISH ~ ArrayPathology2 + (1|PatientID), data=HSDB4.noNA, 
family="binomial")

I hope it helps.
Best,
Dimitris

Dimitris Rizopoulos
Ph.D. Student
Biostatistical Centre
School of Public Health
Catholic University of Leuven
Address: Kapucijnenvoer 35, Leuven, Belgium
Tel: +32/16/336899
Fax: +32/16/337015
Web: http://www.med.kuleuven.ac.be/biostat/
http://www.student.kuleuven.ac.be/~m0390867/dimitris.htm

- Original Message - 
From: "Margaret Gardiner-Garden" <[EMAIL PROTECTED]>
To: 
Sent: Wednesday, May 04, 2005 9:38 AM
Subject: [R] lmer error:flist must be a non-empty list


Hi,
I was wondering if anyone could give me advice regarding using the 
lmer
command in lme4 package to do logistic regression (mixed effects 
model).

I use the following command
lmer(ISH ~ArrayPathology2, random=~1|PatientID, data=HSDB4.noNA,
family="binomial")
where ISH is outcome(0 or 1), ArrayPathology2 is the variable of
interest(factor), PatientID is random effect(factor), and HSDB4.noNA 
is the
complete dataframe (column names ArrayPathology2, Patient ID and ISH 
etc)

There are no NAs in the data.
I get the following error regardless of the R version (2.0.1, 2.1.0, 
or
2.1.0devel)

lmer(ISH ~ArrayPathology2, random=~1|PatientID, data=HSDB4.noNA,
family="binomial")
Error in lmer(ISH ~ ArrayPathology2, random = ~1 | PatientID, data =
HSDB4.noNA,  :
   flist must be a non-empty list
Below is the sessionInfo() for R version 2.1.0
R version 2.1.0, 2005-04-18, i386-pc-mingw32
attached base packages:
[1] "methods"   "stats" "graphics"  "grDevices" "utils" 
"datasets"
[7] "base"

other attached packages:
   lme4 latticeExtra  lattice   Matrix
   "0.95-6"  "0.1-3" "0.11-6" "0.95-7"
I got the same error if I used the older version of lme4  "0.95-1" 
which was
mentioned in a mail to this list serve on 11th April 2005

I am using Microsoft Windows XP Professional Version 2002.
I would really appreciate any advice!!
Thanks so much
Dr Margaret Gardiner-Garden
Garvan Institute of Medical Research
Sydney Australia
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! 
http://www.R-project.org/posting-guide.html

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


Re: [R] (no subject)

2005-05-04 Thread Cuvelier Etienne

At 16:52 3/05/2005 -0300, rene.raupp wrote:
>Does anybory knows any work comparing R with other (charged) statistical 
>softwares (like Minitab, SPSS, SAS)?
>I work in a brasilian government bureau and I intend to use R as our 
>preferable statistical software, but I have to show it's as good as the 
>others. I also intend to use Weka, and for this one I have the same problem.
>Can anyone help me?

The results of a Benchmark test of various number crunching packages  (R 1.9.0, 
S-PLUS 6.1,  Matlab 6.0, O-Matrix 5.6 Ml mode, 
O-Matrix 5.6 native, Octave 2.1.42, Scilab 2.7, Ox 3.30) can be found at :
http://www.sciviews.org/benchmark/index.html


>Thanks
>René M. Raupp
>e-mail: [EMAIL PROTECTED]
>[EMAIL PROTECTED]
>
>[[alternative HTML version deleted]]
>
>__
>R-help@stat.math.ethz.ch mailing list
>https://stat.ethz.ch/mailman/listinfo/r-help
>PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

Cuvelier Etienne
Assistant
FUNDP - Institut d'Informatique
rue Grandgagnage, 21   B-5000 Namur (Belgique)
tel: 32.81.72.49.93fax: 32.81.72.49.67

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


[R] loading gap package

2005-05-04 Thread Eduwin Pakpahan
Dear R users, 
I did install R. 2.0.1, and try to load "gap" package. 
However, below is the message shown when I did load it. Can anybody
please let me know my mistakes?


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


Thanks,

Edwin

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


RE: [R] How to intepret a factor response model?

2005-05-04 Thread Ted Harding
On 04-May-05 Maciej Bliziñski wrote:
> Hello,
> 
> I'd like to create a model with a factor-type response variable.
> This is an example:
> 
>> mydata <- data.frame(factor_var = as.factor(c(rep('one', 100),
>> rep('two', 100), rep('three', 100))), real_var = c(rnorm(150),
>> rnorm(150) + 5))
>> summary(mydata)
>  factor_var real_var
>  one  :100   Min.   :-2.742877  
>  three:100   1st Qu.:-0.009493  
>  two  :100   Median : 2.361669  
>  Mean   : 2.490411  
>  3rd Qu.: 4.822394  
>  Max.   : 6.924588  
>> mymodel = glm(factor_var ~ real_var, family = 'binomial', data =
>> mydata)
>> summary(mymodel)
> 
> Call:
> glm(formula = factor_var ~ real_var, family = "binomial", data =
> mydata)
> 
> Deviance Residuals: 
> Min   1Q   Median   3Q  Max  
> -1.7442  -0.6774   0.1849   0.3133   2.1187  
> 
> Coefficients:
> Estimate Std. Error z value Pr(>|z|)
> (Intercept)  -0.6798 0.1882  -3.613 0.000303 ***
> real_var  0.8971 0.1066   8.417  < 2e-16 ***
> ---
> Signif. codes:  0 `***' 0.001 `**' 0.01 `*' 0.05 `.' 0.1 ` ' 1 
> 
> (Dispersion parameter for binomial family taken to be 1)
> 
> Null deviance: 381.91  on 299  degrees of freedom
> Residual deviance: 213.31  on 298  degrees of freedom
> AIC: 217.31
> 
> Number of Fisher Scoring iterations: 6

Have you noticed that you get identical results with

set.seed(214354)
mydata <- data.frame(factor.var = as.factor(c(rep('one', 100),
   rep('two',100), rep('three', 100))),
   real.var = c(rnorm(150), rnorm(150) + 5))

mymodel <- glm(factor.var ~ real.var, family='binomial', data=mydata)
summary(mymodel)

and

set.seed(214354)
mydata <- data.frame(factor.var = as.factor(c(rep('one', 100),
   rep('two',200))),real.var = c(rnorm(150),rnorm(150) + 5))

mymodel <- glm(factor.var ~ real.var, family='binomial', data=mydata)
summary(mymodel)

(I've left out the "summary(mydata)" since these do naturally
differ, and I've replaced "factor_var" with "factor.var" and
"real_var" with "real.var" because of potential complications
with "_"; also "mymodel =" to "mymodel <-").

So I think the interpretation of the results from your first
model is that, because of the "family='binomial'", glm is
treating "factor.var='one'" as binomial response "0", say,
and "factor.var='two'" or "factor.var='three'" as binomial
response "1".

You're trying to fit a multinomial response, but you've
specified a binomial family to 'glm'. 'glm' does not have
a multinomial response family.

You could try 'multinom' from package 'nnet' which fits
loglinear models to factor responses with more than 2 levels.

E.g.

  library(nnet)
  mymodel <- multinom(factor.var ~ real.var,data=mydata)
   ### weights:  9 (4 variable)
   ##  initial  value 329.583687 
   ##  iter  10 value 209.780666
   ##  final  value 209.779951 
   ##  converged
  summary(mymodel)
   ## Re-fitting to get Hessian
   ## Call:
   ## multinom(formula = factor.var ~ real.var, data = mydata)
   ##  Coefficients:
   ##(Intercept)  real.var
   ##  three  -3.4262565 1.3838231
   ##  two-0.6754253 0.7116955
   ##
   ## Std. Errors:
   ##   (Intercept)  real.var
   ## three   0.5028541 0.1480138
   ## two 0.1846827 0.1068821
   ##
   ## Residual Deviance: 419.5599 
   ## AIC: 427.5599 
   ##
   ## Correlation of Coefficients:
   ## three:(Intercept) three:real.var two:(Intercept)
   ## three:real.var  -0.7286258  
   ## two:(Intercept)  0.1986995-0.1261034
   ## two:real.var-0.1411377 0.7012481 -0.3285741

This output does suggest a fairly clear interpretation!

Hoping this helps,
Ted.



E-Mail: (Ted Harding) <[EMAIL PROTECTED]>
Fax-to-email: +44 (0)870 094 0861
Date: 04-May-05   Time: 09:18:03
-- XFMail --

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


Re: [R] contributed package source codes

2005-05-04 Thread Duncan Murdoch
mingan wrote:

Is there a way for me to get the source code ( C/C++ or FORTRAN)  for a 
specific  R package ?
The source to contributed packages is in /src/contrib/PACKAGES.html.  You can find your CRAN mirror by 
looking at the CRAN entry in options("repos").  (You may need to call 
chooseCRANmirror() first, if it hasn't already been called.)

The source to base packages is in the R source, also on CRAN.
Duncan Murdoch
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] loading gap package

2005-05-04 Thread Uwe Ligges
Eduwin Pakpahan wrote:
Dear R users, 
I did install R. 2.0.1, and try to load "gap" package. 
However, below is the message shown when I did load it. Can anybody
please let me know my mistakes?


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


Let me read the error message for you:
"There is no package 'gdata'" simply means the package is not there...
So what about installing it?
Hint: it is part of the package bundle "gregmisc".
Uwe Ligges

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


Re: [R] How to intepret a factor response model?

2005-05-04 Thread Prof Brian Ripley
On Wed, 4 May 2005, Maciej [iso-8859-2] BliziDski wrote:
I'd like to create a model with a factor-type response variable. This is
an example:
What you have done here is to fit a logistic regression.  The 
interpretation of that is covered in many good books: for example there 
are plots of the predicted values in MASS4.

I do wonder if that is what you intended, though.  You have fitted a model 
of 'two or three' vs 'one'.  You may have intended a multinomial logistic 
model: again MASS4 has details of such models.

mydata <- data.frame(factor_var = as.factor(c(rep('one', 100), rep('two', 100), 
rep('three', 100))), real_var = c(rnorm(150), rnorm(150) + 5))
summary(mydata)
factor_var real_var
one  :100   Min.   :-2.742877
three:100   1st Qu.:-0.009493
two  :100   Median : 2.361669
Mean   : 2.490411
3rd Qu.: 4.822394
Max.   : 6.924588
mymodel = glm(factor_var ~ real_var, family = 'binomial', data = mydata)
summary(mymodel)
Call:
glm(formula = factor_var ~ real_var, family = "binomial", data = mydata)
Deviance Residuals:
   Min   1Q   Median   3Q  Max
-1.7442  -0.6774   0.1849   0.3133   2.1187
Coefficients:
   Estimate Std. Error z value Pr(>|z|)
(Intercept)  -0.6798 0.1882  -3.613 0.000303 ***
real_var  0.8971 0.1066   8.417  < 2e-16 ***
---
Signif. codes:  0 `***' 0.001 `**' 0.01 `*' 0.05 `.' 0.1 ` ' 1
(Dispersion parameter for binomial family taken to be 1)
   Null deviance: 381.91  on 299  degrees of freedom
Residual deviance: 213.31  on 298  degrees of freedom
AIC: 217.31
Number of Fisher Scoring iterations: 6
-
For models with real-type response variable it's easy to figure out,
what's the equation for the response variable (in the model). But here
- how do I interpret the model?
--
Brian D. Ripley,  [EMAIL PROTECTED]
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford, Tel:  +44 1865 272861 (self)
1 South Parks Road, +44 1865 272866 (PA)
Oxford OX1 3TG, UKFax:  +44 1865 272595
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] contributed package source codes

2005-05-04 Thread Prof Brian Ripley
On Wed, 4 May 2005, Duncan Murdoch wrote:
mingan wrote:

Is there a way for me to get the source code ( C/C++ or FORTRAN)  for a 
specific  R package ?
The source to contributed packages is in /src/contrib/PACKAGES.html.  You can find your CRAN mirror by looking 
at the CRAN entry in options("repos").  (You may need to call 
chooseCRANmirror() first, if it hasn't already been called.)
And in 2.1.0 you can retrieve the source by e.g.
download.packages("AMORE", type="source", destdir="/tmp")
on any platform (MacOS X not tested).
--
Brian D. Ripley,  [EMAIL PROTECTED]
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford, Tel:  +44 1865 272861 (self)
1 South Parks Road, +44 1865 272866 (PA)
Oxford OX1 3TG, UKFax:  +44 1865 272595
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] Converting pc files to unix

2005-05-04 Thread Uwe Ligges
Hai Lin wrote:
Hello R users, 

I have R script files writen in my pc laptop. I encountered problems when I run those files in R in Mac OS X (10.3.5).  

Are there any ways in R that can make .R files executable? 

It should work, at once, given you have not used Windows specific 
commands, hard coded paths etc...

Uwe Ligges

Thanks in advance
Kevin
__

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


Re: [R] loading gap package

2005-05-04 Thread Prof Brian Ripley
On Wed, 4 May 2005, Eduwin Pakpahan wrote:
Dear R users,
I did install R. 2.0.1, and try to load "gap" package.
Did you install the dependencies of that package and their 
dependencies ...

library(help=gap)
...
Depends: MASS, genetics, R (>= 2.0.0)
library(help=genetics)
Depends:   combinat, gdata, MASS
gdata is part of the gregmisc bundle, and
install.packages("gap", dependencies=TRUE)
would have done this for you.

However, below is the message shown when I did load it. Can anybody
please let me know my mistakes?

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

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


Re: [R] loading gap package

2005-05-04 Thread Constantinos Antoniou
On 4 Μαϊ 2005, at 11:35 πμ, Uwe Ligges wrote:
Eduwin Pakpahan wrote:
Dear R users, I did install R. 2.0.1, and try to load "gap" package. 
However, below is the message shown when I did load it. Can anybody
please let me know my mistakes?

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


Let me read the error message for you:
"There is no package 'gdata'" simply means the package is not there...
So what about installing it?
Hint: it is part of the package bundle "gregmisc".
I have a similar problem with R 2.1.0 on Mac OSX 10.3.9.
> library(gregmisc)
Loading required package: gdata
Error: package 'gdata' could not be loaded
In addition: Warning message:
there is no package called 'gdata' in: library(pkg, character.only = 
TRUE, logical = TRUE, lib.loc = lib.loc)

At first I tried getting this gdata from somewhere else, but I could 
not find it (evidence indicated that it is part of the gregmisc, as I 
suspected originally... You email confirms this...)

(For the record, my goal is to get read.xls, which is part (?) of gdata)
Thanks,
Costas


Uwe Ligges

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



--
Constantinos Antoniou, Ph.D.
Massachusetts Institute of Technology
Intelligent Transportation Systems Program
77 Massachusetts Ave., Rm. 1-249, Cambridge, MA 02139
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] Re: nlme: "Deficient rank in gls_loglik" when creating corAR1()

2005-05-04 Thread David Hugh-Jones
I tried that but it didn't make any difference to the output.

David

On 04/05/05, Douglas Bates <[EMAIL PROTECTED]> wrote:
> David Hugh-Jones wrote:
> > Is this a bug? Should I attach a test case?
> 
> Try setting verbose=TRUE in the call to gls first and see if that gives
> you any insight into what is happening.
> 
> >
> > D
> >
> > On 03/05/05, David Hugh-Jones <[EMAIL PROTECTED]> wrote:
> >
> >>I have a bunch of data which is structured by year and US state, so I
> >>have created a nlme groupedData object for it:
> >>
> >>formula(gd2)
> >>DEPVAR ~ YEAR | ABREV
> >>
> >>Now I am trying to run a gls regression on it. I want the error
> >>correlation structure to be AR1 with a different rho for each state,
> >>so I do
> >>
> >>
> >>>mdyn.1.1 = gls(model = DEPVAR ~ BLAH + BLAH, data=gd2, corr=corAR1(form= ~ 
> >>>YEAR | ABREV),na.action=na.omit)
> >>
> >>YEAR and ABREV are always present; DEPVAR is absent for one state.
> >>
> >>I get the following error message:
> >>
> >>Error in logLik.glsStruct(glsSt, glsPars) :
> >>Deficient rank in gls_loglik
> >>
> >>Can anyone enlighten me? The error message goes away if I just do
> >>corAR1(form = ~1), but this is not meaningful for my data.
> >>
> >>Cheers
> >>David
> >>
> >
> >
> > __
> > R-help@stat.math.ethz.ch mailing list
> > https://stat.ethz.ch/mailman/listinfo/r-help
> > PLEASE do read the posting guide! 
> > http://www.R-project.org/posting-guide.html
> 
>

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


Re: [R] (no subject)

2005-05-04 Thread ronggui
On Wed, 04 May 2005 10:22:01 +0200
Cuvelier Etienne <[EMAIL PROTECTED]> wrote:

> 
> At 16:52 3/05/2005 -0300, rene.raupp wrote:
> >Does anybory knows any work comparing R with other (charged) statistical 
> >softwares (like Minitab, SPSS, SAS)?
> >I work in a brasilian government bureau and I intend to use R as our 
> >preferable statistical software, but I have to show it's as good as the 
> >others. I also intend to use Weka, and for this one I have the same problem.
> >Can anyone help me?
> 
> The results of a Benchmark test of various number crunching packages  (R 
> 1.9.0, S-PLUS 6.1,  Matlab 6.0, O-Matrix 5.6 Ml mode, 
> O-Matrix 5.6 native, Octave 2.1.42, Scilab 2.7, Ox 3.30) can be found at :
> http://www.sciviews.org/benchmark/index.html

i can NOT connect with the website .i do not why.anyone else come across this 
problem?


 
> 
> >Thanks
> >René M. Raupp
> >e-mail: [EMAIL PROTECTED]
> >[EMAIL PROTECTED]
> >
> >[[alternative HTML version deleted]]
> >
> >__
> >R-help@stat.math.ethz.ch mailing list
> >https://stat.ethz.ch/mailman/listinfo/r-help
> >PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
> 
> Cuvelier Etienne
> Assistant
> FUNDP - Institut d'Informatique
> rue Grandgagnage, 21   B-5000 Namur (Belgique)
> tel: 32.81.72.49.93fax: 32.81.72.49.67
> 
> __
> R-help@stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

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


Re: [R] Converting pc files to unix

2005-05-04 Thread Constantinos Antoniou
On 4 Μαϊ 2005, at 11:41 πμ, Uwe Ligges wrote:
Hai Lin wrote:
Hello R users, I have R script files writen in my pc laptop. I 
encountered problems when I run those files in R in Mac OS X 
(10.3.5).  Are there any ways in R that can make .R files executable?

It should work, at once, given you have not used Windows specific 
commands, hard coded paths etc...

Uwe Ligges

Hai,
On the mac, try to open the files in a "unixy" editor, such as emacs, 
pico, vi. If your file looks something like this (look for ^M):

first line of R commands^Msecond line of R commands^Metc
then the problem is line endings (that are different between platforms).
To fix this, you can open the file(s) in an editor, e.g. SubEthaEdit 
(free for personal and educational use) and then change the line 
endings (Format->Line endings->Convert to unix line endings..)

Another approach (useful if you want to batch-convert a lot of files) 
is to run a script like this:

 #!/bin/sh
tr '\r' '\n' < $1 >MKTMP001
mv -f MKTMP001 $1
You can save this as a file, e.g. call it stripCtrlM, make it 
executable (chmod +x stripCtrlM) and run it:

stripCtrlM filesWithCtrlM.R
or stripCtrlM *.R to convert all .R files in a directory
Hope this helps,
Costas



Thanks in advance
Kevin
__
	[[alternative HTML version deleted]]
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! 
http://www.R-project.org/posting-guide.html
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! 
http://www.R-project.org/posting-guide.html



--
Constantinos Antoniou, Ph.D.
Massachusetts Institute of Technology
Intelligent Transportation Systems Program
77 Massachusetts Ave., Rm. 1-249, Cambridge, MA 02139
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] loading gap package

2005-05-04 Thread Prof Brian Ripley
On Wed, 4 May 2005, Constantinos Antoniou wrote:
On 4 œ±Ê 2005, at 11:35 À¼, Uwe Ligges wrote:
Eduwin Pakpahan wrote:
Dear R users, I did install R. 2.0.1, and try to load "gap" package. 
However, below is the message shown when I did load it. Can anybody
please let me know my mistakes?

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


Let me read the error message for you:
"There is no package 'gdata'" simply means the package is not there...
So what about installing it?
Hint: it is part of the package bundle "gregmisc".
I have a similar problem with R 2.1.0 on Mac OSX 10.3.9.
library(gregmisc)
Loading required package: gdata
Error: package 'gdata' could not be loaded
In addition: Warning message:
there is no package called 'gdata' in: library(pkg, character.only = TRUE, 
logical = TRUE, lib.loc = lib.loc)

At first I tried getting this gdata from somewhere else, but I could not find 
it (evidence indicated that it is part of the gregmisc, as I suspected 
originally... You email confirms this...)

(For the record, my goal is to get read.xls, which is part (?) of gdata)
The current version of gregmisc is 2.0.6.  That does contain gdata.  It 
looks to me as if the MacOS X binary is broken (2kb) so you will need to 
install from the sources.

I think we have been here before: it seems the MacOS X binary packaging 
does not work for bundles.

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

Re: [R] loading gap package

2005-05-04 Thread Uwe Ligges
Constantinos Antoniou wrote:
On 4 Μαϊ 2005, at 11:35 πμ, Uwe Ligges wrote:
Eduwin Pakpahan wrote:
Dear R users, I did install R. 2.0.1, and try to load "gap" package. 
However, below is the message shown when I did load it. Can anybody
please let me know my mistakes?


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


Let me read the error message for you:
"There is no package 'gdata'" simply means the package is not there...
So what about installing it?
Hint: it is part of the package bundle "gregmisc".
I have a similar problem with R 2.1.0 on Mac OSX 10.3.9.
 > library(gregmisc)
Loading required package: gdata
Error: package 'gdata' could not be loaded
In addition: Warning message:
there is no package called 'gdata' in: library(pkg, character.only = 
TRUE, logical = TRUE, lib.loc = lib.loc)

At first I tried getting this gdata from somewhere else, but I could not 
find it (evidence indicated that it is part of the gregmisc, as I 
suspected originally... You email confirms this...)

(For the record, my goal is to get read.xls, which is part (?) of gdata)

Please check whether your gregmisc installation is up to date (version 
2.0.6).
Please reinstall and try again. Works perfectly for me.

Uwe Ligges

Thanks,
Costas


Uwe Ligges

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

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



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


[R] its package: inexplicable date-shifting

2005-05-04 Thread stefan . albrecht





please see also my posting on R-sig-finance
https://stat.ethz.ch/pipermail/r-sig-finance/2005q2/000290.html

Best regards,

Stefan

---
Dr. Stefan Albrecht, CFA
Allianz Private Equity Partners GmbH
Giselastraße 4
D-80802 Munich, Germany
Phone: +49.89.38 00 - 18 317
Fax: +49.89.38 00 - 818 317
[EMAIL PROTECTED]
www.apep.com
[[alternative HTML version deleted]]

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


Re: [R] How to intepret a factor response model?

2005-05-04 Thread Maciej Bliziński
Thanks a lot for the answers (prof Ripley and Ted).

I'm trying to analyze a survey. Most of the variables are of factor
type, with values for example {"no_at_all", "a_little", "mostly",
"a_lot"}.

I thought about mapping those answers to numbers, but I didn't know what
numbers should I assign them to: {1, 2, 3, 4} (linear) or maybe
{1, 2, 4, 8} (exponential)? So I rather tried to analyze the original
factor survey data.

Multinomial factor response wasn't covered in the lectures in my school
so I'm trying to use my intuition and trial/error technique (please
forgive me :-) ).

Prof Brian Ripley wrote:
> I do wonder if that is what you intended, though.

I'd like to find possible correlations between factors in my survey. The
survey is about allergies and I'd like to find out if there is
correlation between the degree of allergic problems and the breast milk
(and artificial milk) feeding of the person as a child.

> You have fitted a model of 'two or three' vs 'one'.  You may have
> intended a multinomial logistic model: again MASS4 has details of such
> models.

I'll go on reading, the "fullrefman.pdf" file.

Regards,
Maciej Blizinski
Danmarks Tekniske Universitet

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


[R] lme versus proc mixed in SAS

2005-05-04 Thread Beatrijs Moerkerke
Dear all,
I am trying to simulate the null distribution for the likelihood ratio 
test statistic for testing 1 random effect versus no random effect.  The 
asymptotic null distribution should be a mixture of a chi-squared 
distribution with 0 degrees of freedom and a chi-squared distribution 
with 1 degree of freedom.  This means that I expect a point mass of 50% 
on 0 for the likelihood ratio test statistic.
However, when I generate data using no random effects and when I 
calculate the test statistics for these data, I never obtain exactly 
zero.  I think this might be due to rounding errors but in fact, 70% of 
the calculated test statistics are negative.  I have compared a few of 
these results with the results in proc MIXED and I found that SAS does 
give test statistics that are exactly zero and gives no negative results.

The code I use for calculating the likelihood ratio test statistics is 
as follows:

a1<-summary(lme(y~x,random=~1|gr,method="ML"))$logLik
a2<-logLik(lm(y~x))
(-2*(a2-a1))
I don't know how I can simulate the null distribution in R using lme.
Thanks for your help,
Kind regards,
Beatrijs Moerkerke
--
Beatrijs Moerkerke
Department of Applied Mathematics and Computer Science
Ghent University
Krijgslaan 281 - S9
B-9000 GENT
Tel: +32-(0)9-264.47.56  Fax: +32-(0)9-264.49.95
E-mail: [EMAIL PROTECTED]
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] loading gap package

2005-05-04 Thread Constantinos Antoniou
On 4 ÎÎÏ 2005, at 12:06 ÎÎ, Prof Brian Ripley wrote:
On Wed, 4 May 2005, Constantinos Antoniou wrote:
On 4 ÅÂÃ 2005, at 11:35 ÃÂ, Uwe Ligges wrote:
Eduwin Pakpahan wrote:
Dear R users, I did install R. 2.0.1, and try to load "gap" 
package. However, below is the message shown when I did load it. 
Can anybody
please let me know my mistakes?

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

Let me read the error message for you:
"There is no package 'gdata'" simply means the package is not 
there...
So what about installing it?
Hint: it is part of the package bundle "gregmisc".
I have a similar problem with R 2.1.0 on Mac OSX 10.3.9.
library(gregmisc)
Loading required package: gdata
Error: package 'gdata' could not be loaded
In addition: Warning message:
there is no package called 'gdata' in: library(pkg, character.only = 
TRUE, logical = TRUE, lib.loc = lib.loc)

At first I tried getting this gdata from somewhere else, but I could 
not find it (evidence indicated that it is part of the gregmisc, as I 
suspected originally... You email confirms this...)

(For the record, my goal is to get read.xls, which is part (?) of 
gdata)
The current version of gregmisc is 2.0.6.  That does contain gdata.  
It looks to me as if the MacOS X binary is broken (2kb) so you will 
need to install from the sources.

Thank you. I had the current  version (binary). Reinstalling from 
source fixed the issue

Costas
I think we have been here before: it seems the MacOS X binary 
packaging does not work for bundles.

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


[R] segmentation fault using hdf5load() under Unix

2005-05-04 Thread schuurmans
Dear R-users,

I'm experiencing a segmentation fault when using
hdf5load(file,load=FALSE). Library(hdf5) loads without problems but when
loading a file, R crashes. I compiled R under Unix (Solaris for Sun).
There is nothing wrong with the files, as I can run the same script at
another place where R runs under Linux.

Is it possible it has something to do with the hdf5 libraries where
package(hdf5) refers to?

Regards,

Hanneke


-- 
ir. J.M. (Hanneke) Schuurmans
PhD student hydrology
Faculty of Geosciences
Department of Physical Geography
Heidelberglaan 2
Postbus 80115
3508 TC  Utrecht
The Netherlands
T +31 (0)30 2532988
F +31 (0)30 2531145
E [EMAIL PROTECTED]

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


[R] question about spectral analysis

2005-05-04 Thread lin yang
First question, following the command model<-spec.pgram(outcome, taper=0, 
fast=F), does model$spec return spectrum densities? I found the outputs are 
quite different from SPSS, although the frequencies are identical. 

Second, is there any command available in R for Fisher's test? How to compute 
the periodogram intensity?

thanks for your help
[[alternative HTML version deleted]]

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


[R] Imputation

2005-05-04 Thread Ramesh Kolluru
  
I have timeseries data for some factors, and some missing values are there in 
those factors, I want impute those missing values without disturbing the 
distribution of that factor, and maintaining the correlation with other 
factors. Pl. suggest me some imputation methods.
I tried some functions in R like aregImpute, transcan. After the imputation I 
am unable to retrive the data with imputed values. Please give me some way to 
get the data with imputed values.

Thanks in advance

Yours truely

Ramesh Kolluru 

[[alternative HTML version deleted]]

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


[R] selections of data by one variable

2005-05-04 Thread Tu Yu-Kang
Dear R experts,
My problem is as follows:
Suppose I have a data frame d comprising two variable a<-c(1:10) & 
b<-c(11:20).

I now want to select a subgroup according the values of b.
I know if I just want to select, say, b=17, I can use f<-d[d$b==17] and R 
will give me 

f
 a  b
7 7 17
However, if now I want to select a subgroup according to b==e<-c(13,15,17), 
then the same syntx doesn't work.

What is the correct way to do it?  My data have more than one million 
subjects, and I want to select part of them according to their id numbers.

Your help will be highly appreciated.
Best regards,
Yu-Kang
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] Imputation

2005-05-04 Thread Ramesh Kolluru
  
Sir, I wrote a mail in r-help, but it is not responding. If there is any change 
in r-help address please forward me. 

My problem is:

I have timeseries data for some factors, and some missing values are there in 
those factors, I want impute those missing values without disturbing the 
distribution of that factor, and maintaining the correlation with other 
factors. Pl. suggest me some imputation methods.
I tried some functions in R like aregImpute, transcan. After the imputation I 
am unable to retrive the data with imputed values. Please give me some way to 
get the data with imputed values.

Yours truely

Ramesh Kolluru 



[[alternative HTML version deleted]]

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


[R] Avoiding Sweave formula cut's?

2005-05-04 Thread christian schulz
Hi,
anybody know a possibilities how i could avoid less nicely  cut's  in 
function calls with sweave  like:

randomForest(x = RELSHIP ~ ., data = R_RELSHIP[splitR_RELSHIP ==  1, 
], importance = T, n(*here is the cut in the pdf*)
tree = 1000, na.action = na.omit)

Until now i add expost linebreaks in the *.tex file, but with dozend of 
models it might be painfuel for my hands.

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


[R] JGR and R 2.0.X

2005-05-04 Thread Christoph Scherber
Dear all,
I am running Windows XP with several parallel installations of R (2.0.1; 
2.1 and so on). How can I install JGR for the 2.0.1 version? I keep on 
getting error messages when trying to install it.

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


Re: [R] How to intepret a factor response model?

2005-05-04 Thread Peter Flom
>>> Maciej Blizi(Bñski <[EMAIL PROTECTED]> 5/4/2005 6:02:14 AM >>>
<<<
I'm trying to analyze a survey. Most of the variables are of factor
type, with values for example {"no_at_all", "a_little", "mostly",
"a_lot"}.
>>>

In that case, you probably want to look at ordinal logistic regression.  This 
is covered in numerous texts, one good one which uses R is Harrell's Regression 
Modeling Strategies (an excellent book in other regards, as well).

Another book which might be useful (although not R specific) isLong's 
Regression Models for Categorical and Limited Dependent Variables

<<<
I thought about mapping those answers to numbers, but I didn't know what 
numbers should I assign them to: {1, 2, 3, 4} (linear) or maybe
{1, 2, 4, 8} (exponential)? So I rather tried to analyze the original
factor survey data.

Multinomial factor response wasn't covered in the lectures in my school
so I'm trying to use my intuition and trial/error technique (please
forgive me :-) ).
>>>

Using your intuition and trial and error seems to me to be a way to guarantee 
lots of trials and lots of errors, but not necessarily to guarantee success.  
You might want to consult a statistician before proceeding; you certainly want 
to consult a text.

HTH

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)

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


[R] Huynh-Feldt R vs SAS Bug

2005-05-04 Thread Bela Bauer
Hi,
I'm using anova.mlm sphericity tests/corrections, and I'm getting 
different values than SAS. In order to be able to use these values for 
publications, I'd need to know more about the SAS bug that is mentioned 
in the Reference Manual.
- What exactly causes the different values?
- Is it just a slight difference, or can I expect significant 
differences in H-F/G-G epsilons and corrected p-Values? With the data 
sets I'm using, the SAS value for H-F epsilon is almost twice the value 
from R, and I'm wondering if there's a mistake on my side or if it is 
just caused by the SAS bug.

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


Re: [R] Imputation

2005-05-04 Thread Jonathan Baron
On 05/04/05 11:13, Ramesh Kolluru wrote:
   
 I have timeseries data for some factors, and some missing values are there in 
those
 factors, I want impute those missing values without disturbing the 
distribution of
 that factor, and maintaining the correlation with other factors. Pl. suggest 
me some
 imputation methods.
 I tried some functions in R like aregImpute, transcan. After the imputation I 
am
 unable to retrive the data with imputed values. Please give me some way to get 
the
 data with imputed values.

Here is one way to do it with transcan(), but I'm looking forward
to seeing other answers.  The data are in s.m, and the missing
values are NA.  The imputed values are in s.imp$imputed, in
order, and the third line simply replaces the NAs with these
values.  (I posted this before.  You might have found it by
searching the R search page below.)  This is for the simplest
possible sort of imputation.  I'm not sure that it meets your
requirements.  (In fact, I'm pretty sure it doesn't.)  So you'd
have to change the options for transcan, or do something else.

s.imp <- transcan(s.m,asis="*",data=s.m,imputed=T,long=T,pl=F)
s.na <- is.na(s.m) # which data are imputed
s.m[which(s.na)] <- unlist(s.imp$imputed)

As for aregImpute(), that has to be more difficult, because
aregImpute() does multiple imputation.  Very roughly, it produces
an whole set of imputed values, for the purpose of statistical
inference.  I don't know how to get a single best estimate out of
this set, or even whether this is a good idea.

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/

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


Re: [R] selections of data by one variable

2005-05-04 Thread Marc Schwartz
On Wed, 2005-05-04 at 11:14 +, Tu Yu-Kang wrote:
> Dear R experts,
> 
> My problem is as follows:
> 
> Suppose I have a data frame d comprising two variable a<-c(1:10) & 
> b<-c(11:20).
> 
> I now want to select a subgroup according the values of b.
> 
> I know if I just want to select, say, b=17, I can use f<-d[d$b==17] and R 
> will give me 
> 
> > f
>   a  b
> 7 7 17
> 
> However, if now I want to select a subgroup according to b==e<-c(13,15,17), 
> then the same syntx doesn't work.
> 
> What is the correct way to do it?  My data have more than one million 
> subjects, and I want to select part of them according to their id numbers.
> 
> Your help will be highly appreciated.
> 
> Best regards,
> 
> Yu-Kang

You would want to use something like the following:

> df <- data.frame(a = 1:10, b = 11:20)

> df
a  b
1   1 11
2   2 12
3   3 13
4   4 14
5   5 15
6   6 16
7   7 17
8   8 18
9   9 19
10 10 20

> df[df$b %in% c(13, 15, 17), ]
  a  b
3 3 13
5 5 15
7 7 17


See ?"%in%" for more information.

Also, see ?subset for more flexibility in using complex boolean
expressions for subsetting.

HTH,

Marc Schwartz

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


Re: [R] selections of data by one variable

2005-05-04 Thread Dimitris Rizopoulos
try this:
d <- data.frame(a=1:10, b=11:20)
e <- c(13, 15, 17)
##
d. <- subset(d, b %in% e)
d.
I hope it helps.
Best,
Dimitris

Dimitris Rizopoulos
Ph.D. Student
Biostatistical Centre
School of Public Health
Catholic University of Leuven
Address: Kapucijnenvoer 35, Leuven, Belgium
Tel: +32/16/336899
Fax: +32/16/337015
Web: http://www.med.kuleuven.ac.be/biostat/
http://www.student.kuleuven.ac.be/~m0390867/dimitris.htm

- Original Message - 
From: "Tu Yu-Kang" <[EMAIL PROTECTED]>
To: 
Sent: Wednesday, May 04, 2005 1:14 PM
Subject: [R] selections of data by one variable


Dear R experts,
My problem is as follows:
Suppose I have a data frame d comprising two variable a<-c(1:10) & 
b<-c(11:20).

I now want to select a subgroup according the values of b.
I know if I just want to select, say, b=17, I can use f<-d[d$b==17] 
and R will give me
f
 a  b
7 7 17
However, if now I want to select a subgroup according to 
b==e<-c(13,15,17), then the same syntx doesn't work.

What is the correct way to do it?  My data have more than one 
million subjects, and I want to select part of them according to 
their id numbers.

Your help will be highly appreciated.
Best regards,
Yu-Kang
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! 
http://www.R-project.org/posting-guide.html

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


Re: [R] segmentation fault using hdf5load() under Unix

2005-05-04 Thread Prof Brian Ripley
Please check the hdf5 package version numbers are the current one.
Does the file contain text strings?  If so there has been a known problem 
with hdf5 crashes and a recent update of hdf5 (which I do not know for 
sure whether it fixes the problem or not).  This manifested itself as 
crashes on some machines and not others.

On Wed, 4 May 2005 [EMAIL PROTECTED] wrote:
I'm experiencing a segmentation fault when using
hdf5load(file,load=FALSE). Library(hdf5) loads without problems but when
loading a file, R crashes. I compiled R under Unix (Solaris for Sun).
There is nothing wrong with the files, as I can run the same script at
another place where R runs under Linux.
Is it possible it has something to do with the hdf5 libraries where
package(hdf5) refers to?
--
Brian D. Ripley,  [EMAIL PROTECTED]
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford, Tel:  +44 1865 272861 (self)
1 South Parks Road, +44 1865 272866 (PA)
Oxford OX1 3TG, UKFax:  +44 1865 272595
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] JGR and R 2.0.X

2005-05-04 Thread Sundar Dorai-Raj

Christoph Scherber wrote on 5/4/2005 4:44 AM:
Dear all,
I am running Windows XP with several parallel installations of R (2.0.1; 
2.1 and so on). How can I install JGR for the 2.0.1 version? I keep on 
getting error messages when trying to install it.

Best wishes
Christoph
Hi Christoph,
Which version of R comes first in your PATH?
--sundar
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] JGR and R 2.0.X

2005-05-04 Thread Uwe Ligges
Christoph Scherber wrote:
Dear all,
I am running Windows XP with several parallel installations of R (2.0.1; 
2.1 and so on). How can I install JGR for the 2.0.1 version? I keep on 
getting error messages when trying to install it.

I am sure Simon Urbanek et al. are happy to help you, but even the 
winners of the John Chambers Statistical Software Award are unable to 
help if you don't say what the error messages are and which versions of 
JGR you tried...

Uwe Ligges

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


Re: [R] selections of data by one variable

2005-05-04 Thread Uwe Ligges
Tu Yu-Kang wrote:

> Dear R experts,
> 
> My problem is as follows:
> 
> Suppose I have a data frame d comprising two variable a<-c(1:10) & 
> b<-c(11:20).
> 
> I now want to select a subgroup according the values of b.
> 
> I know if I just want to select, say, b=17, I can use f<-d[d$b==17] and 
> R will give me
> 
>> f
> 
>  a  b
> 7 7 17
> 
> However, if now I want to select a subgroup according to 
> b==e<-c(13,15,17), then the same syntx doesn't work.


Which language is this???

To summarize, all the code you specified is:

a<-c(1:10) & b<-c(11:20)
f<-d[d$b==17]
b==e<-c(13,15,17)

In R, each line for itself is syntacically completely incorrect (even if
you say something would work, which is definitely not the case)!
"PLEASE do read the posting guide!"

I guess you want something like

 d <- data.frame(a = 1:10, b = 11:20)
 subset(d, b == 17)
 e <- c(13, 15, 17)
 subset(d, b %in% e)

Uwe Ligges



> What is the correct way to do it?  My data have more than one million 
> subjects, and I want to select part of them according to their id numbers.
> 
> Your help will be highly appreciated.
> 
> Best regards,
> 
> Yu-Kang
> 
> __
> R-help@stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! 
> http://www.R-project.org/posting-guide.html

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


Re: [R] lme versus proc mixed in SAS

2005-05-04 Thread Dimitris Rizopoulos
check this:
library(nlme)
B <- 1000
N <- 100
n <- 5
x <- rep(runif(N, -4, 4), each=n)
gr <- rep(1:N, each=n)

T <- numeric(B)
for(i in 1:B){
   y <- rnorm(N*n, 1 + 1.5*x)
   L0 <- lm(y~x)
   L1 <- lme(y~x, random=~1|gr, method="ML")
   T[i] <- anova(L1, L0)$L.Ratio[2]
}
hist(T, prob=TRUE, breaks=100)
I hope it helps.
Best,
Dimitris

Dimitris Rizopoulos
Ph.D. Student
Biostatistical Centre
School of Public Health
Catholic University of Leuven
Address: Kapucijnenvoer 35, Leuven, Belgium
Tel: +32/16/336899
Fax: +32/16/337015
Web: http://www.med.kuleuven.ac.be/biostat/
http://www.student.kuleuven.ac.be/~m0390867/dimitris.htm

- Original Message - 
From: "Beatrijs Moerkerke" <[EMAIL PROTECTED]>
To: 
Sent: Wednesday, May 04, 2005 12:03 PM
Subject: [R] lme versus proc mixed in SAS


Dear all,
I am trying to simulate the null distribution for the likelihood 
ratio test statistic for testing 1 random effect versus no random 
effect.  The asymptotic null distribution should be a mixture of a 
chi-squared distribution with 0 degrees of freedom and a chi-squared 
distribution with 1 degree of freedom.  This means that I expect a 
point mass of 50% on 0 for the likelihood ratio test statistic.
However, when I generate data using no random effects and when I 
calculate the test statistics for these data, I never obtain exactly 
zero.  I think this might be due to rounding errors but in fact, 70% 
of the calculated test statistics are negative.  I have compared a 
few of these results with the results in proc MIXED and I found that 
SAS does give test statistics that are exactly zero and gives no 
negative results.

The code I use for calculating the likelihood ratio test statistics 
is as follows:

a1<-summary(lme(y~x,random=~1|gr,method="ML"))$logLik
a2<-logLik(lm(y~x))
(-2*(a2-a1))
I don't know how I can simulate the null distribution in R using 
lme.

Thanks for your help,
Kind regards,
Beatrijs Moerkerke
--
Beatrijs Moerkerke
Department of Applied Mathematics and Computer Science
Ghent University
Krijgslaan 281 - S9
B-9000 GENT
Tel: +32-(0)9-264.47.56  Fax: +32-(0)9-264.49.95
E-mail: [EMAIL PROTECTED]
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! 
http://www.R-project.org/posting-guide.html

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


[R] Difference between "tree" and "rpart"

2005-05-04 Thread Dr Carbon
In the help for rpart it says, "This differs from the tree function
mainly in its handling of surrogate variables." And it says that an
rpart object is a superset of a tree object. Both cite Brieman et al.
1984. Both call external code which looks like martian poetry to me.

I've seen posts in the archives where BDR, and other knowledgeable
folks, have said that rpart() is to be prefered over tree()

Is there a simple reason why? They use the same fundamental algorithm.
Are there differences in processing time? Bells and whistles?

TIA, DRC

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


[R] error with the function GOHyperG from GOstats package

2005-05-04 Thread Sabrina Carpentier
I am running R 2.0.0, GOstats 1.1.1 and GO 1.7.0,

and when I use the function GOHyperG, I have the following error:

w1<-as.list(hgu95av2LOCUSID)

w2<-unique(unlist(w1))

set.seed(123)
myLL<-sample(w2,100)

xx <- GOHyperG(myLL)
Error in mget(x, env = GOTERM, ifnotfound = NA) : 
recursive default argument reference

In fact first I tried this function with my locusId ' list (with affymetrix 
hgu133plus2), but I had the same error...

Any help is appreciated 

Regards,
Sabrina



Sabrina Carpentier
Service Bioinformatique
Institut Curie - Bat. Trouillet Rossignol (4e étage)
26 rue d'Ulm - 75248 Paris Cedex 5 - FRANCE
Tel : +33 1 42 34 65 21 
[[alternative HTML version deleted]]

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


[R] S-PLUS Essentials Training 23rd-26th May

2005-05-04 Thread Kathy Kiely
 

S-PLUS Essentials -  Lee Perry 23-26th  May 2005 
 
This is the last chance to register for the course S-PLUS Essentials to be
held in Basingstoke on 23-26th May 2005.  If you are unfamiliar with S-PLUS
or have been meaning to upgrade your S-PLUS skills, this is the course for
you.
 

Extract:
 
S-PLUS Essentials is a hands-on training course that covers a broad spectrum
of topics from importing data to fitting statistical models.  At the
conclusion of the course the student will have a working knowledge of the
syntax of the S-PLUS language.  Both traditional and trellis graphs will be
explored.  In addition to function writing in the context of graphing and
statistics, the course will present tools for organising your S-PLUS work.
While the material is presented here in the Windows environment, references
to Unix are made where appropriate.
 
Feedback from delegates at previous S-PLUS Essentials courses:
 
"Had some exposure to S-PLUS before - definitely opened my eyes to the
capabilities" - Citigroup
 
"Statisticians and graphics experts will appreciate the course" -National
Audit Office
 
"This was definitely a worthwhile investment of time" - Serono International
 
"Fantastic!" - Amgen

Refreshments, Lunch and Laptops are provided for the duration of the course.
 

Reserve your seat now!

Full Course Description: Course Information 
 
 
 
Course:   S-PLUS Essentials
 
Presenter:Lee Perry
 
Dates:May 23 - 26th May 2005
 
Times:09:30 - 17:00, Monday - Thursday
 
Location: UK Office, Network House, Basing View, Basingstoke, 
  Hampshire RG21 4HG
 
 
 
Price:   Commercial Delegates:  £1,200 GBP + VAT (£1,410 GBP)
 
 Academic Delegates:£800 GBP + VAT (£940 GBP)
 
To Register:
Web: http://www.insightful.com/services/intl_training.asp
 
Email:   [EMAIL PROTECTED]
 
 
 
Kathy Kiely
Sales & Marketing Administrator
Insightful Limited
Network House, Basing View Basingstoke, Hampshire, RG21 4HG
Tel : 01256 339822
Fax : 01256 339839
e mail : [EMAIL PROTECTED]


If you do not want to receive information from Insightful then please contact
Kathy Kiely.

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


[R] Difference between difference of means

2005-05-04 Thread Peter Zorg
Hi
I would like to compare two differences of means.
I have the means of the log of one variable for two conditions for one product, 
and for another product.
The differences look different between both products for the two conditions, 
but a statistical test is required.
Thank you for any hint
 
Peter

__



[[alternative HTML version deleted]]

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


Re: [R] error with the function GOHyperG from GOstats package

2005-05-04 Thread James W. MacDonald
Sabrina Carpentier wrote:
I am running R 2.0.0, GOstats 1.1.1 and GO 1.7.0,
The release versions of BioC require R-2.0.1. You might try upgrading 
your R version and trying again, because I cannot replicate this error.

Note that if you upgrade to R-2.1.0 (the current version of R), you will 
need to use the development versions of BioC packages (use develOK=TRUE 
in your call to getBioC()). These devel versions of the BioC packages 
are not really that developmental right now, as we are fast approaching 
the release date for BioC 1.6.

Best,
Jim

and when I use the function GOHyperG, I have the following error:
w1<-as.list(hgu95av2LOCUSID)
w2<-unique(unlist(w1))
set.seed(123)
myLL<-sample(w2,100)
xx <- GOHyperG(myLL)
Error in mget(x, env = GOTERM, ifnotfound = NA) : 
recursive default argument reference

In fact first I tried this function with my locusId ' list (with affymetrix 
hgu133plus2), but I had the same error...
Any help is appreciated 

Regards,
Sabrina

Sabrina Carpentier
Service Bioinformatique
Institut Curie - Bat. Trouillet Rossignol (4e étage)
26 rue d'Ulm - 75248 Paris Cedex 5 - FRANCE
Tel : +33 1 42 34 65 21 
	[[alternative HTML version deleted]]

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

--
James W. MacDonald
Affymetrix and cDNA Microarray Core
University of Michigan Cancer Center
1500 E. Medical Center Drive
7410 CCGC
Ann Arbor MI 48109
734-647-5623
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] Unbundling gregmisc (was: loading gap package)

2005-05-04 Thread Warnes, Gregory R
Let me redirect the topic a bit.  I've been considering unbundling gregmisc.
The pro would be that people would find the component packages (i.e. gdata)
more easily.  The con is that the packages have a number of
interdependencies, so you pretty much will need to get most of them anyway.

As the latest gregmisc bundle contains a gregmisc package that is just a
stub that depends on and loads the individual packages, there would still be
a gregmisc object.

Comments?

-Greg

> -Original Message-
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] Behalf Of Constantinos
> Antoniou
> Sent: Wednesday, May 04, 2005 6:36 AM
> To: Prof Brian Ripley
> Cc: R-help@stat.math.ethz.ch; Uwe Ligges
> Subject: Re: [R] loading gap package
> 
> 
> =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
> =-=-=-=-=
> !!! IMPORTANT NOTICE !!!
> This email was addressed to you from the Internet using a 
> legacy E-Mail Domain address.
> 
> 
> This email domain will no longer be in service on the 
> Internet after 15 July 2005.
> 
> If this is legitimate business email, please inform the 
> sender to address all future correspondence to your 
> @pfizer.com address.
> 
> The original text of this email appears below this notice.
> =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
> =-=-=-=-=
> 
> 
> On 4 ÎÎÏ 2005, at 12:06 ÂÂ, Prof Brian Ripley wrote:
> 
> > On Wed, 4 May 2005, Constantinos Antoniou wrote:
> >
> >>
> >> On 4 ÅÂÃ 2005, at 11:35 ÃÂ, Uwe Ligges wrote:
> >>
> >>> Eduwin Pakpahan wrote:
>  Dear R users, I did install R. 2.0.1, and try to load "gap"
> 
>  package. However, below is the message shown when I did load it.
> 
>  Can anybody
>  please let me know my mistakes?
>  
> > library()
> > library(gap)
>  Loading required package: MASS Loading required package: genetics
> 
>  Loading required package: combinat Loading required 
> package: gdata
> 
>  Error: package 'gdata' could not be loaded
>  In addition: Warning message: There is no package called 'gdata'
> 
>  in: library(pkg, character.only =
>  TRUE, logical = TRUE, lib.loc = lib.loc)
>  
> >>> Let me read the error message for you:
> >>> "There is no package 'gdata'" simply means the package is not
> 
> >>> there...
> >>> So what about installing it?
> >>> Hint: it is part of the package bundle "gregmisc".
> >>
> >> I have a similar problem with R 2.1.0 on Mac OSX 10.3.9.
> >>
> >>> library(gregmisc)
> >> Loading required package: gdata
> >> Error: package 'gdata' could not be loaded
> >> In addition: Warning message:
> >> there is no package called 'gdata' in: library(pkg, 
> character.only =
> 
> >> TRUE, logical = TRUE, lib.loc = lib.loc)
> >>
> >> At first I tried getting this gdata from somewhere else, 
> but I could
> 
> >> not find it (evidence indicated that it is part of the 
> gregmisc, as I
> 
> >> suspected originally... You email confirms this...)
> >>
> >> (For the record, my goal is to get read.xls, which is part (?) of
> 
> >> gdata)
> >
> > The current version of gregmisc is 2.0.6.  That does contain gdata. 
> 
> > It looks to me as if the MacOS X binary is broken (2kb) so you will
> 
> > need to install from the sources.
> >
> 
> Thank you. I had the current  version (binary). Reinstalling from
> 
> source fixed the issue
> 
> Costas
> 
> > I think we have been here before: it seems the MacOS X binary
> 
> > packaging does not work for bundles.
> >
> > --
> 
> > Brian D. Ripley,  [EMAIL PROTECTED]
> > Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
> > University of Oxford, Tel:  +44 1865 272861 (self)
> > 1 South Parks Road, +44 1865 272866 (PA)
> > Oxford OX1 3TG, UKFax:  +44 1865 272595
> 
> __
> R-help@stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! 
> http://www.R-project.org/posting-guide.html
> 
> 
> 


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

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


Re: [R] selections of data by one variable

2005-05-04 Thread Christoph Lehmann
test <- data.frame(cbind(1:10,11:20))
names(test) <- c("a", "b")
test[test$b == 17,]
test[test$b %in% c(13, 15, 17),]


Tu Yu-Kang wrote:
> Dear R experts,
> 
> My problem is as follows:
> 
> Suppose I have a data frame d comprising two variable a<-c(1:10) & 
> b<-c(11:20).
> 
> I now want to select a subgroup according the values of b.
> 
> I know if I just want to select, say, b=17, I can use f<-d[d$b==17] and 
> R will give me
>> f
>  a  b
> 7 7 17
> 
> However, if now I want to select a subgroup according to 
> b==e<-c(13,15,17), then the same syntx doesn't work.
> 
> What is the correct way to do it?  My data have more than one million 
> subjects, and I want to select part of them according to their id numbers.
> 
> Your help will be highly appreciated.
> 
> Best regards,
> 
> Yu-Kang
> 
> __
> R-help@stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! 
> http://www.R-project.org/posting-guide.html
> 
>

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


[R] stratified bootstrap with boot

2005-05-04 Thread Richard Chandler
Hello,

I am new to R, and am having trouble getting the output I want from a
stratified bootstrap. I didn't recieve a reply the first time I posted
this question so I have tried to make it more clear. My data frame
(denboot) is set up as follows:

SITE cswa parea treat
1  BeanA3  1.20 m
2 BeanBC3  1.05 m
3  BeanD1  0.93 m
4 BlackB1  1.01 m
5 Brooks3  4.00 b
6  BullL3  1.32 b
7  BullM1  0.20 m
8  BullU4  2.06 b
...

#Here is my code:

cswafun <- function(denboot, i) sum(cswa[i])/(sum(parea[i])
attach(denboot)
cswa.boot <- boot(denboot, cswafun, R = 1, strata = treat)

#Here is the output

Call:
boot(data = denboot, statistic = cswafun, R = 1, strata = treat)


Bootstrap Statistics :
original biasstd. error
t1* 1.109612 0.02641786   0.2032927

#Can anyone tell me why I'm not getting two estimates of
sum(cswa)/sum(parea), one for each #strata ('b' and 'm')? Any help
would be appreciated. Thanks

Richard

-- 
Richard Chandler, M.S. candidate
Department of Natural Resources Conservation
UMass Amherst
(413)545-1237

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


Re: [R] Unbundling gregmisc (was: loading gap package)

2005-05-04 Thread Duncan Murdoch
Warnes, Gregory R wrote:
Let me redirect the topic a bit.  I've been considering unbundling gregmisc.
The pro would be that people would find the component packages (i.e. gdata)
more easily.  The con is that the packages have a number of
interdependencies, so you pretty much will need to get most of them anyway.
As the latest gregmisc bundle contains a gregmisc package that is just a
stub that depends on and loads the individual packages, there would still be
a gregmisc object.
Comments?
Currently R can follow dependencies when you install a package from CRAN 
(and this is the default in Windows, not sure about other platforms), so 
I'd say this would be a good thing to do.  I don't know your revision 
history on the components, but I'd guess some change more often than 
others, so there'll be no need to update all of them every time one of 
them changes.

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


Re: [R] Unbundling gregmisc (was: loading gap package)

2005-05-04 Thread apjaworski





I have one comment, although it is a little off topic.

I have the gregmisc package installed (R-2.0.1 on Win2000).  Whenever I use
the help.search function it comes back with the following warning:

Warning message:
no Rd contents for package 'gregmisc' in 'C:/local/R/rw210/library' in:
help.search("bundle")

Apparently, the help.search function looks for the CONTENTS file in the
.../library/gregmisc directory.  I created an empty one and the warning
went away.  I know it is purely cosmetic, but if the gregmisc bundle is
kept intact, and I think it should, I would suggest adding the empty
CONTENTS file to its distribution.

Perhaps there is a better way of handling this.  For example, VR is a
bundle but it does not create its VR directory in .../library.

Andy

__
Andy Jaworski
518-1-01
Process Laboratory
3M Corporate Research Laboratory
-
E-mail: [EMAIL PROTECTED]
Tel:  (651) 733-6092
Fax:  (651) 736-3122


   
 "Warnes, Gregory  
 R"
   "'Constantinos Antoniou'"   
 Sent by:  <[EMAIL PROTECTED]>, Prof Brian Ripley 
 [EMAIL PROTECTED] <[EMAIL PROTECTED]> 
 at.math.ethz.chcc 
   R-help@stat.math.ethz.ch, Uwe   
   Ligges  
 05/04/2005 09:56  <[EMAIL PROTECTED]>  
 AMSubject 
   [R] Unbundling gregmisc (was:   
   loading gap package)
   
   
   
   
   
   




Let me redirect the topic a bit.  I've been considering unbundling
gregmisc.
The pro would be that people would find the component packages (i.e. gdata)
more easily.  The con is that the packages have a number of
interdependencies, so you pretty much will need to get most of them anyway.

As the latest gregmisc bundle contains a gregmisc package that is just a
stub that depends on and loads the individual packages, there would still
be
a gregmisc object.

Comments?

-Greg

> -Original Message-
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] Behalf Of Constantinos
> Antoniou
> Sent: Wednesday, May 04, 2005 6:36 AM
> To: Prof Brian Ripley
> Cc: R-help@stat.math.ethz.ch; Uwe Ligges
> Subject: Re: [R] loading gap package
>
>
> =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
> =-=-=-=-=
> !!! IMPORTANT NOTICE !!!
> This email was addressed to you from the Internet using a
> legacy E-Mail Domain address.
>
>
> This email domain will no longer be in service on the
> Internet after 15 July 2005.
>
> If this is legitimate business email, please inform the
> sender to address all future correspondence to your
> @pfizer.com address.
>
> The original text of this email appears below this notice.
> =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
> =-=-=-=-=
>
>
> On 4 ÎÎÏ 2005, at 12:06 ÂÂ, Prof Brian Ripley wrote:
>
> > On Wed, 4 May 2005, Constantinos Antoniou wrote:
> >
> >>
> >> On 4 ÅÂÃ 2005, at 11:35 ÃÂ, Uwe Ligges wrote:
> >>
> >>> Eduwin Pakpahan wrote:
>  Dear R users, I did install R. 2.0.1, and try to load "gap"
>
>  package. However, below is the message shown when I did load it.
>
>  Can anybody
>  please let me know my mistakes?
>  
> > library()
> > library(gap)
>  Loading required package: MASS Loading required package: genetics
>
>  Loading required package: combinat Loading required
> package: gdata
>
>  Error: package 'gdata' could not be loaded
>  In addition: Warning message: There is no package called 'gdata'
>
>  in: library(pkg, character.only =
>  TRUE, logical = TRUE, lib.loc = lib.loc)
>  
> >>> Let me read the error message for you:
> >>> "There is no package 'gdata'" simply means the package is not
>
> >>> there...
> >>> So what about installing it?
> >>> Hint: it is part of the package bundle "gregmisc".
> >>
> >> I have a similar problem with R 2.1.0 on Mac OSX 10.3.9.
> >>
> >>> library(gregmisc)
> >> Loading required package: gdata
> >> Error: package 'gdata' could not be loaded
> >> In addition: Warning message:
> >> there is no package calle

[R] Plotting means and confidence intervals by group factor using lattice graphics?

2005-05-04 Thread Sander Oom
Dear R graphics gurus,
Another question about lattice graphics. This time I would like to plot 
means and confidence intervals by group factor in a lattice graph. I can 
not find any working lattice examples. Maybe a custom panel function is 
the answer, but that is a bit beyond me for now.

The individual plots within the lattice graph could look like this:
# Example with confidence intervals and grid
hh <- t(VADeaths)[, 5:1]
mybarcol <- "gray20"
ci.l <- hh * 0.85
ci.u <- hh * 1.15
mp <- barplot2(hh, beside = TRUE,
col = c("lightblue", "mistyrose",
"lightcyan", "lavender"),
legend = colnames(VADeaths), ylim = c(0, 100),
main = "Death Rates in Virginia", font.main = 4,
sub = "Faked 95 percent error bars", col.sub = mybarcol,
cex.names = 1.5, plot.ci = TRUE, ci.l = ci.l, ci.u = ci.u,
plot.grid = TRUE)
mtext(side = 1, at = colMeans(mp), line = -2,
  text = paste("Mean", formatC(colMeans(hh))), col = "red")
box()
Or like this:
data(state)
plotmeans(state.area ~ state.region)
Both plotmeans and barplot2 give interesting options such as printing of 
nobs, among other things. In case of a barplot, there should be an 
option to plot the confidence intervals in one direction only (up) as to 
avoid interference with any black and white shading. The plotMeans 
function provides a useful option error.bars ("se", "sd", "conf.int", 
"none").

The following test data is still useful:
tmp <- expand.grid(geology = c("Sand","Clay","Silt","Rock"),
  species = 
c("ArisDiff","BracSera","CynDact","ElioMuti","EragCurS","EragPseu"),
  dist = seq(1,9,1) )
tmp$height <- rnorm(216)

For instance plotting height versus dist by geology.
Any help very welcome!
Cheers,
Sander.
PS Of course the resulting graph will go to the R graph gallery!
--

Dr. Sander P. Oom
Animal, Plant and Environmental Sciences,
University of the Witwatersrand
Private Bag 3, Wits 2050, South Africa
Tel (work)  +27 (0)11 717 64 04
Tel (home)  +27 (0)18 297 44 51
Fax +27 (0)18 299 24 64
Email   [EMAIL PROTECTED]
Web www.oomvanlieshout.net/sander
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] (no subject)

2005-05-04 Thread Spencer Graves
  It came up for me.  However, that's just a speed comparison, which
said that R 1.9.0 was comparable with the best available, better than
most but not necessarily the best depending on the task.

   I would think you might be more concerned with accuracy and ease of
use, and I suggest you Google and do an R site search, as I suggested.
This has been discussed repeately on this list, and a search should
expose many useful comments.

  spencer graves

ronggui wrote:

> On Wed, 04 May 2005 10:22:01 +0200
> Cuvelier Etienne <[EMAIL PROTECTED]> wrote:
> 
> 
>>At 16:52 3/05/2005 -0300, rene.raupp wrote:
>>
>>>Does anybory knows any work comparing R with other (charged) statistical 
>>>softwares (like Minitab, SPSS, SAS)?
>>>I work in a brasilian government bureau and I intend to use R as our 
>>>preferable statistical software, but I have to show it's as good as the 
>>>others. I also intend to use Weka, and for this one I have the same problem.
>>>Can anyone help me?
>>
>>The results of a Benchmark test of various number crunching packages  (R 
>>1.9.0, S-PLUS 6.1,  Matlab 6.0, O-Matrix 5.6 Ml mode, 
>>O-Matrix 5.6 native, Octave 2.1.42, Scilab 2.7, Ox 3.30) can be found at :
>>http://www.sciviews.org/benchmark/index.html
> 
> 
> i can NOT connect with the website .i do not why.anyone else come across this 
> problem?
> 
> 
>  
> 
>>>Thanks
>>>René M. Raupp
>>>e-mail: [EMAIL PROTECTED]
>>>   [EMAIL PROTECTED]
>>>
>>>   [[alternative HTML version deleted]]
>>>
>>>__
>>>R-help@stat.math.ethz.ch mailing list
>>>https://stat.ethz.ch/mailman/listinfo/r-help
>>>PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
>>
>>Cuvelier Etienne
>>Assistant
>>FUNDP - Institut d'Informatique
>>rue Grandgagnage, 21   B-5000 Namur (Belgique)
>>tel: 32.81.72.49.93fax: 32.81.72.49.67
>>
>>__
>>R-help@stat.math.ethz.ch mailing list
>>https://stat.ethz.ch/mailman/listinfo/r-help
>>PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
> 
> 
> __
> R-help@stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

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


Re: [R] Unbundling gregmisc

2005-05-04 Thread Seth Falcon
"Warnes, Gregory R" <[EMAIL PROTECTED]> writes:
> Let me redirect the topic a bit.  I've been considering unbundling
> gregmisc.  The pro would be that people would find the component
> packages (i.e. gdata) more easily.  The con is that the packages
> have a number of interdependencies, so you pretty much will need to
> get most of them anyway.

I'm +1, heck, +2.  

Given R's new ability to follow dependencies, I think the most likely
outcome is a friendlier user experience: it will be easier to find the
packages.  

As Duncan pointed out, another pro is that if some of the packages
change less, then users won't have to update them.


+ seth

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


[R] Double hurdle model in R

2005-05-04 Thread Kyosti H Kurikka
I am interested in utilizing this so called "double hurdle" model
in my study. We can write the model in the following way:

if (z'a + u > 0 & x'b + e > 0) y = x'b + e, else y = 0

In the model, consumption y is the (left-) censored dependent variable. e
and u are the normally distributed error terms. z'a is the participation
equation and x'b is the expenditure equation. If we would remove the
participation equation from the model we would end up with a type I
tobit-model.

In the tobit-model the same set of paprameters and variables determine
both the discrete probability of non-zero outcome and the level of
positive expenditure. In the double-hurdle-model we have separate
parametrization of the participation and consumption decisions.

I can estimate tobit-model using function survreg(). But what about this
double hurdle thing? Has somebody written a R-function for estimating this
sort of a model?


Best regards,
Kyösti Kurikka

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


RE: [R] Difference between difference of means

2005-05-04 Thread John Fox
Dear Peter,

This looks like a two-way ANOVA, with product as one factor and condition as
the other. The test that you describe is for the interaction between product
and condition.

I hope this helps,
 John


John Fox
Department of Sociology
McMaster University
Hamilton, Ontario
Canada L8S 4M4
905-525-9140x23604
http://socserv.mcmaster.ca/jfox 
 

> -Original Message-
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On Behalf Of Peter Zorg
> Sent: Wednesday, May 04, 2005 9:24 AM
> To: r-help@stat.math.ethz.ch
> Subject: [R] Difference between difference of means
> 
> Hi
> I would like to compare two differences of means.
> I have the means of the log of one variable for two 
> conditions for one product, and for another product.
> The differences look different between both products for the 
> two conditions, but a statistical test is required.
> Thank you for any hint
>  
> Peter
> 
> __
> 
> 
> 
>   [[alternative HTML version deleted]]
> 
> __
> R-help@stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! 
> http://www.R-project.org/posting-guide.html

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


[R] selecting maximum values

2005-05-04 Thread alessandro carletti
Sorry for disturbing you with another newbie question!
I have a data frame about coastal waters quality
parameters: for some parameters (e.g. NH3) I have only
1 observation for each sampling station and each
sampling date, while in other cases (chlorophyll) I
have 1 obs for each meter-depth for each station and
date. How can I select only the max chlorophyll value
for each station/date?

example

row  station datedepth chlorophyll
1 Castagneto  21/06/01 -0.5 2.0
2 Castagneto  21/06/01 -1.5 2.2
3 Castagneto  21/06/01 -2.5 2.4
4 Castagneto  21/06/01 -3.5 2.1
5 Ancona  23/06/01 -0.5 2.4
6 Ancona  23/06/01 -1.5 2.5
7 Ancona  23/06/01 -2.5 2.2
8 Ancona  23/06/01 -3.5 2.1
9 Ancona  23/06/01 -4.5 1.9
...

I'd like to select only row 3 and 6, the ones with max
chlorophyll values, or have the mean for the rows 1:4
and 5:9

Thanks

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


[R] rank of a matrix

2005-05-04 Thread mingan

how do I check the rank of a matrix ?
say
A=  1   0   0
0   1   0
then rank(A)=2
what is this function?
thanks
 I did try help.search("rank"), but all the returned help information 
seem irrelevant to what I want.

 I would like to know how people search for help information like this.


rank(base)  Sample Ranks
SignRank(stats) Distribution of the Wilcoxon Signed Rank
   Statistic
Wilcoxon(stats) Distribution of the Wilcoxon Rank Sum
   Statistic
friedman.test(stats)Friedman Rank Sum Test
kruskal.test(stats) Kruskal-Wallis Rank Sum Test
pairwise.wilcox.test(stats)
   Pairwise Wilcoxon rank sum tests
wilcox.test(stats)  Wilcoxon Rank Sum and Signed Rank Tests
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] Difference between "tree" and "rpart"

2005-05-04 Thread Prof Brian Ripley
rpart does much more at C level, including pruning and cross-validation so 
can be much faster.

It is also user-extensible.
tree was actually written to track down bugs in the then S implementation, 
and so is much closer to the functionality in S.  It is not where I would 
have started from.  It is really only available for R to support MASS and 
PRNN (my books).

On Wed, 4 May 2005, Dr Carbon wrote:
In the help for rpart it says, "This differs from the tree function
mainly in its handling of surrogate variables." And it says that an
rpart object is a superset of a tree object. Both cite Brieman et al.
1984. Both call external code which looks like martian poetry to me.
I've seen posts in the archives where BDR, and other knowledgeable
folks, have said that rpart() is to be prefered over tree()
Is there a simple reason why? They use the same fundamental algorithm.
Are there differences in processing time? Bells and whistles?
--
Brian D. Ripley,  [EMAIL PROTECTED]
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford, Tel:  +44 1865 272861 (self)
1 South Parks Road, +44 1865 272866 (PA)
Oxford OX1 3TG, UKFax:  +44 1865 272595
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] Unbundling gregmisc

2005-05-04 Thread Seth Falcon
[EMAIL PROTECTED] writes:

> I have one comment, although it is a little off topic.
>
> I have the gregmisc package installed (R-2.0.1 on Win2000).  Whenever I use
> the help.search function it comes back with the following warning:
>
> Warning message:
> no Rd contents for package 'gregmisc' in 'C:/local/R/rw210/library' in:
> help.search("bundle")
>
> Apparently, the help.search function looks for the CONTENTS file in the
> .../library/gregmisc directory.  I created an empty one and the warning
> went away.  I know it is purely cosmetic, but if the gregmisc bundle is
> kept intact, and I think it should, I would suggest adding the empty
> CONTENTS file to its distribution.
>
> Perhaps there is a better way of handling this.  For example, VR is a
> bundle but it does not create its VR directory in .../library.

IMO, this is another reason to move away from the bundle approach.  It
seems to add complexity and confusion in a number of places and,
personally, I don't think it is worth it (again, given auto dependency
following).

Best,

+ seth

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


Re: [R] stratified bootstrap with boot

2005-05-04 Thread Prof Brian Ripley
You asked for a stratified bootstrap, not a stratified estimator.  This is 
explained in the reference (Davison & Hinkley).

On Wed, 4 May 2005, Richard Chandler wrote:
Hello,
I am new to R, and am having trouble getting the output I want from a
stratified bootstrap. I didn't recieve a reply the first time I posted
this question so I have tried to make it more clear. My data frame
(denboot) is set up as follows:
   SITE cswa parea treat
1  BeanA3  1.20 m
2 BeanBC3  1.05 m
3  BeanD1  0.93 m
4 BlackB1  1.01 m
5 Brooks3  4.00 b
6  BullL3  1.32 b
7  BullM1  0.20 m
8  BullU4  2.06 b
...
#Here is my code:
cswafun <- function(denboot, i) sum(cswa[i])/(sum(parea[i])
attach(denboot)
cswa.boot <- boot(denboot, cswafun, R = 1, strata = treat)
#Here is the output
Call:
boot(data = denboot, statistic = cswafun, R = 1, strata = treat)
Bootstrap Statistics :
   original biasstd. error
t1* 1.109612 0.02641786   0.2032927
#Can anyone tell me why I'm not getting two estimates of
sum(cswa)/sum(parea), one for each #strata ('b' and 'm')? Any help
would be appreciated. Thanks
--
Brian D. Ripley,  [EMAIL PROTECTED]
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford, Tel:  +44 1865 272861 (self)
1 South Parks Road, +44 1865 272866 (PA)
Oxford OX1 3TG, UKFax:  +44 1865 272595
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] Step wise regression

2005-05-04 Thread Paul DeBruicker
Hi Walmir,

Here is the long version of Frank Harrell's answer.  

http://www.pitt.edu/~wpilib/statfaq/regrfaq.html


Paul


On Tue, 2005-05-03 at 08:21 -0500, Frank E Harrell Jr wrote:
> walmir-rodrigues wrote:
> > Dear Fellows,
> > 
> > How can I do to proced a step wise regression in R, if it´s possible ?
> > 
> > Thanks,
> > 
> > Walmir 
> 
> Here is an easy approach that will yield results only slightly less 
> valid than one actually using the response variable:
> 
> x <- data.frame(x1,x2,x3,x4,..., other potential predictors)
> x[,sample(ncol(x))]
> 
> :-)   -Frank
> 
>

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


Re: [R] selecting maximum values

2005-05-04 Thread Sean Davis
see ?aggregate.
Sean
On May 4, 2005, at 11:43 AM, alessandro carletti wrote:
Sorry for disturbing you with another newbie question!
I have a data frame about coastal waters quality
parameters: for some parameters (e.g. NH3) I have only
1 observation for each sampling station and each
sampling date, while in other cases (chlorophyll) I
have 1 obs for each meter-depth for each station and
date. How can I select only the max chlorophyll value
for each station/date?
example
row  station datedepth chlorophyll
1 Castagneto  21/06/01 -0.5 2.0
2 Castagneto  21/06/01 -1.5 2.2
3 Castagneto  21/06/01 -2.5 2.4
4 Castagneto  21/06/01 -3.5 2.1
5 Ancona  23/06/01 -0.5 2.4
6 Ancona  23/06/01 -1.5 2.5
7 Ancona  23/06/01 -2.5 2.2
8 Ancona  23/06/01 -3.5 2.1
9 Ancona  23/06/01 -4.5 1.9
...
I'd like to select only row 3 and 6, the ones with max
chlorophyll values, or have the mean for the rows 1:4
and 5:9
Thanks
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! 
http://www.R-project.org/posting-guide.html
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] Avoiding Sweave formula cut's?

2005-05-04 Thread Friedrich . Leisch
> On Wed, 04 May 2005 13:40:18 +0200,
> christian schulz (cs) wrote:

  > Hi,
  > anybody know a possibilities how i could avoid less nicely  cut's  in 
  > function calls with sweave  like:

  > randomForest(x = RELSHIP ~ ., data = R_RELSHIP[splitR_RELSHIP ==  1, 
  > ], importance = T, n(*here is the cut in the pdf*)
  >  tree = 1000, na.action = na.omit)

  > Until now i add expost linebreaks in the *.tex file, but with dozend of 
  > models it might be painfuel for my hands.

Currently there is no way of doing this, because the code you see is
the result of a parse() and deparse() and I need the parse() step to
know where to insert output, i.e., where expressions are complete. I
have ideas about chunks where the code is exactly as in the source
file, but no time to implement them yet.

what you always can do is to write the code in a separate source file,
include that with, e.g., latex's listings package and do a source() on
it with echo=FALSE. If you want code and output mixed one needs to
parse() -> you loose the original formatting.

.f

-- 
---
Friedrich Leisch 
Institut für Statistik Tel: (+43 1) 58801 10715
Technische Universität WienFax: (+43 1) 58801 10798
Wiedner Hauptstraße 8-10/1071
A-1040 Wien, Austria http://www.ci.tuwien.ac.at/~leisch

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


Re: [R] rank of a matrix

2005-05-04 Thread Uwe Ligges
mingan wrote:

how do I check the rank of a matrix ?
say
A=  1   0   0
0   1   0
then rank(A)=2
what is this function?

Well, calculating the rank is from the computational point of view a 
very hard problem.
See ?qr

Uwe Ligges

thanks
 I did try help.search("rank"), but all the returned help information 
seem irrelevant to what I want.

 I would like to know how people search for help information like this.


rank(base)  Sample Ranks
SignRank(stats) Distribution of the Wilcoxon Signed Rank
   Statistic
Wilcoxon(stats) Distribution of the Wilcoxon Rank Sum
   Statistic
friedman.test(stats)Friedman Rank Sum Test
kruskal.test(stats) Kruskal-Wallis Rank Sum Test
pairwise.wilcox.test(stats)
   Pairwise Wilcoxon rank sum tests
wilcox.test(stats)  Wilcoxon Rank Sum and Signed Rank Tests
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! 
http://www.R-project.org/posting-guide.html
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] rank of a matrix

2005-05-04 Thread Spencer Graves
  Have you considered something like the following:
matrix.rank <- function(A, eps=sqrt(.Machine$double.eps)){
sv. <- abs(svd(A)$d)
sum((sv./max(sv.))>eps)
}
matrix.rank(A=diag(3))
#[1] 3
A <- array(c(1,1,0,0), dim=c(2,2))
matrix.rank(A)
#[1] 1
mingan wrote:

how do I check the rank of a matrix ?
say
A=  1   0   0
0   1   0
then rank(A)=2
what is this function?
thanks
 I did try help.search("rank"), but all the returned help information 
seem irrelevant to what I want.

 I would like to know how people search for help information like this.


rank(base)  Sample Ranks
SignRank(stats) Distribution of the Wilcoxon Signed Rank
   Statistic
Wilcoxon(stats) Distribution of the Wilcoxon Rank Sum
   Statistic
friedman.test(stats)Friedman Rank Sum Test
kruskal.test(stats) Kruskal-Wallis Rank Sum Test
pairwise.wilcox.test(stats)
   Pairwise Wilcoxon rank sum tests
wilcox.test(stats)  Wilcoxon Rank Sum and Signed Rank Tests
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! 
http://www.R-project.org/posting-guide.html
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] rank of a matrix

2005-05-04 Thread Sundar Dorai-Raj
mingan wrote on 5/4/2005 8:54 AM:

how do I check the rank of a matrix ?
say
A=  1   0   0
0   1   0
then rank(A)=2
what is this function?
thanks
 I did try help.search("rank"), but all the returned help information 
seem irrelevant to what I want.

 I would like to know how people search for help information like this.


rank(base)  Sample Ranks
SignRank(stats) Distribution of the Wilcoxon Signed Rank
   Statistic
Wilcoxon(stats) Distribution of the Wilcoxon Rank Sum
   Statistic
friedman.test(stats)Friedman Rank Sum Test
kruskal.test(stats) Kruskal-Wallis Rank Sum Test
pairwise.wilcox.test(stats)
   Pairwise Wilcoxon rank sum tests
wilcox.test(stats)  Wilcoxon Rank Sum and Signed Rank Tests
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! 
http://www.R-project.org/posting-guide.html

See ?qr or ?svd.
tol <- 1e-7
qr(A, tol)$rank
sum(svd(A)$d > tol)
--sundar
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] help track a segmentation fault

2005-05-04 Thread Omar Lakkis
I have an R script that I run using 

nohup R CMD BATCH r.in r.out &

The code loops through data from the database and takes hours. The
problem is, in about an hour and a half after I start the script the
program stops and I get

/usr/lib/R/bin/BATCH: line 55: 14067 Done( echo
"invisible(options(echo = TRUE))"; cat ${in}; echo "proc.time()" )
 14068 Segmentation fault  | ${R_HOME}/bin/R ${opts} >${out} 2>&1

in the nohup.out file.
If I run the code from within R, not using CMD BATCH, R sig faults
after the hour and a half (roughly).
I monitored the process using "top" and found nothing usual, the mem
utilization is around 15% and  CPU time in the 90s%. I do not see a
steady increase in mem usage signaling memory leak.
I have a core dump file generated but I do not know what to do with it.
Can someone, please, suggest to me what I can do to track this
problem, probably using the -d flag with R, which I do not know how to
use.
I am running R 2.1.0 on debian.

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


[R] ANN: Two Upcoming Bioconductor Short Courses

2005-05-04 Thread Seth Falcon
Announcing two upcoming Bioconductor short courses:


June 1-3 in Seattle, WA
Bioconductor Short Course
Details: http://www.bioconductor.org/signup

June 19-25 in Bressanone-Brixen
Computational and Statistical Aspects of Microarray Analysis
Details: http://www.economia.unimi.it/marray/2005/

Best Wishes,

+ seth

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


RE: [R] rank of a matrix

2005-05-04 Thread Huntsinger, Reid
qr() returns an estimate of the rank. However the rank of a matrix isn't
really computable (or useful) in general in finite precision arithmetic. The
Hilbert matrix example (from help(svd)) is a good illustration:

> hilbert <- function(n) { i <- 1:n; 1 / outer(i - 1, i, "+") }
> qr(hilbert(9))$rank
[1] 7

but it's actually an invertible 9 x 9 matrix. 


Rather you can estimate how far a matrix is from having rank <= k for
example. A book on numerical linear algebra would be a good reference.

A common approach to statistical analysis of certain kinds of data deals
with the ranks of the data values, and that's why you got so many hits for
"rank". 

Reid Huntsinger

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of mingan
Sent: Wednesday, May 04, 2005 11:54 AM
To: r-help@stat.math.ethz.ch
Subject: [R] rank of a matrix




how do I check the rank of a matrix ?

say

A=  1   0   0
 0   1   0

then rank(A)=2

what is this function?

thanks


  I did try help.search("rank"), but all the returned help information 
seem irrelevant to what I want.

  I would like to know how people search for help information like this.






rank(base)  Sample Ranks
SignRank(stats) Distribution of the Wilcoxon Signed Rank
Statistic
Wilcoxon(stats) Distribution of the Wilcoxon Rank Sum
Statistic
friedman.test(stats)Friedman Rank Sum Test
kruskal.test(stats) Kruskal-Wallis Rank Sum Test
pairwise.wilcox.test(stats)
Pairwise Wilcoxon rank sum tests
wilcox.test(stats)  Wilcoxon Rank Sum and Signed Rank Tests

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

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


Re: [R] selecting maximum values

2005-05-04 Thread Roger Bivand
On Wed, 4 May 2005, Sean Davis wrote:

> see ?aggregate.

Or maybe tapply, or its close relative, by:

> by(df, list(df$station, df$date), function(x) 
+   x$row[which.max(x$chlorophyll)]) 
: Ancona
: 21/06/01
[1] NA
 
: Castagneto
: 21/06/01
[1] 3
 
: Ancona
: 23/06/01
[1] 6
 
: Castagneto
: 23/06/01
[1] NA

since happily a row ID column was included in the data frame. Note that 
which.max only reports the row of the first maximum if there are ties.

> 
> Sean
> 
> On May 4, 2005, at 11:43 AM, alessandro carletti wrote:
> 
> > Sorry for disturbing you with another newbie question!
> > I have a data frame about coastal waters quality
> > parameters: for some parameters (e.g. NH3) I have only
> > 1 observation for each sampling station and each
> > sampling date, while in other cases (chlorophyll) I
> > have 1 obs for each meter-depth for each station and
> > date. How can I select only the max chlorophyll value
> > for each station/date?
> >
> > example
> >
> > row  station datedepth chlorophyll
> > 1 Castagneto  21/06/01 -0.5 2.0
> > 2 Castagneto  21/06/01 -1.5 2.2
> > 3 Castagneto  21/06/01 -2.5 2.4
> > 4 Castagneto  21/06/01 -3.5 2.1
> > 5 Ancona  23/06/01 -0.5 2.4
> > 6 Ancona  23/06/01 -1.5 2.5
> > 7 Ancona  23/06/01 -2.5 2.2
> > 8 Ancona  23/06/01 -3.5 2.1
> > 9 Ancona  23/06/01 -4.5 1.9
> > ...
> >
> > I'd like to select only row 3 and 6, the ones with max
> > chlorophyll values, or have the mean for the rows 1:4
> > and 5:9
> >
> > Thanks
> >
> > __
> > R-help@stat.math.ethz.ch mailing list
> > https://stat.ethz.ch/mailman/listinfo/r-help
> > PLEASE do read the posting guide! 
> > http://www.R-project.org/posting-guide.html
> 
> __
> R-help@stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
> 

-- 
Roger Bivand
Economic Geography Section, Department of Economics, Norwegian School of
Economics and Business Administration, Helleveien 30, N-5045 Bergen,
Norway. voice: +47 55 95 93 55; fax +47 55 95 95 43
e-mail: [EMAIL PROTECTED]

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


Re: [R] rank of a matrix

2005-05-04 Thread Gabor Grothendieck
In this case, try a lower tolerance (1e-7 is the default):

> qr(hilbert(9), tol = 1e-8)$rank
[1] 9


On 5/4/05, Huntsinger, Reid <[EMAIL PROTECTED]> wrote:
> qr() returns an estimate of the rank. However the rank of a matrix isn't
> really computable (or useful) in general in finite precision arithmetic. The
> Hilbert matrix example (from help(svd)) is a good illustration:
> 
> > hilbert <- function(n) { i <- 1:n; 1 / outer(i - 1, i, "+") }
> > qr(hilbert(9))$rank
> [1] 7
> 
> but it's actually an invertible 9 x 9 matrix.
> 
> Rather you can estimate how far a matrix is from having rank <= k for
> example. A book on numerical linear algebra would be a good reference.
> 
> A common approach to statistical analysis of certain kinds of data deals
> with the ranks of the data values, and that's why you got so many hits for
> "rank".
> 
> Reid Huntsinger
> 
> -Original Message-
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On Behalf Of mingan
> Sent: Wednesday, May 04, 2005 11:54 AM
> To: r-help@stat.math.ethz.ch
> Subject: [R] rank of a matrix
> 
> how do I check the rank of a matrix ?
> 
> say
> 
> A=  1   0   0
> 0   1   0
> 
> then rank(A)=2
> 
> what is this function?
> 
> thanks
> 
>  I did try help.search("rank"), but all the returned help information
> seem irrelevant to what I want.
> 
>  I would like to know how people search for help information like this.
> 
> rank(base)  Sample Ranks
> SignRank(stats) Distribution of the Wilcoxon Signed Rank
>Statistic
> Wilcoxon(stats) Distribution of the Wilcoxon Rank Sum
>Statistic
> friedman.test(stats)Friedman Rank Sum Test
> kruskal.test(stats) Kruskal-Wallis Rank Sum Test
> pairwise.wilcox.test(stats)
>Pairwise Wilcoxon rank sum tests
> wilcox.test(stats)  Wilcoxon Rank Sum and Signed Rank Tests
> 
> __
> R-help@stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide!
> http://www.R-project.org/posting-guide.html
> 
> __
> R-help@stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
>

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


Re: [R] Step wise regression

2005-05-04 Thread Rolf Turner

I would like to add to this discussion a quote from the book
``Subset Selection in Regression'' by Alan J. Miller (Chapman and
Hall, London, 1990).  On page 12 the author remarks that when using a
``black box'' variable selection technique

``Throwing in a few more variables produced by a
  random number generator or from the pages of a
  telephone directory could have a very salutary
  effect!''

cheers,

Rolf Turner
[EMAIL PROTECTED]

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


[R] Multivariate multiple regression

2005-05-04 Thread Iain Pardoe
I'd like to model the relationship between m responses Y1, ..., Ym and a
single set of predictor variables X1, ..., Xr.  Each response is assumed
to follow its own regression model, and the error terms in each model
can be correlated.  My understanding is that although lm() handles
vector Y's on the left-hand side of the model formula, it really just
fits m separate lm models.  What should I use to do a full multivariate
analysis (as in section 7.7 of Johnson/Wichern)?  Thanks.

Iain Pardoe <[EMAIL PROTECTED]>
University of Oregon

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


[R] Fwd: help track a segmentation fault

2005-05-04 Thread Omar Lakkis
This is the back trace.
Is my best shot recompiling R with debug flag to get better info from
teh debugger?

(gdb) r --no-save < r.in > r.out
Starting program: /usr/lib/R/bin/exec/R --no-save < r.in > r.out
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
[Thread debugging using libthread_db enabled]
[New Thread 16384 (LWP 14949)]
Creating a new generic function for 'names' in 'its'
Creating a new generic function for 'names<-' in 'its'
Creating a new generic function for 'print' in 'its'
Creating a new generic function for 'start' in 'its'
Creating a new generic function for 'end' in 'its'
Creating a new generic function for 'summary' in 'its'
Creating a new generic function for 'diff' in 'its'
Creating a new generic function for 'union' in 'its'
Creating a new generic function for 'intersect' in 'its'

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 16384 (LWP 14949)]
0x in ?? ()
(gdb) bt
#0  0x in ?? ()
#1  0x0001 in ?? ()
#2  0x08647304 in ?? ()
#3  0x08e7bb5c in ?? ()
#4  0x4009f754 in Rf_eval () from /usr/lib/R/lib/libR.so
#5  0x4009f9e6 in Rf_eval () from /usr/lib/R/lib/libR.so
#6  0x400a2501 in Rf_evalList () from /usr/lib/R/lib/libR.so
#7  0x400d1eed in do_internal () from /usr/lib/R/lib/libR.so
#8  0x400d3cc0 in do_nextmethod () from /usr/lib/R/lib/libR.so
#9  0x400d1a41 in do_internal () from /usr/lib/R/lib/libR.so
#10 0x4009fe22 in Rf_eval () from /usr/lib/R/lib/libR.so
#11 0x400a01b7 in Rf_applyClosure () from /usr/lib/R/lib/libR.so
#12 0x4009fb2b in Rf_eval () from /usr/lib/R/lib/libR.so
#13 0x400a1845 in do_begin () from /usr/lib/R/lib/libR.so
#14 0x4009fe22 in Rf_eval () from /usr/lib/R/lib/libR.so
#15 0x400a01b7 in Rf_applyClosure () from /usr/lib/R/lib/libR.so
#16 0x400a4054 in Rf_DispatchGroup () from /usr/lib/R/lib/libR.so
#17 0x4012574b in do_relop () from /usr/lib/R/lib/libR.so
#18 0x4009fd62 in Rf_eval () from /usr/lib/R/lib/libR.so
#19 0x400a2501 in Rf_evalList () from /usr/lib/R/lib/libR.so
#20 0x4009fcca in Rf_eval () from /usr/lib/R/lib/libR.so
#21 0x4009f9e6 in Rf_eval () from /usr/lib/R/lib/libR.so
#22 0x400a26f7 in Rf_evalListKeepMissing () from /usr/lib/R/lib/libR.so
#23 0x400a3300 in Rf_EvalArgs () from /usr/lib/R/lib/libR.so
#24 0x400a36d7 in Rf_DispatchOrEval () from /usr/lib/R/lib/libR.so
#25 0x40145387 in do_subset () from /usr/lib/R/lib/libR.so
#26 0x4009fe22 in Rf_eval () from /usr/lib/R/lib/libR.so
#27 0x400a2501 in Rf_evalList () from /usr/lib/R/lib/libR.so
#28 0x4009fcca in Rf_eval () from /usr/lib/R/lib/libR.so
#29 0x400a2501 in Rf_evalList () from /usr/lib/R/lib/libR.so
#30 0x4009fcca in Rf_eval () from /usr/lib/R/lib/libR.so
#31 0x400a22db in do_set () from /usr/lib/R/lib/libR.so
#32 0x4009fe22 in Rf_eval () from /usr/lib/R/lib/libR.so
#33 0x400a0dd4 in do_if () from /usr/lib/R/lib/libR.so
#34 0x4009fe22 in Rf_eval () from /usr/lib/R/lib/libR.so
#35 0x400a1845 in do_begin () from /usr/lib/R/lib/libR.so
#36 0x4009fe22 in Rf_eval () from /usr/lib/R/lib/libR.so
#37 0x400a14da in do_while () from /usr/lib/R/lib/libR.so
#38 0x4009fe22 in Rf_eval () from /usr/lib/R/lib/libR.so
#39 0x400a1845 in do_begin () from /usr/lib/R/lib/libR.so
#40 0x4009fe22 in Rf_eval () from /usr/lib/R/lib/libR.so
#41 0x400a01b7 in Rf_applyClosure () from /usr/lib/R/lib/libR.so
#42 0x4009fb2b in Rf_eval () from /usr/lib/R/lib/libR.so
#43 0x400a22db in do_set () from /usr/lib/R/lib/libR.so
#44 0x4009fe22 in Rf_eval () from /usr/lib/R/lib/libR.so
#45 0x400a1845 in do_begin () from /usr/lib/R/lib/libR.so
#46 0x4009fe22 in Rf_eval () from /usr/lib/R/lib/libR.so
#47 0x400a14da in do_while () from /usr/lib/R/lib/libR.so
#48 0x4009fe22 in Rf_eval () from /usr/lib/R/lib/libR.so
#49 0x400a1845 in do_begin () from /usr/lib/R/lib/libR.so
#50 0x4009fe22 in Rf_eval () from /usr/lib/R/lib/libR.so
#51 0x400a01b7 in Rf_applyClosure () from /usr/lib/R/lib/libR.so
#52 0x4009fb2b in Rf_eval () from /usr/lib/R/lib/libR.so
#53 0x400c305b in Rf_ReplIteration () from /usr/lib/R/lib/libR.so
#54 0x400c3273 in Rf_ReplIteration () from /usr/lib/R/lib/libR.so
---Type  to continue, or q  to quit---
#55 0x400c3df1 in run_Rmainloop () from /usr/lib/R/lib/libR.so
#56 0x400c3e2e in Rf_mainloop () from /usr/lib/R/lib/libR.so
#57 0x080486d0 in main ()
(gdb) 

-- Forwarded message --
From: Omar Lakkis <[EMAIL PROTECTED]>
Date: May 4, 2005 12:51 PM
Subject: help track a segmentation fault
To: r-help@stat.math.ethz.ch



Re: [R] Installing GO 1.7.0

2005-05-04 Thread Seth Falcon
Hi Cristian,

Christian Lederer <[EMAIL PROTECTED]> writes:
> is the announced solution for the GO 1.7.0 installation already
> publicly available?
> I am running into the same trouble as described in below, using
> 2.0.1 under Ubuntu Hoary.

Sorry about that.  No, the solution was not publicly available when
you wrote.

I've just pushed the fix to the metaData-devel repository.

You can download the fixed package here:

http://www.bioconductor.org/data/metaData-devel/html/GOv1.7.1.html

Note that we are working towards a release of Bioconductor 1.6
scheduled for 18 May.  The release will include an updated GO data
package.

Best,

+ seth

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


[R] LDA/PCA and more

2005-05-04 Thread T. Murlidharan Nair
Hi!!
I was trying to  analyze my data by doing a linear discriminants and I 
encountered
problems with collinearity.  So I am planning to do a PCA to extract 
orthogonal
components and then analyze them using linear discriminants.  I don't know
how to relate the orthogonal components back to my real data. Is there some
way I can do this  and are there any methods in R that will help me ?
Many thanks. Cheers ../Murli

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


Re: [R] JGR and R 2.0.X

2005-05-04 Thread Simon Urbanek
On May 4, 2005, at 9:18 AM, Uwe Ligges wrote:
Christoph Scherber wrote:
Dear all,
I am running Windows XP with several parallel installations of R  
(2.0.1; 2.1 and so on). How can I install JGR for the 2.0.1  
version? I keep on getting error messages when trying to install it.
I am sure Simon Urbanek et al. are happy to help you, but even the  
winners of the John Chambers Statistical Software Award are unable  
to help if you don't say what the error messages are and which  
versions of JGR you tried...
Markus is the winner, I'm just changing oil and doing dirty  
things ;). I'd be glad to help and, yes, http://www.rosuda.org/ 
lists.shtml is the right place to discuss JGR-related things in more  
detail.

In general JGR (and also JRI, rJava and JavaGD) uses the registry  
setting to determine the location and version of R. This setting is  
updated by the R installer if you leave the (D)COM setting checked  
(which is the default). This implies, however, that the sequence in  
which you install the various R versions matters - you should install  
the latest version last. If you want to edit the setting manually,  
use regedit and look into HKEY_LOCAL_MACHINE/SOFTWARE/R-core/R - it  
contains both the version and the path (at your own risk).

The most recent JGR for Windows can be installed simply with
install.packages("JGR",,"http://www.rosuda.org/R";)
and then starting JGR.exe which can be found in $R_HOME/library/JGR.  
The package installation fetches the correct version for your R (2.0  
and 2.1 are supported only). The convenience installer is still  
provided at http://www.rosuda.org/JGR/1.2/JGR-12.exe
Mac binary and Linux sources of the new release should become  
available this week.

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


Re: [R] rank of a matrix

2005-05-04 Thread Duncan Murdoch
Gabor Grothendieck wrote:
In this case, try a lower tolerance (1e-7 is the default):

qr(hilbert(9), tol = 1e-8)$rank
[1] 9
But don't trust the results.  For example, create a matrix with 4 
identical copies of hilbert(9).  This still has rank 9.  It's hard to 
find, though:

> h9 <- hilbert(9)
> temp <- cbind(h9, h9)
> h9times4 <- rbind(temp, temp)
>
> qr(h9times4,tol=1e-7)$rank
[1] 7
> qr(h9times4, tol=1e-8)$rank
[1] 10
> qr(h9times4, tol=1e-9)$rank
[1] 11
> qr(h9times4, tol=1e-10)$rank
[1] 12
There's a tolerance that gives the right answer (1.5e-8 works for me), 
but how would I know that in a real problem where I didn't already know 
the answer?

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


Re: [R] xinch/yinch equivalent for log axis

2005-05-04 Thread r+Steven . Murdoch
On Tue, May 03, 2005 at 02:31:28PM +1200, Paul Murrell wrote:
> No function, but does this do what you want?
[snip]

Yes, that worked perfectly. Thanks for your help.

Steven Murdoch.

-- 
w: http://www.cl.cam.ac.uk/users/sjm217/

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


[R] JOB: Financial Software Engineering position at Insightful

2005-05-04 Thread Charlie Roosen
Dear R-users,

Insightful has a position open for a Senior Software Engineer in
computational finance.  We are looking for someone with both solid software
engineering skills and experience in computational finance.  It's a very
interesting position for the right person.

The job description is below.  

Thanks,
Charlie Roosen
Software Engineering Manager
Insightful Corp

-

http://www.insightful.com/company/jobdescription.asp?JobID=49

Senior Software Engineer: Computational Finance 

Department: Development  
Reports To: Software Engineering Manager 
Status: Exempt  


SUMMARY OF RESPONSIBILITIES & DUTIES:  
This position requires a hands-on, driven, well organized professional with
experience in computational finance and software engineering.  This
individual will be the primary developer for S+FinMetrics and related S-PLUS
modules for financial engineering.


Duties and Responsibilities:

* Design and implement new functionality in C/C++, S-PLUS, and other
languages as needed.  Create unit tests.  Write help files and other
documentation.

* Project and program management for the financial engineering modules, in
collaboration with the Software Engineering Manager and Product Manager.  

* Contribute to the identification of technical requirements to meet market
needs.  Develop technical specifications and work plans.

* Provide second-tier support for financial engineering questions. 
 

Qualifications 

Education and Training:  M.S. or Ph.D. degree required in computer science,
computational finance, or a related field.


Specialized Knowledge and Skills:

* Experience in computational finance.  Areas of focus include financial
econometrics, valuation, risk, portfolio optimization, and time series
databases. 

* Experience creating production-quality code in C/C++ required.  Experience
with other languages such as S-PLUS, Fortran, Java, and Matlab highly
beneficial.

* Experience in numerical analysis, statistical computing, and optimization.
Familiar with accuracy, stability, and convergence issues in computation.

* Strong software engineering practices.  Experience with source control
systems, defect tracking systems, unit test frameworks, and similar tools.
Strong time management and organization skills.  Self-directed.

WORK ENVIRONMENT/ PHYSICAL DEMANDS: General office environment.  Ability to
lift computer equipment is required.  Position located in Seattle,
Washington.


Contact Info 
 
Please send a resume and cover letter to: 

Human Resources
Insightful Corporation
1700 Westlake Ave North, 5th Floor
Seattle, WA 98109-3044
Or email (text, MS Word or PDF) to [EMAIL PROTECTED]

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


RE: [R] (no subject)

2005-05-04 Thread Francisco J. Zagmutt
You can search on this forum for different discussions on this topic. Also, 
there are 2 somehow outdated publications comparing different software 
including SAS, SPSS and S-Plus, which might be of some use for you.  The 
references are:

McCullough, B. D. (1998), "Assessing the reliability of statistical
software: Part I", The American Statistician, 52,  358-366.
McCullough, B. D. (1999), "Assessing the reliability of statistical
software: Part II", The American Statistician, 53,149-159.
I hope this helps
Francisco
From: "rene.raupp" <[EMAIL PROTECTED]>
To: "r-help" 
Subject: [R] (no subject)
Date: Tue,  3 May 2005 16:52:34 -0300
Does anybory knows any work comparing R with other (charged) statistical 
softwares (like Minitab, SPSS, SAS)?
I work in a brasilian government bureau and I intend to use R as our 
preferable statistical software, but I have to show it's as good as the 
others. I also intend to use Weka, and for this one I have the same 
problem.
Can anyone help me?
Thanks
René M. Raupp
e-mail: [EMAIL PROTECTED]
[EMAIL PROTECTED]

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


Re: [R] Huynh-Feldt R vs SAS Bug

2005-05-04 Thread Peter Dalgaard
Bela Bauer <[EMAIL PROTECTED]> writes:

> Hi,
> 
> I'm using anova.mlm sphericity tests/corrections, and I'm getting
> different values than SAS. In order to be able to use these values for
> publications, I'd need to know more about the SAS bug that is
> mentioned in the Reference Manual.
> - What exactly causes the different values?
> - Is it just a slight difference, or can I expect significant
> differences in H-F/G-G epsilons and corrected p-Values? With the data
> sets I'm using, the SAS value for H-F epsilon is almost twice the
> value from R, and I'm wondering if there's a mistake on my side or if
> it is just caused by the SAS bug.
> 
> Thanks for any hints...

R has

HF.eps <- ((n + 1) * pp * GG.eps - 2)/(pp * (n - pp * GG.eps))

where n is the degrees of freedom for the SSD matrix and pp is the
dimension after transformation. As far as I could fathom from the SAS
output, SAS is using

(N * pp * GG.eps - 2)/(pp * (n - pp * GG.eps))

which coincides with the above when n == N - 1. This suggests that
whoever coded up the SAS version generalised (N - 1) in the
denominator to DF but not the N in the numerator.

Some fairly simple invariance considerations show that the SAS formula
cannot be right - it's a bias correction for GG.eps which is
calculated from the eigenvalues of the SSD, and the distribution of
the SSD depends on degrees of freedom only.

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

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

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


[R] Questions about the intersection area under two kernel densities

2005-05-04 Thread Grace Clinton
Hi there,
 
I am working on a project which needs the value of the interaction area under 
two distributions( eatimated by kernel density estimators).
 
For example:
 
x<-rnorm(100,0,1)
y<-rnorm(100,0.2,1)
density(x) # This produces the summary of dependent variable and independent 
variable.
 
How can I get the individual values of variables and reform a curve to 
calculate the area under curve?
 
Is there a way to get aroud this and give me the solution?
 
 
Thanks a lot.
 
Grace 
 
 



-


[[alternative HTML version deleted]]

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


RE: [R] rank of a matrix

2005-05-04 Thread Ravi Varadhan
For the example that Duncan just gave, using the "matrix.rank" function of
Spencer Graves (which uses singular value decomposition) I obtained the
following result:

> exponent <- -(7:16)
> eps <- 10^exponent
> sapply(eps,mat=h9times4,function(x,mat)matrix.rank(mat,x))
 [1] 6 7 7 8 8 9 9 9 9 9

This tells me that the correct rank should be 9, since the rank stabilizes
for smaller tolerances.  I realize that this may not work generally, and one
could create counter-examples to defeat this strategy.

Best,
Ravi.

--
Ravi Varadhan, Ph.D.
Assistant Professor,  The Center on Aging and Health
Division of Geriatric Medicine and Gerontology
Johns Hopkins University
Ph: (410) 502-2619
Fax: (410) 614-9625
Email:  [EMAIL PROTECTED]
--
> -Original Message-
> From: [EMAIL PROTECTED] [mailto:r-help-
> [EMAIL PROTECTED] On Behalf Of Duncan Murdoch
> Sent: Wednesday, May 04, 2005 3:32 PM
> To: Gabor Grothendieck
> Cc: mingan; r-help@stat.math.ethz.ch; Huntsinger,Reid
> Subject: Re: [R] rank of a matrix
> 
> Gabor Grothendieck wrote:
> > In this case, try a lower tolerance (1e-7 is the default):
> >
> >
> >>qr(hilbert(9), tol = 1e-8)$rank
> >
> > [1] 9
> 
> But don't trust the results.  For example, create a matrix with 4
> identical copies of hilbert(9).  This still has rank 9.  It's hard to
> find, though:
> 
>  > h9 <- hilbert(9)
>  > temp <- cbind(h9, h9)
>  > h9times4 <- rbind(temp, temp)
>  >
>  > qr(h9times4,tol=1e-7)$rank
> [1] 7
>  > qr(h9times4, tol=1e-8)$rank
> [1] 10
>  > qr(h9times4, tol=1e-9)$rank
> [1] 11
>  > qr(h9times4, tol=1e-10)$rank
> [1] 12
> 
> 
> There's a tolerance that gives the right answer (1.5e-8 works for me),
> but how would I know that in a real problem where I didn't already know
> the answer?
> 
> Duncan Murdoch
> 
> __
> R-help@stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-
> guide.html

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


[R] Density of the sum of two random variables

2005-05-04 Thread Paul Smith
Dear All

I would like to know whether it is possible with R to get the
mathematical expression of the density of a sum of two independent
continuous random variables.

Thanks in advance,

Paul

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


Re: [R] Questions about the intersection area under two kernel densities

2005-05-04 Thread Rich FitzJohn
Hi,

A "density" object's x and y values can be accessed using $x and $y
(this is in ?density, under "Value:")

obj <- density(rnorm(100, 0, 1))
obj$x
obj$y

You may find it useful to force the "from" and "to" arguments to be
the same for the two calls to density(), if you want to work directly
from the x and y values.

x <- rnorm(100, 0, 1)
y <- rnorm(100, .2, 1)
dx <- density(x)
dy <- density(y)

## Re-do the densities so they have the same x-values:
lim <- range(dx$x, dy$x)
dx <- density(x, from=lim[1], to=lim[2])
dy <- density(y, from=lim[1], to=lim[2])

plot(dx, col="blue", ylim=range(dx$y, dy$y))
lines(dy, col="red")
polygon(dx$x, pmin(dx$y, dy$y), col="purple")

Cheers,
Rich

On 5/5/05, Grace Clinton <[EMAIL PROTECTED]> wrote:
> Hi there,
> 
> I am working on a project which needs the value of the interaction area under 
> two distributions( eatimated by kernel density estimators).
> 
> For example:
> 
> x<-rnorm(100,0,1)
> y<-rnorm(100,0.2,1)
> density(x) # This produces the summary of dependent variable and independent 
> variable.
> 
> How can I get the individual values of variables and reform a curve to 
> calculate the area under curve?
> 
> Is there a way to get aroud this and give me the solution?
> 
> Thanks a lot.
> 
> Grace
> 
> -
> 
>[[alternative HTML version deleted]]
> 
> __
> R-help@stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
> 


-- 
Rich FitzJohn
rich.fitzjohn  gmail.com   |http://homepages.paradise.net.nz/richa183
  You are in a maze of twisty little functions, all alike

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


Re: [R] rank of a matrix

2005-05-04 Thread Gabor Grothendieck
One could also examine the eigenvalues themselves:

plot(log(abs(sort(-eigen(h9times4, T, T)$values

shows a graph with a definite gap between 9 and 10 suggesting
that 9 is the right number.  

On 5/4/05, Ravi Varadhan <[EMAIL PROTECTED]> wrote:
> For the example that Duncan just gave, using the "matrix.rank" function of
> Spencer Graves (which uses singular value decomposition) I obtained the
> following result:
> 
> > exponent <- -(7:16)
> > eps <- 10^exponent
> > sapply(eps,mat=h9times4,function(x,mat)matrix.rank(mat,x))
> [1] 6 7 7 8 8 9 9 9 9 9
> 
> This tells me that the correct rank should be 9, since the rank stabilizes
> for smaller tolerances.  I realize that this may not work generally, and one
> could create counter-examples to defeat this strategy.
> 
> Best,
> Ravi.
> 
> --
> Ravi Varadhan, Ph.D.
> Assistant Professor,  The Center on Aging and Health
> Division of Geriatric Medicine and Gerontology
> Johns Hopkins University
> Ph: (410) 502-2619
> Fax: (410) 614-9625
> Email:  [EMAIL PROTECTED]
> --
> > -Original Message-
> > From: [EMAIL PROTECTED] [mailto:r-help-
> > [EMAIL PROTECTED] On Behalf Of Duncan Murdoch
> > Sent: Wednesday, May 04, 2005 3:32 PM
> > To: Gabor Grothendieck
> > Cc: mingan; r-help@stat.math.ethz.ch; Huntsinger,Reid
> > Subject: Re: [R] rank of a matrix
> >
> > Gabor Grothendieck wrote:
> > > In this case, try a lower tolerance (1e-7 is the default):
> > >
> > >
> > >>qr(hilbert(9), tol = 1e-8)$rank
> > >
> > > [1] 9
> >
> > But don't trust the results.  For example, create a matrix with 4
> > identical copies of hilbert(9).  This still has rank 9.  It's hard to
> > find, though:
> >
> >  > h9 <- hilbert(9)
> >  > temp <- cbind(h9, h9)
> >  > h9times4 <- rbind(temp, temp)
> >  >
> >  > qr(h9times4,tol=1e-7)$rank
> > [1] 7
> >  > qr(h9times4, tol=1e-8)$rank
> > [1] 10
> >  > qr(h9times4, tol=1e-9)$rank
> > [1] 11
> >  > qr(h9times4, tol=1e-10)$rank
> > [1] 12
> >
> >
> > There's a tolerance that gives the right answer (1.5e-8 works for me),
> > but how would I know that in a real problem where I didn't already know
> > the answer?
> >
> > Duncan Murdoch
> >
> > __
> > R-help@stat.math.ethz.ch mailing list
> > https://stat.ethz.ch/mailman/listinfo/r-help
> > PLEASE do read the posting guide! http://www.R-project.org/posting-
> > guide.html
>

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


[R] Help with R

2005-05-04 Thread Angus Repper
Hello

 

I am a long-time SAS user, but am new to R. I specifically am looking for
information pertaining to generating graphics for web output. I would like
to create dynamic graphics (in the form of generalized reports)  for my web
site that is written with php and mysql. Is 'R' capable of doing this? I
heard that 'R' does not do a very good job at handling large datasets, is
this true? 

 

Also, is there anybody that knows someone who is an expert at this and can
show me examples? I would be very much appreciative.

 

Thanks

 

Angus Repper

[EMAIL PROTECTED]

610-203-1325

   

 


[[alternative HTML version deleted]]

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


Re: [R] Double hurdle model in R

2005-05-04 Thread Simon Blomberg
http://pscl.stanford.edu/content.html has code 
for poisson and negative binomial hurdle models, 
as well as for zip models. Package zicounts on 
CRAN may also be of interest.

HTH,
Simon.

I am interested in utilizing this so called "double hurdle" model
in my study. We can write the model in the following way:
if (z'a + u > 0 & x'b + e > 0) y = x'b + e, else y = 0
In the model, consumption y is the (left-) censored dependent variable. e
and u are the normally distributed error terms. z'a is the participation
equation and x'b is the expenditure equation. If we would remove the
participation equation from the model we would end up with a type I
tobit-model.
In the tobit-model the same set of paprameters and variables determine
both the discrete probability of non-zero outcome and the level of
positive expenditure. In the double-hurdle-model we have separate
parametrization of the participation and consumption decisions.
I can estimate tobit-model using function survreg(). But what about this
double hurdle thing? Has somebody written a R-function for estimating this
sort of a model?
Best regards,
Kyösti Kurikka
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

--
Simon Blomberg, B.Sc.(Hons.), Ph.D, M.App.Stat.
Visiting Fellow
School of Botany & Zoology
The Australian National University
Canberra ACT 0200
Australia
T: +61 2 6125 8057  email: [EMAIL PROTECTED]
F: +61 2 6125 5573
CRICOS Provider # 00120C
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] [R-pkgs] Bayesian Model Averaging (BMA) R Package available

2005-05-04 Thread Adrian Raftery
Bayesian Model Averaging (BMA) R Package available
Free software to carry out Bayesian Model Averaging (BMA) 
in R is now available at
http://cran.us.r-project.org/src/contrib/Descriptions/BMA.html
BMA is a way of taking account of uncertainty about
the form of the model used by averaging across the models
considered. The package includes BMA software for linear
regression, generalized linear models and survival analysis,
as well as various plotting routines for visualizing the BMA output.

Adrian Raftery
 ---
 Adrian E. Raftery
 Professor of Statistics and Sociology
 Director, Center for Statistics and the Social Sciences
 University of Washington, Box 354320Phone: (206) 543-4505
 Seattle, WA 98195-4320. FAX:   (206) 221-6873
 Web: http://www.stat.washington.edu/raftery
 ---
___
R-packages mailing list
[EMAIL PROTECTED]
https://stat.ethz.ch/mailman/listinfo/r-packages
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html