[R] bayesm, rmnlIndepMetrop

2006-02-08 Thread Tetyana Stepanchuk
Hi,

I tried to use rmnlIndepMetrop (bayesm package) for my MNL model with 4
choice alternatives, 5 independent variables, 69 observations,

dim(X) [1] 276   5, nu=6. So I run such code:

 

if(nchar(Sys.getenv(LONG_TEST)) != 0) {R=2000} else {R=10}

set.seed(66)

df=read.table(X_metrop.dat,header=TRUE)

inp=as.matrix(df)

y=as.numeric(inp[,1])

n=length(y)

p=4

nvar=ncol(X)

X=cbind(1,inp[,2:5])

XTXI=chol2inv(chol(crossprod(X)))

bhat=XTXI%*%t(X)%*%y

#create X matrix with dim nobs*p x nvar

index=1:n

index2=rep(index,p)

index3=sort(index2)

X=X[index3,]

beta=array(bhat,dim=c(nvar))

A=diag(c(rep(.01,length(beta;

betabar=rep(0,length(beta))

Data=list(y=y,X=X,p=p);

Mcmc=list(R=R,keep=1) ;

Prior=list(A=A,betabar=betabar)

out=rmnlIndepMetrop(Data=Data,Prior=Prior,Mcmc=Mcmc)

 

Ouput:

Starting Independence Metropolis Sampler for Multinomial Logit Model

  with  4  alternatives

 

Prior Parms: 

betabar

[1] 0 0 0 0 0

A

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

[1,] 0.01 0.00 0.00 0.00 0.00

[2,] 0.00 0.01 0.00 0.00 0.00

[3,] 0.00 0.00 0.01 0.00 0.00

[4,] 0.00 0.00 0.00 0.01 0.00

[5,] 0.00 0.00 0.00 0.00 0.01

 

MCMC parms: 

R=  10  keep=  1  nu (df for st candidates) =  6

Mistake in chol(mhess) : the leading Minor of the order 1 is not positive
defined

 

By debugging: debug(rmnlIndepMetrop)

rmnlIndepMetrop(Data=Data,Prior=Prior,Mcmc=Mcmc)

beta

[1]  1.46867390 -0.52889086  0.23710427  0.00188178  0.06021696

mhess=mnlHess(y,X,beta)

 mhess

   X0 X0.1 X0.2 X0.3

 0  0000

X0   0  0000

X0.1 0  0000

X0.2 0  0000

X0.3 0  0000

 

chol(mhess)

Mistake in chol(mhess) : the leading Minor of the order 1 is not positive
defined

 

Is something wrong with my data? But I tried another dataset and got the
same mistake.

Whether everybody knows how I could manage it? 

I have no ideas anymore(.

Thank you in advance,

Tatjana

 

---

Tetyana Stepanchuk

Department of Electronic Commerce 

Johann Wolfgang Goethe-University 

Mertonstrasse 17 

D-60054, Frankfurt/Main

Germany

phone: +49 069 798 22380

http://www.ecommerce.wiwi.uni-frankfurt.de

 


[[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] difference between rnorm(1000, 0, 1) and running rnorm(500, 0, 1) twice

2006-02-08 Thread Romain Francois
Le 08.02.2006 04:21, Taka Matzmoto a écrit :

Hi R users

This looks a simple question

Is there any difference between between rnorm(1000,0,1) and running 
rnorm(500,0,1) twice in terms of outcome ?

TM
  

Not here :

R set.seed(1)
R x - rnorm(1000, 0, 1)
R set.seed(1)
R y - rnorm(500, 0, 1)
R z - rnorm(500, 0, 1)
R all(x == c(y,z))
[1] TRUE

Romain

-- 
visit the R Graph Gallery : http://addictedtor.free.fr/graphiques
mixmod 1.7 is released : http://www-math.univ-fcomte.fr/mixmod/index.php
+---+
| Romain FRANCOIS - http://francoisromain.free.fr   |
| Doctorant INRIA Futurs / EDF  |
+---+

__
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] ARULES -- Filtering Rules by RHS

2006-02-08 Thread Markus Preisetanz
Dear Colleagues,

 

I would like to only inspect rules that contain a certain label substring on 
the rhs. In this special case the item labels are built like this:

itemtype_itemvalue e.g. Artikelgruppe_E0815 what I want to do is only 
show rules where Artikelgruppe is contained in the rhs - has anybody an idea 
how this could work?

 

Sincerely

 

___

Markus Preisetanz

Consultant

 

Client Vela GmbH

Albert-Roßhaupter-Str. 32

81369 München

fon:  +49 (0) 89 742 17-113

fax:  +49 (0) 89 742 17-150

mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] 



Diese E-Mail enthält vertrauliche und/oder rechtlich geschützte Informationen. 
Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrtümlich erhalten 
haben, informieren Sie bitte sofort den Absender und vernichten Sie diese Mail. 
Das unerlaubte Kopieren sowie die unbefugte Weitergabe dieser E-Mail ist nicht 
gestattet.

This e-mail may contain confidential and/or privileged infor...{{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] difference between rnorm(1000, 0, 1) and running rnorm(500, 0, 1) twice

2006-02-08 Thread Philippe Grosjean
Romain Francois wrote:
 Le 08.02.2006 04:21, Taka Matzmoto a écrit :
 
 
Hi R users

This looks a simple question

Is there any difference between between rnorm(1000,0,1) and running 
rnorm(500,0,1) twice in terms of outcome ?

TM
 

 
 Not here :
 
 R set.seed(1)
 R x - rnorm(1000, 0, 1)
 R set.seed(1)
 R y - rnorm(500, 0, 1)
 R z - rnorm(500, 0, 1)
 R all(x == c(y,z))
 [1] TRUE
 
 Romain

Indeed! The pseudo-random number generator is initialized at the same 
state, and thus, returns the same 1000 pseudo-random numbers in both 
cases. So, no differences.
Best,

Philippe Grosjean

__
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] Graphics Package -- stars()

2006-02-08 Thread Markus Preisetanz
Dear Collegues,

 

does anybody know how I can place a legend at a sensible position in a star 
diagram automatically? The legend should tell the name of the variable (from 
colnames) for every color used.

 

Sincerely, Markus

 

 

___

Markus Preisetanz

Consultant

 

Client Vela GmbH

Albert-Roßhaupter-Str. 32

81369 München

fon:  +49 (0) 89 742 17-113

fax:  +49 (0) 89 742 17-150

mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] 



Diese E-Mail enthält vertrauliche und/oder rechtlich geschützte Informationen. 
Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrtümlich erhalten 
haben, informieren Sie bitte sofort den Absender und vernichten Sie diese Mail. 
Das unerlaubte Kopieren sowie die unbefugte Weitergabe dieser E-Mail ist nicht 
gestattet.

This e-mail may contain confidential and/or privileged infor...{{dropped}}

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

[R] How to install the server version of rpad

2006-02-08 Thread Seyed Reza Jafarzadeh
Hi,

How can I install the server version of rpad on a website. I have read
the instructions in http://www.rpad.org/Rpad/ServerNotes.html, but
could not figure out how. Do I have to have something like Apache on
the website? Is there any instructions in addition to those on
http://www.rpad.org/Rpad/.

Thanks,
- Reza

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

2006-02-08 Thread Mahdi Osman
Hi list,


I am fitting microarray data (intensity) model using the lme package in R
environment. I have 5 fixed variables in the model. One of the fixed
variables is genes. I am trying to get p-values for  different genes. But I
am getting only one p-value for all genes together. I can get a list of
p-value when I run lm. Why can't this work in lme?

My aim is to do multiple comaprison of all the genes that I have and I can
only do this if I have a list of their p-vales


I was wondering if you can help me solve this problem. That is getting
a list of p-value for each gene in the model using the lme.


Thanks in advance for your help


Regards



Mahdi 

-- 
---
Mahdi Osman (PhD)
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] difference between rnorm(1000, 0, 1) and running rnorm(500, 0, 1) twice

2006-02-08 Thread Bjørn-Helge Mevik
Why don't you test it yourself?

E.g.,

set.seed(42)
bob1 - rnorm(1000,0,1)
set.seed(42)
bob2 - rnorm(500,0,1)
bob3 - rnorm(500,0,1)
identical(bob1, c(bob2, bob3))

I won't tell you the answer. :-)

-- 
Bjørn-Helge Mevik

__
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] problem with maptree

2006-02-08 Thread Hector Villalobos Ortiz
Hello,

I'm trying to draw a simplified tree of a cluster object 
with maptree, but I get an error message:

 class(vars.agn)
[1] agnes twins

 draw.clust (clip.clust (vars.agn, k=5))
Error in names-.default(`*tmp*`, value = c(merge, 
height, order,'names' attribute [8] must be the same 
length as the vector [7]

Trying converting first to object of class hclust:

 draw.clust (clip.clust (as.hclust(vars.agn), k=5))
Error in split(x, f) : first argument must be a vector

But conversion seems to work fine:

 vars.hclust=as.hclust(vars.agn)
 vars.hclust

Call:
agnes(x = daisy(vars.cluster), diss = TRUE, method = 
ward)

Cluster method   : ward
Number of objects: 295


 draw.clust (clip.clust (vars.hclust, k=5))
Error in split(x, f) : first argument must be a vector


A previous version of maptree successfully clipped the 
three from the same data. Any orientation will be greatly 
appreciated.
Thank you in advance.

-- 
Héctor Villalobos [EMAIL PROTECTED]
  IPN-CICIMAR. A.P. 592. Col. Centro
  La Paz, Baja California Sur, MÉXICO. 23000

__
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] Bloomberg Data Import to R

2006-02-08 Thread Sumanta Basak
 

Hi R-Experts,

 

Can anyone tell me how Bloomberg data can be directly downloaded to R?
Is there any package?

Sumanta Basak.


---
This e-mail may contain confidential and/or privileged infor...{{dropped}}

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


[R] rotating axis / mtext labels

2006-02-08 Thread Iain Gallagher
Hello list.

Is it possible to use par(srt=45) to rotate text by 45 degrees along the 
x-axis of a plot. Using:

code

x_names-c(C57 Nv, C57 Vacc, 129 Nv, 129 Vacc, IFNgR Nv, IFNgR Vacc)
par(srt=45)
mtext(font=2, x_names, side=1, line=1, at=l, cex=1.2)
par(srt=0)

/code

doesn't seem to work in R 2.2.0 on SUSE linux.

Suggestions would be appreciated thanks.

Iain

__
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] Reference for R

2006-02-08 Thread Sara Mouro
Hello!

 

Could anyone please tell me how should I include R in a text section for
References?

 

Regards,

Sara Mouro


[[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] Reference for R

2006-02-08 Thread Johan Sandblom
citation()

2006/2/8, Sara Mouro [EMAIL PROTECTED]:
 Hello!



 Could anyone please tell me how should I include R in a text section for
 References?



 Regards,

 Sara Mouro


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



--
Johan Sandblom  N8, MRC, Karolinska sjh
t +46851776108  17176 Stockholm
m +46735521477  Sweden
What is wanted is not the will to believe, but the
will to find out, which is the exact opposite
- Bertrand Russell

__
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] Reference for R

2006-02-08 Thread IAIN GALLAGHER
Hi Sara.

From the R faq here:
http://cran.r-project.org/doc/FAQ/R-FAQ.html#Citing-R

2.8 Citing R

To cite R in publications, use

 @Manual{,
   title= {R: A Language and Environment
for Statistical
   Computing},
   author   = {{R Development Core Team}},
   organization = {R Foundation for Statistical
Computing},
   address  = {Vienna, Austria},
   year = 2005,
   note = {{ISBN} 3-900051-07-0},
   url  = {http://www.R-project.org}
 }

Citation strings (or BibTeX entries) for R and R
packages can also be obtained by citation(). 

Cheers

Iain

--- Sara Mouro [EMAIL PROTECTED] wrote:

 Hello!
 
  
 
 Could anyone please tell me how should I include R
 in a text section for
 References?
 
  
 
 Regards,
 
 Sara Mouro
 
 
   [[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] large lines of data

2006-02-08 Thread Sara Mouro
Dear All,

 

I have to enter many lines of data in the same object.

I usually use copy-paste to transfer data from an Word file to R.

But, for large lines of data, R gets confused and gives an error message,
i.e. it breaks one line somewhere, and lines get no meaning at all.

 

Some times I solve that problem adding enters and making each line
shorter, before I do copy-paste. Some times I add spaces in the word
document, until R breaks each line (automatically adds a +) in any point
where it still correct..

But it stills too subjective for me!   :o\

 

What is the best way to do that?

 

 

Regards,

Sara Mouro


[[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] large lines of data

2006-02-08 Thread Barry Rowlingson
Sara Mouro wrote:
 Dear All,
 
  
 
 I have to enter many lines of data in the same object.
 
 I usually use copy-paste to transfer data from an Word file to R.
 

 What is the best way to do that?

  Use 'Save As' to save your Word file - or rather just the data section 
- as a plain text or Ascii file. Then read into R with scan() or 
read.table() as appropriate.


Barry

__
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] large lines of data

2006-02-08 Thread Sean Davis



On 2/8/06 6:55 AM, Sara Mouro [EMAIL PROTECTED] wrote:

 Dear All,
 
  
 
 I have to enter many lines of data in the same object.
 
 I usually use copy-paste to transfer data from an Word file to R.
 
 But, for large lines of data, R gets confused and gives an error message,
 i.e. it breaks one line somewhere, and lines get no meaning at all.
 
  
 
 Some times I solve that problem adding enters and making each line
 shorter, before I do copy-paste. Some times I add spaces in the word
 document, until R breaks each line (automatically adds a +) in any point
 where it still correct..
 
 But it stills too subjective for me!   :o\
 
  
 
 What is the best way to do that?

I assume you mean that you are editing code and then pasting into R.  If
so, you might look into using one of several editors that work with R.
Look in the mail archives for some of these.

Sean

__
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] (second round) creating a certain type of matrix

2006-02-08 Thread Adaikalavan Ramasamy
I cleaned up your function a bit but please double check

 generate.matrix - function(nr, runs=5){

   h   - nr/2## half of nr
   nc  - nr/10 + 1

   mat - matrix(0, nr, nc)   ## initialize
   
   mat[ ,1] - c( rep(1, h), rnorm(h) )   ## 1st column
   mat[ (h+1):(h+5), 2] - rnorm(5)   ## 2nd column
  
   if( nc  3 ){
for (i in 3:nc){  ## column 3 - end

  start -  h + 5*(i-2) + 1
  end   -  start + runs - 1

  mat[ start:end, i] - rnorm( runs )
}
   }
   return(mat)
 } 


However you can simplify this greatly. If you ignore the first column
(which looks like some initialisation column in simulation process),
then you have a matrix with nr/2 rows and nr/10 columns with diagonal
blocks 5 runs filled with rnorm values. Here is what I propose :


 gen.mat - function(x, runs=5){

   if( (x %% 2*runs)!=0 ) stop(x,  is not a multiple of , 2*runs)

   nr  - x/2   
   nc  - x/(2*runs)

   mat - matrix(0, nr, nc)  
   for (i in 1:nc) mat[ ((i-1)*runs + 1) : (i*runs), i ] - rnorm(runs)
  
   down - cbind( rnorm(nr), mat )
   top  - cbind( 1, matrix( 0, nr=nr, nc=nc ) )
   out  - rbind( top, down )
  
   return(out)
 }

# Examples 
 gen.mat(50)
 gen.mat(55) ## should generate an error
 gen.mat(24, runs=6)


Does this function do what you want to ?

Regards, Adai





On Tue, 2006-02-07 at 11:03 -0600, Taka Matzmoto wrote:
 Hi R users
 Here is what I got with help from Petr Pikal (Thanks Petr Pikal). I modified 
 Petr Pikal's code to a little
 to meet my purpose.
 
 I created a function to generate a matrix
 
 generate.matrix-function(n.variable)
 {
 mat-matrix(0,n.variable,(n.variable/2)/5+1) #matrix of zeroes
 dd-dim(mat) # actual dimensions
 mat[1:(dd[1]/2),1]-1 #put 1 in first half of first column
 mat[((dd[1]/2)+1):dd[1],1]-rnorm(dd[1]/2,0,1) #put random numbers in 
 following part of the matrix column 1
 mat[((dd[1]/2)+1):((dd[1]/2)+5),2]-rnorm(5,0,1) #put random numbers in 
 column2
 for (i in 3:(dd[2]))
 {
 length.of.rand.numbers - 5
 my.rand.num- rnorm(length.of.rand.numbers, 0,1)
 start - dd[1]/2+5*(i-2)+1
 end - start + length.of.rand.numbers-1
 mat[((start):end), i]- my.rand.num
 }
 mat
 }
 
 Do you (any R users) have any suggestion to this function to make this 
 function work better or efficiently?
 
 Taka
 It works but I
 
 From: Petr Pikal [EMAIL PROTECTED]
 To: Taka Matzmoto [EMAIL PROTECTED],r-help@stat.math.ethz.ch
 Subject: Re: [R] creating a certain type of matrix
 Date: Tue, 07 Feb 2006 08:58:59 +0100
 MIME-Version: 1.0
 Received: from mail.precheza.cz ([80.188.29.243]) by 
 bay0-mc8-f13.bay0.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Mon, 6 
 Feb 2006 23:59:02 -0800
 Received: from localhost (localhost [127.0.0.1])by mail.precheza.cz 
 (Mailer) with ESMTP id A636C34E584;Tue,  7 Feb 2006 08:59:00 +0100 (CET)
 Received: from mail.precheza.cz ([127.0.0.1])by localhost (mail.precheza.cz 
 [127.0.0.1]) (amavisd-new, port 10024)with LMTP id 28608-02-30; Tue, 7 Feb 
 2006 08:58:59 +0100 (CET)
 Received: from n1en1.precheza.cz (smtp.precheza.cz [192.168.210.31])by 
 mail.precheza.cz (Mailer) with ESMTP id 35E8634E582;Tue,  7 Feb 2006 
 08:58:59 +0100 (CET)
 Received: from pikal ([192.168.210.65])  by n1en1.precheza.cz 
 (Lotus Domino Release 6.5.4FP2)  with ESMTP id 2006020708585800-252 
 ;  Tue, 7 Feb 2006 08:58:58 +0100 X-Message-Info: 
 JGTYoYF78jEHjJx36Oi8+Z3TmmkSEdPtfpLB7P/ybN8=
 X-Confirm-Reading-To: Petr Pikal [EMAIL PROTECTED]
 X-pmrqc: 1
 Return-Receipt-To: Petr Pikal [EMAIL PROTECTED]
 Priority: normal
 X-mailer: Pegasus Mail for Windows (4.21c)
 X-MIMETrack: Itemize by SMTP Server on SRVDomino/PRECHEZA(Release 6.5.4FP2 
 | September 26, 2005) at 07.02.2006 08:58:58,Serialize by Router on 
 SRVDomino/PRECHEZA(Release 6.5.4FP2 | September 26, 2005) at 07.02.2006 
 08:58:58,Serialize complete at 07.02.2006 08:58:58
 X-Virus-Scanned: by amavisd-new-20030616-p10 (Debian) at precheza.cz
 Return-Path: [EMAIL PROTECTED]
 X-OriginalArrivalTime: 07 Feb 2006 07:59:03.0289 (UTC) 
 FILETIME=[5C87D690:01C62BBC]
 
 Hi
 
 as only you know perfectly which halves and other portions of your
 matrices contain zeroes and which contain random numbers you has to
 finalize the function yourself.
 Here are few ideas.
 
 n-20
 mat-matrix(0,n,(n/2)/5+1) #matrix of zeroes
 dd-dim(mat) # actual dimensions
 mat[1:(dd[1]/2),1]-1 #put 1 in first half of first column
 mat[((dd[1]/2)+1):dd[1],1]-rnorm(dd[1]/2,0,1) #put random numbers in
 following part of the matrix column 1
 mat[((dd[1]/2)+1):(dd[1]/2)+dd[1]/4,2]-rnorm(dd[1]/4,0,1) #put
 random numbers in column2
 
 than according to n and dd values you can put any numbers anywhere in
 your matrix e.g. in for loop (not.tested :-)
 
 for (i in 3:dd[2]) {
 
 arrange everything into following desired columns
 e.g.
 
 length.of.rand.numbers - (i-2)*5
 my.rand.num- 

Re: [R] large lines of data

2006-02-08 Thread Adaikalavan Ramasamy
How does the data look and how are you storing in R (e.g. matrix, list)?

I think this an issue related to Word where it is using either unequal
spaces or different carriage returns. I would not recommend storing
data, especially numerical ones in the form of a matrix, in Word files. 

I would recommend that you try to copy-and-paste into Excel first and
clean it up there. Next save the file as tab delimited and use
read.delim() in R. 

My experience is that that Excel seems understands the oddities of Word
better than R does.

Regards, Adai


On Wed, 2006-02-08 at 11:55 +, Sara Mouro wrote:
 Dear All,
 
  
 
 I have to enter many lines of data in the same object.
 
 I usually use copy-paste to transfer data from an Word file to R.
 
 But, for large lines of data, R gets confused and gives an error message,
 i.e. it breaks one line somewhere, and lines get no meaning at all.
 
  
 
 Some times I solve that problem adding enters and making each line
 shorter, before I do copy-paste. Some times I add spaces in the word
 document, until R breaks each line (automatically adds a +) in any point
 where it still correct..
 
 But it stills too subjective for me!   :o\
 
  
 
 What is the best way to do that?
 
  
 
 
 
 Regards,
 
 Sara Mouro
 
 
   [[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] rotating axis / mtext labels

2006-02-08 Thread Uwe Ligges
Iain Gallagher wrote:

 Hello list.
 
 Is it possible to use par(srt=45) to rotate text by 45 degrees along the 
 x-axis of a plot. Using:
 
 code
 
 x_names-c(C57 Nv, C57 Vacc, 129 Nv, 129 Vacc, IFNgR Nv, IFNgR 
 Vacc)
 par(srt=45)
 mtext(font=2, x_names, side=1, line=1, at=l, cex=1.2)
 par(srt=0)
 
 /code
 
 doesn't seem to work in R 2.2.0 on SUSE linux.
 
 Suggestions would be appreciated thanks.


mtext does not support string rotation. You can rather use text() with 
par(xpd=TRUE) if you need it.

Uwe Ligges

 Iain
 
 __
 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 help

2006-02-08 Thread Adaikalavan Ramasamy
Please read the posting 
1) I think BioConductor mailing list might be better as some of these
could be implemented via LIMMA (I believe)
2) Provide sufficient information and perhaps a simple example.

Regards, Adai



On Wed, 2006-02-08 at 10:42 +0100, Mahdi Osman wrote:
 Hi list,
 
 
 I am fitting microarray data (intensity) model using the lme package in R
 environment. I have 5 fixed variables in the model. One of the fixed
 variables is genes. I am trying to get p-values for  different genes. But I
 am getting only one p-value for all genes together. I can get a list of
 p-value when I run lm. Why can't this work in lme?
 
 My aim is to do multiple comaprison of all the genes that I have and I can
 only do this if I have a list of their p-vales
 
 
 I was wondering if you can help me solve this problem. That is getting
 a list of p-value for each gene in the model using the lme.
 
 
 Thanks in advance for your help
 
 
 Regards
 
 
 
 Mahdi 


__
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] Mixture normal distribution

2006-02-08 Thread aleid2001
Dear R helper,


I hope that u can help me to sort out my problem
because I sent an E-mail last night to R-list but I
have not receive any help and at the same time I think
this problem is not so hard.

I have used the following functions before 

 K-10
 prime-c(2,3,5,7,11,13,17)
 UN-seq(1:K)%*%t(sqrt(prime))
 U1-UN-as.integer(UN)
 U-matrix(qnorm(U1),K,7)
 U

[,1][,2][,3][,4]  
 [,5]   [,6]
 [1,] -0.2167193  0.61902728 -0.71900806  0.37387492
-0.47715805  0.2677426
 [2,]  0.9479680 -0.09010569 -0.06990169 -0.54900030 
0.34047235 -0.8026015
 [3,] -0.6978334 -0.85544499  0.54814530  1.53212280 
1.64363675  0.9026864
 [4,]  0.4038929  1.46253909  1.59168198  0.20958766
-0.62343558 -0.1962555
 [5,] -1.4678844  0.41315654 -0.91407055 -0.74294809 
0.20989183 -1.9148412
 [6,] -0.0369025 -0.27331681 -0.21109168  1.14796196 
1.28012119  0.3406266
 [7,]  1.2786790 -1.15348516  0.39201340  0.05080407
-0.78449952 -0.7099779
 [8,] -0.4853656  1.06431267  1.21882042 -0.97005119 
0.08280907  1.0127500
 [9,]  0.6065405  0.22357828 -1.15223725  0.88440727 
1.03481830 -0.1257587
[10,] -1.0707736 -0.46627852 -0.35664238 -0.10670096
-0.96909898 -1.5936006
 [,7]
 [1,] -1.15960110
 [2,] -0.68646092
 [3,] -0.33366316
 [4,] -0.01899511
 [5,]  0.29375681
 [6,]  0.63913903
 [7,]  1.08816734
 [8,]  2.16601566
 [9,] -1.23750068
[10,] -0.73537275


Now I want instead of using (qnorm) the inverse of
slandered normal distribution, I want to use the
mixture of normal distribution, and also, I want to
know how to read the data to txt file.


Many thanks for your help in advance.

Al-Eid




___ 
Win a BlackBerry device from O2 with Yahoo!. Enter now. 
http://www.yahoo.co.uk/blackberry

__
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] Application of R

2006-02-08 Thread Adaikalavan Ramasamy
No Excel attachment came through. 

Just taking a guess here but there seems to be very little variation the
columns V10 till column V23.

BTW, can you not issue the following call :

 mydata[ , 1:7] ~ mydata[ , 8] + mydata[ ,9]

instead of creating y1, y2, ... separately then cbind-ing them ?

Regards, Adai




On Tue, 2006-02-07 at 21:52 +0800, Andy Wong wrote:
 I have applied the R and MNP to carry out the data analysis.  However, there
 is an error called SWP : singular matrix.  Can someone tell me what is the
 problem of my formula or the file mydata.
 
 I have attached the data file mydata in Excel format and the result
 printed in pdf format for your information.
 
 Thanks for your advice.
 __
 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] difference between rnorm(1000, 0, 1) and running rnorm(500, 0, 1) twice

2006-02-08 Thread Duncan Murdoch
On 2/8/2006 4:53 AM, Bjørn-Helge Mevik wrote:
 Why don't you test it yourself?
 
 E.g.,
 
 set.seed(42)
 bob1 - rnorm(1000,0,1)
 set.seed(42)
 bob2 - rnorm(500,0,1)
 bob3 - rnorm(500,0,1)
 identical(bob1, c(bob2, bob3))
 
 I won't tell you the answer. :-)

This isn't really something that can be proved by a test.  Perhaps the 
current implementation makes those equal only because 500 is even, or 
divisible by 5, or whatever...

I think the intention is that those should be equal, but in a quick 
search I've been unable to find a documented guarantee of that.  So I 
would take a defensive stance and assume that there may be conditions 
where c(rnorm(m), rnorm(n)) is not equal to rnorm(m+n).

If someone can point out the document I missed, I'd appreciate it.

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] How to install the server version of rpad

2006-02-08 Thread roger bos
Reza,

Yes, you will need Apache and Perl already installed, then follow the
install notes you linked to above.  I tried for a long time to get it to
work with Microsoft IIS and could not for the life of me, but when I tried
it with Apache 2.0 it worked pretty easily.  I have never set up a web
server before either, so I was pretty confused.  Just install Apache and
Perl and following the instructions, then set permissions on all the Rpad
and perl files so they can be ran by everyone.  If it doesn't work, just
keep playing with the configuation file until it does.

Thanks,

Roger


On 2/8/06, Seyed Reza Jafarzadeh [EMAIL PROTECTED] wrote:

 Hi,

 How can I install the server version of rpad on a website. I have read
 the instructions in http://www.rpad.org/Rpad/ServerNotes.html, but
 could not figure out how. Do I have to have something like Apache on
 the website? Is there any instructions in addition to those on
 http://www.rpad.org/Rpad/.

 Thanks,
 - Reza

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


[[alternative HTML version deleted]]

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


Re: [R] lme syntax for PB examples

2006-02-08 Thread Doran, Harold
Paul:

It is a little difficult to understand what you are trying to translate
since you do not show what the model would look like using lme. If you
show lme, then it is easy to translate into lmer syntax.

A few thoughts, first, use lmer in the Matrix package and not in lme4.
Second, see the Bates article in R news at the link below for dealing
with nesting structures. Last, a colleague and I have a paper in press
showing how to fit models using lme which we submitted a year or so ago.
Since lme has evolved to lmer, we created an appendix that translates
all of our lme models to the lmer syntax so readers can see
equivalences. I am happy to send this to you (or others) upon request.

http://cran.r-project.org/doc/Rnews/Rnews_2005-1.pdf

Harold


 

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Paul Cossens
Sent: Wednesday, February 08, 2006 12:08 AM
To: r-help@stat.math.ethz.ch
Subject: [R] lme syntax for PB examples

Hi helpeRs,
 
I've been working through some examples in Pinhiero  Bates( 2000)
trying to understand how to translate to the new Lme4 syntax but without
much luck.
Below is what I think I should do, but either the answers don't come out
the same or I get errors. 
In the Oxide problems I'm particularly interested in obtaining the
levels coeficients but this options no longer seems to be available in
lme4. How can levels infor be obtained in lme4?
 
If someone can recreate the examples below in lme4 syntax so I can
follow what is happening in the text I'd be grateful. 
 
Cheers
 
Paul Cossens
 
 
#Pixel
# PB(2000) p40-45
 
Pixel-read.csv(Pixel.csv,header=TRUE);
Pixel$Side-as.factor(Pixel$Side)
Pixel$Dog-as.factor(Pixel$Dog)
 
(fm1Pixel - lmer(pixel ~ day + I(day^2) +(day|Dog)+(1|Side), data =
Pixel))
(fm2Pixel - lmer(pixel ~ day + I(day^2) +(day|Dog), data = Pixel))
(fm3Pixel - lmer(pixel ~ day + I(day^2) +(1|Dog:Side), data = Pixel))
or should I do it this way?
Pixel$DS-with(Pixel,Dog:Side)[drop=TRUE]
(fm3Pixel - lmer(pixel ~ day + I(day^2) +(1|DS), data = Pixel))
 
(fm4Pixel - lmer(pixel ~ day + I(day^2) +Side , data = Pixel))
 

#Oxide
# PB(2000) p167-170
 
Oxide-read.csv(Oxide.csv,header=TRUE);
Oxide$Source-as.factor(Oxide$Source)
Oxide$Lot-as.factor(Oxide$Lot)
Oxide$Wafer-as.factor(Oxide$Wafer)
Oxide$Site-as.factor(Oxide$Site)
fm1Oxide-lmer(Thickness~ (1|Lot)+(1|Lot:Wafer),data=Oxide) )
(fm2Oxide-lmer(Thickness~ (1|Lot),data=Oxide) )
coef(fm1Oxide)

[[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] Bloomberg Data Import to R

2006-02-08 Thread Pfaff, Bernhard Dr.
Hello Sumanto,

your question might be more appropriately been posted to the R-sig-finance
list:

[EMAIL PROTECTED] (I have cc'ed this mail to this list).

To my knowledge neither a function nor a CRAN-package does exist. However,
on the last useR! conference Dirk Edelbuettel presented a proprietary
package that utilised the C API of Bloomberg (type WAPI GO on a Bloomberg
terminal). I am not sure whether Dirk is nowadays inclined or allowed by his
employee to share this package.

As an alternative, you could download data from Bloomberg into Excel, first
(assuming that you are working in a Windows environment) and then load it
into R via RODBC, for example.

Cheers,
Bernhard



Hi R-Experts,

 

Can anyone tell me how Bloomberg data can be directly downloaded to R?
Is there any package?

Sumanta Basak.



---
This e-mail may contain confidential and/or privileged infor...{{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
*
Confidentiality Note: The information contained in this mess...{{dropped}}

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


[R] nested random effects in glmm.admb

2006-02-08 Thread Jarrod Hadfield
Hello all,

In a previous posting regarding glmm.admb it is stated that glmm.admb 
can handle 2 nested random effects.   I can only fit a single random 
term at the moment, and wondered if anyone could  provide me with some 
information on how to specify  a model with 2 (nested or 
cross-classified) random terms?

Thanks,

Jarrod.

__
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] rotating axis / mtext labels

2006-02-08 Thread Marc Schwartz
On Wed, 2006-02-08 at 10:33 +, Iain Gallagher wrote:
 Hello list.
 
 Is it possible to use par(srt=45) to rotate text by 45 degrees along the 
 x-axis of a plot. Using:
 
 code
 
 x_names-c(C57 Nv, C57 Vacc, 129 Nv, 129 Vacc, IFNgR Nv, IFNgR 
 Vacc)
 par(srt=45)
 mtext(font=2, x_names, side=1, line=1, at=l, cex=1.2)
 par(srt=0)
 
 /code
 
 doesn't seem to work in R 2.2.0 on SUSE linux.
 
 Suggestions would be appreciated thanks.
 
 Iain


See R FAQ 7.27 How can I create rotated axis labels:

http://cran.r-project.org/doc/FAQ/R-FAQ.html#How-can-I-create-rotated-axis-labels_003f

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] difference between rnorm(1000, 0, 1) and running rnorm(5

2006-02-08 Thread Ted Harding
On 08-Feb-06 Duncan Murdoch wrote:
 On 2/8/2006 4:53 AM, Bjørn-Helge Mevik wrote:
 Why don't you test it yourself?
 
 E.g.,
 
 set.seed(42)
 bob1 - rnorm(1000,0,1)
 set.seed(42)
 bob2 - rnorm(500,0,1)
 bob3 - rnorm(500,0,1)
 identical(bob1, c(bob2, bob3))
 
 I won't tell you the answer. :-)
 
 This isn't really something that can be proved by a test.  Perhaps the 
 current implementation makes those equal only because 500 is even, or 
 divisible by 5, or whatever...
 
 I think the intention is that those should be equal, but in a quick 
 search I've been unable to find a documented guarantee of that.  So I 
 would take a defensive stance and assume that there may be conditions 
 where c(rnorm(m), rnorm(n)) is not equal to rnorm(m+n).
 
 If someone can point out the document I missed, I'd appreciate it.
 
 Duncan Murdoch

On my understanding, once the seed is set the sequence generated
by the underlying RNG is determined, whether it is the result of
a single call to produce a long sequence or multiple calls to
generate many shorter sequences. Example:

 set.seed(42)
 multi-numeric(20)
 set.seed(42)
 single-rnorm(20)
 set.seed(42)
 for(i in (1:20)) multi[i]-rnorm(1)
 print(max(multi-single),digits=22)
[1] 0
 print(min(multi-single),digits=22)
[1] 0

In other words: identical!

Whether there are possible exceptions, in some implementations
of rdist where dist is other than norm, has to be answered
by people who are familiar with the internals of these functions.

Best wishes to all,
Ted.





E-Mail: (Ted Harding) [EMAIL PROTECTED]
Fax-to-email: +44 (0)870 094 0861
Date: 08-Feb-06   Time: 13:26:10
-- 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] Mixture normal distribution

2006-02-08 Thread Brian D Ripley
We did get your previous message.  See the posting guide about what to do
if you do not get an answer.

See MASS4, chapter 16 (and see the FAQ for what MASS4 is) for fitting
mixtures of normals and testing their fit.

 I want to know how to read the data to txt file.

What does that mean?  (You 'read from' or 'write to'.)

On Wed, 8 Feb 2006 [EMAIL PROTECTED] wrote:

 Dear R helper,


 I hope that u can help me to sort out my problem
 because I sent an E-mail last night to R-list but I
 have not receive any help and at the same time I think
 this problem is not so hard.

 I have used the following functions before

  K-10
  prime-c(2,3,5,7,11,13,17)
  UN-seq(1:K)%*%t(sqrt(prime))
  U1-UN-as.integer(UN)
  U-matrix(qnorm(U1),K,7)
  U

 [,1][,2][,3][,4]
  [,5]   [,6]
  [1,] -0.2167193  0.61902728 -0.71900806  0.37387492
 -0.47715805  0.2677426
  [2,]  0.9479680 -0.09010569 -0.06990169 -0.54900030
 0.34047235 -0.8026015
  [3,] -0.6978334 -0.85544499  0.54814530  1.53212280
 1.64363675  0.9026864
  [4,]  0.4038929  1.46253909  1.59168198  0.20958766
 -0.62343558 -0.1962555
  [5,] -1.4678844  0.41315654 -0.91407055 -0.74294809
 0.20989183 -1.9148412
  [6,] -0.0369025 -0.27331681 -0.21109168  1.14796196
 1.28012119  0.3406266
  [7,]  1.2786790 -1.15348516  0.39201340  0.05080407
 -0.78449952 -0.7099779
  [8,] -0.4853656  1.06431267  1.21882042 -0.97005119
 0.08280907  1.0127500
  [9,]  0.6065405  0.22357828 -1.15223725  0.88440727
 1.03481830 -0.1257587
 [10,] -1.0707736 -0.46627852 -0.35664238 -0.10670096
 -0.96909898 -1.5936006
  [,7]
  [1,] -1.15960110
  [2,] -0.68646092
  [3,] -0.33366316
  [4,] -0.01899511
  [5,]  0.29375681
  [6,]  0.63913903
  [7,]  1.08816734
  [8,]  2.16601566
  [9,] -1.23750068
 [10,] -0.73537275


 Now I want instead of using (qnorm) the inverse of
 slandered normal distribution, I want to use the
 mixture of normal distribution, and also, I want to
 know how to read the data to txt file.


 Many thanks for your help in advance.

 Al-Eid


-- 
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] difference between rnorm(1000, 0, 1) and running rnorm(500, 0, 1) twice

2006-02-08 Thread Brian D Ripley
On Wed, 8 Feb 2006, Duncan Murdoch wrote:

 On 2/8/2006 4:53 AM, Bj?rn-Helge Mevik wrote:
  Why don't you test it yourself?
 
  E.g.,
 
  set.seed(42)
  bob1 - rnorm(1000,0,1)
  set.seed(42)
  bob2 - rnorm(500,0,1)
  bob3 - rnorm(500,0,1)
  identical(bob1, c(bob2, bob3))
 
  I won't tell you the answer. :-)

 This isn't really something that can be proved by a test.  Perhaps the
 current implementation makes those equal only because 500 is even, or
 divisible by 5, or whatever...

 I think the intention is that those should be equal, but in a quick
 search I've been unable to find a documented guarantee of that.  So I
 would take a defensive stance and assume that there may be conditions
 where c(rnorm(m), rnorm(n)) is not equal to rnorm(m+n).

 If someone can point out the document I missed, I'd appreciate it.

It's various source files in R_HOME/src/main.

Barring bugs, they will be the same.  As you know

R is free software and comes with ABSOLUTELY NO WARRANTY.


-- 
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] lme question

2006-02-08 Thread Dieter Menne
Mahdi Osman m_osm at gmx.net writes:

 
 Hi list,
 
 I am fitting microarray data (intensity) model using the lme package in R
 environment. I have 5 fixed variables in the model. One of the fixed
 variables is genes. I am trying to get p-values for  different genes. But I
 am getting only one p-value for all genes together. I can get a list of
 p-value when I run lm. Why can't this work in lme?
 
 I was wondering if some one can help me solve this problem. That is getting
 a list of p-value for each gene in the model using the lme.
 

The bioconductor list might be a better place for this question, and an example 
would haven been welcome. So my only guess is: could it be that  you forgot to 
make genes a factor variable? When genes is a number, you get a linear 
regression which is probably not what you want.


Dieter

__
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] print formula on plot

2006-02-08 Thread Thomas Steiner
I estimate some parameters and I want to print them (pretty) on my plot:

# somehow estimated parameters
z-c(1.543523e+00, 1.23453e+00, 3.454000e+00)

x-seq(-1,1,length=100)
plot(x,z[3]*x^2+z[2]*x+z[3],type=l, main=My nice plot of the
estimated function)
zs-format(z,digits=4,scientific=FALSE,trim=TRUE)

text(-0.9,7,expression(1.54*x^2))   # is what I want,
but DYNAMIC
text(-0.9,6,expression(paste(zf[1],x^3))) # not really
text(-0.9,5,expression(paste(toSting(zf[1]),x^3)))  # not really
#using z (double) instead of zf (string) does not help.

So my question is:
How do I evaluate zf[1] from the variable to it's (String) value? Here
it is used within an expression: this makes all the trouble.

Thanks for help, I tried 2 hrs now...
Thomas

__
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] print formula on plot

2006-02-08 Thread Thomas Steiner
I found it immediately after posting :(

substitute is my friend:

text(0.5,5,substitute(f[Sv] ==k*x^2, list(k=zf[1])))

__
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 rnorm(1000, 0, 1) and running rnorm(500, 0, 1) twice

2006-02-08 Thread Duncan Murdoch
On 2/8/2006 8:30 AM, Brian D Ripley wrote:
 On Wed, 8 Feb 2006, Duncan Murdoch wrote:
 
 On 2/8/2006 4:53 AM, Bj�rn-Helge Mevik wrote:
  Why don't you test it yourself?
 
  E.g.,
 
  set.seed(42)
  bob1 - rnorm(1000,0,1)
  set.seed(42)
  bob2 - rnorm(500,0,1)
  bob3 - rnorm(500,0,1)
  identical(bob1, c(bob2, bob3))
 
  I won't tell you the answer. :-)

 This isn't really something that can be proved by a test.  Perhaps the
 current implementation makes those equal only because 500 is even, or
 divisible by 5, or whatever...

 I think the intention is that those should be equal, but in a quick
 search I've been unable to find a documented guarantee of that.  So I
 would take a defensive stance and assume that there may be conditions
 where c(rnorm(m), rnorm(n)) is not equal to rnorm(m+n).

 If someone can point out the document I missed, I'd appreciate it.
 
 It's various source files in R_HOME/src/main.
 
 Barring bugs, they will be the same.  As you know
 
   R is free software and comes with ABSOLUTELY NO WARRANTY.

I didn't mean guarantee in the sense of warranty, just guarantee in the 
sense that if someone found a situation where they weren't equal, we 
would consider it a bug and fix it or document it as an exception.

Should we add a statement to the RNG man page or manuals somewhere that 
says this is the intention?

For others who aren't as familiar with the issues as Brian: this isn't 
necessarily a good idea.  We have a lot of RNGs, and it's fairly easy to 
write one so that this isn't true.  For example, the Box-Muller method 
naturally generates pairs of normals; a naive implementation would just 
throw one away at the end if asked for an odd number.  (Ours doesn't do 
that.)

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] font size/disappearing labels

2006-02-08 Thread Karin Lagesen

I am using vioplot to make nice boxplots, which I am outputting to
postscript. I am using the paper=special and width and height to get
the graphs to look nice. I do however have a problem with the size of
the labels and titles. When I set fontsize as an option to the
postscript call too high, one of the labels disappear, although there
is enough space for it (imo, that is). This I have understood is an
effect of the system trying to avoid overlapping numbers. Is there a
way I can override this function though? Can I force it to show all of
the labels, although they might be too close?

Karin
-- 
Karin Lagesen, PhD student
[EMAIL PROTECTED]
http://www.cmbn.no/rognes/

__
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] Using R to process spectroscopic data

2006-02-08 Thread Bjørn-Helge Mevik
Dirk De Becker wrote:

 * Determine the range of the spectrum to be used - For this, I should 
 be able to calculate the regression coefficients

You can get the regression coefficients from a PLSR/PCR with the
coef() function.  See ?coef.mvr  However, using the regression
coefficients alone for selecting variables/regions, can be 'dangerous'
because the variables are highly correlated.

One alternative is 'variable importance' measures, e.g. VIP (variable
importance in projections) as described in Chong, Il-Gyo  Jun,
Chi-Hyuck, 2005, Performance of some variable selection methods when
multicollinearity is present, Chemometrics and Intelligent Laboratory
Systems 78, 103--112.  A crude implementation of VIP can be found in
http://mevik.net/work/software/pls.html

Another alternative is to use jackknife-estimated uncertainties of the
regression coefficients in significance tests.  (I don't have any
reference or implementation, sorry. :-)

The correlation loadings can also give valuable information about
which variables that might be important for the regression.  See
?corrplot in the pls package.

-- 
Bjørn-Helge Mevik

__
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] dataframe subset

2006-02-08 Thread Bernhard Baumgartner
I have a dataframe with a column, say x consisting of values, each 
value appearing different times, e.g.
x: 1,1,1,1,2,2,4,4,4,9,10,10,10,10,10 ...
and a vector, including e.g.:
y: 2,9,10,...
I need a subset of the dataframe: all rows where x is equal to one of 
the values in y. Currently I use a loop for this, but because x and y 
are large this is very slow. 
Is there any idea how to solve this problem faster?
Thank you,
Bernhard

__
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] print formula on plot

2006-02-08 Thread Robert Baer
Only put the expression inside the expression?

 plot(x,z[3]*x^2+z[2]*x+z[3],type=l, main=My nice plot)
 text(-0.9,5,paste(zs[1],' ',expression(x^3)))  # should work


Robert W. Baer, Ph.D.
Associate Professor
Department of Physiology
A. T. Still University of Health Science
800 W. Jefferson St.
Kirksville, MO 63501-1497 USA
- Original Message - 
From: Thomas Steiner [EMAIL PROTECTED]
To: r-help@stat.math.ethz.ch
Sent: Wednesday, February 08, 2006 7:47 AM
Subject: [R] print formula on plot


 I estimate some parameters and I want to print them (pretty) on my plot:

 # somehow estimated parameters
 z-c(1.543523e+00, 1.23453e+00, 3.454000e+00)

 x-seq(-1,1,length=100)
 plot(x,z[3]*x^2+z[2]*x+z[3],type=l, main=My nice plot of the
 estimated function)
 zs-format(z,digits=4,scientific=FALSE,trim=TRUE)

 text(-0.9,7,expression(1.54*x^2))   # is what I want,
 but DYNAMIC
 text(-0.9,6,expression(paste(zf[1],x^3))) # not really
 text(-0.9,5,expression(paste(toSting(zf[1]),x^3)))  # not really
 #using z (double) instead of zf (string) does not help.

 So my question is:
 How do I evaluate zf[1] from the variable to it's (String) value? Here
 it is used within an expression: this makes all the trouble.

 Thanks for help, I tried 2 hrs now...
 Thomas

 __
 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] print formula on plot

2006-02-08 Thread Gabor Grothendieck
Also see ?bquote

On 2/8/06, Thomas Steiner [EMAIL PROTECTED] wrote:
 I found it immediately after posting :(

 substitute is my friend:

 text(0.5,5,substitute(f[Sv] ==k*x^2, list(k=zf[1])))

 __
 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] print formula on plot

2006-02-08 Thread Thomas Steiner
  text(-0.9,5,paste(zs[1],' ',expression(x^3)))  # should work

this produces a 2x^3 and not 2xsuperscript(3) - just execute it and
you see what I mean. anyway, substitute helps and bquote could shorten
it a bit.
Anywa thanks!
Thomas

__
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] dataframe subset

2006-02-08 Thread Duncan Murdoch
On 2/8/2006 9:21 AM, Bernhard Baumgartner wrote:
 I have a dataframe with a column, say x consisting of values, each 
 value appearing different times, e.g.
 x: 1,1,1,1,2,2,4,4,4,9,10,10,10,10,10 ...
 and a vector, including e.g.:
 y: 2,9,10,...
 I need a subset of the dataframe: all rows where x is equal to one of 
 the values in y. Currently I use a loop for this, but because x and y 
 are large this is very slow. 
 Is there any idea how to solve this problem faster?

It's actually very easy.  Assume your dataframe is df, then

subset(df, x %in% y)

will give you what you want (assuming there is no column y in the 
dataframe).

Duncan Murdoch

 Thank you,
 Bernhard
 
 __
 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] dataframe subset

2006-02-08 Thread Chuck Cleland
Bernhard Baumgartner wrote:
 I have a dataframe with a column, say x consisting of values, each 
 value appearing different times, e.g.
 x: 1,1,1,1,2,2,4,4,4,9,10,10,10,10,10 ...
 and a vector, including e.g.:
 y: 2,9,10,...
 I need a subset of the dataframe: all rows where x is equal to one of 
 the values in y. Currently I use a loop for this, but because x and y 
 are large this is very slow. 
 Is there any idea how to solve this problem faster?

mydata - data.frame(X = sample(1:10, 1, replace=TRUE),
  Y = sample(c(2,9,10), 1, replace=TRUE))

newdata - mydata[mydata$X %in% unique(mydata$Y),]

?%in%

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

__
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: dataframe subset

2006-02-08 Thread Guazzetti Stefano
Dear Bernhard,
if I understand correctly your question
may be you want something like

 df-data.frame(x=sample(1:10, 100, repl=T), 
y=sample(1:5, 100, repl=T))
 subset(df, x%in%y)

Regards, 

Stefano

   -Messaggio originale-
   Da: [EMAIL PROTECTED]
   [mailto:[EMAIL PROTECTED] conto di Bernhard
   Baumgartner
   Inviato: 08 February 2006 15:22
   A: r-help@stat.math.ethz.ch
   Oggetto: [R] dataframe subset
   
   
   I have a dataframe with a column, say x consisting of 
   values, each 
   value appearing different times, e.g.
   x: 1,1,1,1,2,2,4,4,4,9,10,10,10,10,10 ...
   and a vector, including e.g.:
   y: 2,9,10,...
   I need a subset of the dataframe: all rows where x is equal 
   to one of 
   the values in y. Currently I use a loop for this, but 
   because x and y 
   are large this is very slow. 
   Is there any idea how to solve this problem faster?
   Thank you,
   Bernhard
   
   __
   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] dataframe subset

2006-02-08 Thread Adaikalavan Ramasamy
Sounds like you may need no use match().

On Wed, 2006-02-08 at 15:21 +0100, Bernhard Baumgartner wrote:
 I have a dataframe with a column, say x consisting of values, each 
 value appearing different times, e.g.
 x: 1,1,1,1,2,2,4,4,4,9,10,10,10,10,10 ...
 and a vector, including e.g.:
 y: 2,9,10,...
 I need a subset of the dataframe: all rows where x is equal to one of 
 the values in y. Currently I use a loop for this, but because x and y 
 are large this is very slow. 
 Is there any idea how to solve this problem faster?
 Thank you,
 Bernhard
 
 __
 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] dataframe subset

2006-02-08 Thread Petr Pikal
Hi

something like

xx-data.frame(x=sample(1:10,100,replace=T))
y-c(2,5,8)
xx[xx$x%in%y,]

HTH
Petr



On 8 Feb 2006 at 15:21, Bernhard Baumgartner wrote:

From:   Bernhard Baumgartner [EMAIL PROTECTED]
Organization:   Universitaet Regensburg
To: r-help@stat.math.ethz.ch
Date sent:  Wed, 08 Feb 2006 15:21:46 +0100
Priority:   normal
Subject:[R] dataframe subset

 I have a dataframe with a column, say x consisting of values, each
 value appearing different times, e.g. x:
 1,1,1,1,2,2,4,4,4,9,10,10,10,10,10 ... and a vector, including e.g.:
 y: 2,9,10,... I need a subset of the dataframe: all rows where x is
 equal to one of the values in y. Currently I use a loop for this, but
 because x and y are large this is very slow. Is there any idea how to
 solve this problem faster? Thank you, Bernhard
 
 __
 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

Petr Pikal
[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] Compiling errors for Matrix_0.995-5.tar.gz under XP

2006-02-08 Thread White, Charles E WRAIR-Wash DC
I installed the MinGW-5.0.0 compilers today (gcc-3.4.2 is now contained in the 
'Current' distribution. When the current compilers failed to compile the 
referenced Matrix update and not knowing how to check the exact version numbers 
for individual files, I applied the Id.exe and f771.exe fixes from the 
'Building R for Windows' page 
(http://www.murdoch-sutherland.com/Rtools/#ldbug). More compiler errors were 
obtained. I then checked my Pearl version (5.8.7) and updated my R tools since 
I couldn't tell how old they were. At that point, I obtained the following 
output:


C:\Documents and Settings\Whitece.AMED\My Documents\1 Pocket Office\R Repository
\lme4rcmd install matrix_0.995-5.tar.gz

latex: not found
latex: not found
latex: not found

-- Making package matrix 
latex: not found
  adding build stamp to DESCRIPTION
latex: not found
  installing NAMESPACE file and metadata
latex: not found
  running src/Makefile.win ...
latex: not found
make[3]: `Matrix.dll' is up to date.
  ... done
  installing DLL
latex: not found
  installing R files
latex: not found
  installing inst files
FIND: Parameter format not correct
make[2]: *** [C:/PROGRA~1/R/R-22~1.1/library/matrix/inst] Error 2
make[1]: *** [all] Error 2
make: *** [pkg-matrix] Error 2
*** Installation of matrix failed ***

Removing 'C:/PROGRA~1/R/R-22~1.1/library/matrix'
Restoring previous 'C:/PROGRA~1/R/R-22~1.1/library/matrix'

If I need to read one of R's many friendly manuals, I'd appreciate a reference 
to which one and approximately which section.

Thanks.

Chuck

Charles E. White, Senior Biostatistician, MS
Walter Reed Army Institute of Research
503 Robert Grant Ave., Room 1w102
Silver Spring, MD 20910-1557
301 319-9781
Personal/Professional Site: http://users.starpower.net/cwhite571/professional/

__
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] dataframe subset

2006-02-08 Thread Bernhard Baumgartner
Thanks to all,

the %in% function solved my problem!

Bernhard

__
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] dataframe subset

2006-02-08 Thread bogdan romocea
Here's one way,
  x - data.frame(V=c(1,1,1,1,2,2,4,4,4,9,10,10,10,10,10))
  y - data.frame(V=c(2,9,10))
  xy - merge(x,y,all=FALSE)
Pay close attention to what happens if you have duplicate values in y, say
  y - data.frame(V=c(2,9,10,10))


 -Original Message-
 From: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED] On Behalf Of
 Bernhard Baumgartner
 Sent: Wednesday, February 08, 2006 9:22 AM
 To: r-help@stat.math.ethz.ch
 Subject: [R] dataframe subset

 I have a dataframe with a column, say x consisting of values, each
 value appearing different times, e.g.
 x: 1,1,1,1,2,2,4,4,4,9,10,10,10,10,10 ...
 and a vector, including e.g.:
 y: 2,9,10,...
 I need a subset of the dataframe: all rows where x is equal to one of
 the values in y. Currently I use a loop for this, but because x and y
 are large this is very slow.
 Is there any idea how to solve this problem faster?
 Thank you,
 Bernhard

 __
 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] difference between rnorm(1000, 0, 1) and running rnorm(500, 0, 1) twice

2006-02-08 Thread Peter Dalgaard
Duncan Murdoch [EMAIL PROTECTED] writes:

 This isn't really something that can be proved by a test.  Perhaps the 
 current implementation makes those equal only because 500 is even, or 
 divisible by 5, or whatever...
 
 I think the intention is that those should be equal, but in a quick 
 search I've been unable to find a documented guarantee of that.  So I 
 would take a defensive stance and assume that there may be conditions 
 where c(rnorm(m), rnorm(n)) is not equal to rnorm(m+n).
 
 If someone can point out the document I missed, I'd appreciate it.

I think it's a fair assumption that *uniform* random numbers have the
property, since these are engines that produce a continuous stream of
values, of which we select the next n and m values. 

As long as the normal.kind (see ?RNGkind) is Inversion, we can be
sure that the property carries to rnorm, but it might not be the case
for other methods. In particular the ones that generate normal
variates in batches are suspect. However, empirically, I can't seem to
provoke the effect with any of R's built-in generators. One *could* of
course check the source code and see whether there is state
information being kept between invokations...

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

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


Re: [R] ARULES -- Filtering Rules by RHS

2006-02-08 Thread Seth Falcon
On  8 Feb 2006, [EMAIL PROTECTED] wrote:
 I would like to only inspect rules that contain a certain label
 substring on the rhs. In this special case the item labels are built
 like this:

 itemtype_itemvalue e.g. Artikelgruppe_E0815 what I want to do
 is only show rules where Artikelgruppe is contained in the rhs -
 has anybody an idea how this could work?

I think there is a rhs() method you can use to get an itemMatrix
instance containing just the RHS.  Then one options might be something
like (untested):

isets - LIST(items(rhs(foo)))

lapply(isets, function(x) grep(Artikelgruppe, isets))

oop, I just realized: do you mean RHS of the association rule or RHS
of the foo_bar?

hth,

+ 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] logLik == -Inf in gls

2006-02-08 Thread nhy303
I am trying to fit a generalised least squares model using gls in the nlme
package.

The model seems to fit very well when I plot the fitted values against the
original

values, and the model parameters have quite narrow confidence intervals
(all are

significant at p5%).

The problem is that the log likelihood is always given as -Inf.  This
doesn't seem to make sense because the model seems to fit my data so well.
 I have checked that the residuals are stationary using an adf test.  I
can't work out whether
  - the model really doesn't fit at all
  - there is something in my data that stops the implementation of logLik
working correctly (the -Inf value says the calculation hasn't worked)

Possible causes are:
  - There are lots of NAs in my data (model and response variables)
  - There is some autocorrelation in the data that is not accounted for by
the model (most is accounted for).

But, I've tried recreating the problem using a simpler data set, and have
never found the same problem.

The command I use to fit the model is...



result2 - gls(lci4150 ~ propCapInStomachs +
temperature +
as.factor(monthNumber) +
lagLci1 +
lagcap1 +
lagcap2,
  data = monthly,
  subset = subset1985,
  na.action = na.approx,
  weights = varFixed( ~ 1/numob4150)
 )



The output I get is...



Generalized least squares fit by REML
  Model: lci4150 ~ propCapInStomachs + temperature + as.factor(monthNumber) +

lagLci1 + lagcap1 + lagcap2
  Data: monthly
  Subset: subset1985
  AIC BIC logLik
  Inf Inf   -Inf

Variance function:
 Structure: fixed weights
 Formula: ~1/numob4150

Coefficients:
  Value Std.Error   t-value p-value
(Intercept)  -0.3282412 0.5795665 -0.566356  0.5717
propCapInStomachs 0.0093283 0.0039863  2.340107  0.0202
temperature   0.4342514 0.1526104  2.845490  0.0048
as.factor(monthNumber)2   0.3990717 0.3869991  1.031195  0.3036
as.factor(monthNumber)3   1.3788334 0.3675690  3.751223  0.0002
as.factor(monthNumber)4   1.4037195 0.3857764  3.638686  0.0003
as.factor(monthNumber)5   0.9903316 0.3436177  2.882074  0.0043
as.factor(monthNumber)6   0.3453741 0.3043698  1.134719  0.2577
as.factor(monthNumber)7   0.3948442 0.3035142  1.300909  0.1946
as.factor(monthNumber)8   0.5021812 0.3532413  1.421638  0.1565
as.factor(monthNumber)9  -0.0794319 0.3598981 -0.220707  0.8255
as.factor(monthNumber)10  0.3536805 0.3790538  0.933061  0.3518
as.factor(monthNumber)11  0.7874834 0.3557116  2.213826  0.0278
as.factor(monthNumber)12  0.1854279 0.3178320  0.583415  0.5602
lagLci1   0.5488437 0.0576144  9.526151  0.
lagcap1   0.0110994 0.0043669  2.541714  0.0117
lagcap2  -0.0088080 0.0041099 -2.143127  0.0332



Does anyone have any suggestions of how I can get a meaningful value for
logLik?  Or some other way that I can compare models.

Thankyou for your help,

Lillian.

-- 
Lillian Sandeman
PhD Student
School of Biological Sciences
University of Aberdeen
AB24 2TZ

Tel.: 01224 272648
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] Logistic regression - confidence intervals

2006-02-08 Thread Cox, Stephen
Please forgive a rather naïve question... 

Could someone please give a quick explanation for the differences in conf 
intervals achieved via confint.glm (based on profile liklihoods) and the 
intervals achieved using the Design library.

For example, the intervals in the following two outputs are different.

library(Design)
x = rnorm(100)
y = gl(2,50)
d = data.frame(x = x, y = y)
dd = datadist(d); options(datadist = 'dd')
m1 = lrm(y~x, data = d)
summary(m1)

m2 = glm(y~x, family = binomial, data = d)
confint(m2)

I have spent time trying to figure this out via archives, but have not had much 
luck.

Regards

Stephen

__
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] Changing labels on the scale of image.plot(fields)

2006-02-08 Thread Camarda, Carlo Giovanni
Dear R-Users,
I am searching a way of changing the labels of the scale of a image.plot
function in library(fields). Taking the following example I would like
to add my own labels on the right side of the scale and it would be nice
to decide also where to have the ticks.
In this particular template I am sending you, I would like to have on
the scale my.labels instead of 0,5,10...30.
Thanks in advance,
Carlo Giovanni Camarda

A - matrix(1:20, ncol=4)
my.breaks - c(0,6,8,10,12,14,30)
my.colors - c(black, green, blue, red, yellow, pink)
my.labels - c( , LETTERS[1:5],  )
library(fields)
image.plot(A, breaks=my.breaks, col=my.colors, zlim=range(my.breaks))

+
This mail has been sent through the MPI for Demographic Rese...{{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] difference between rnorm(1000, 0, 1) and running rnorm(500, 0, 1) twice

2006-02-08 Thread Prof Brian Ripley

On Wed, 8 Feb 2006, Duncan Murdoch wrote:


On 2/8/2006 8:30 AM, Brian D Ripley wrote:
On Wed, 8 Feb 2006, Duncan Murdoch wrote:
 On 2/8/2006 4:53 AM, Bjÿÿrn-Helge Mevik wrote:

 Why don't you test it yourself?
  E.g.,   set.seed(42)  bob1 - rnorm(1000,0,1)  set.seed(42)  bob2 - rnorm(500,0,1)  
bob3 - rnorm(500,0,1)  identical(bob1, c(bob2, bob3))   I won't tell you the answer. :-)



This isn't really something that can be proved by a test.  Perhaps the
current implementation makes those equal only because 500 is even, or
divisible by 5, or whatever...
I think the intention is that those should be equal, but in a quick
search I've been unable to find a documented guarantee of that.  So I
would take a defensive stance and assume that there may be conditions
where c(rnorm(m), rnorm(n)) is not equal to rnorm(m+n).

If someone can point out the document I missed, I'd appreciate it.

 It's various source files in R_HOME/src/main.
 Barring bugs, they will be the same.  As you know
R is free software and comes with ABSOLUTELY NO WARRANTY.


I didn't mean guarantee in the sense of warranty, just guarantee in the 
sense that if someone found a situation where they weren't equal, we 
would consider it a bug and fix it or document it as an exception.


Should we add a statement to the RNG man page or manuals somewhere that 
says this is the intention?


I think that is part of the sense of `no warranty': we allow ourselves to 
change anything which is not documented, and so things are as a result 
deliberately not documented.


For others who aren't as familiar with the issues as Brian: this isn't 
necessarily a good idea.  We have a lot of RNGs, and it's fairly easy to 
write one so that this isn't true.  For example, the Box-Muller method 
naturally generates pairs of normals; a naive implementation would just 
throw one away at the end if asked for an odd number.  (Ours doesn't do 
that.)


I think we should allow future methods to do things like that, and 
preferably document that they do them.


--
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] Logistic regression model selection with overdispersed/autocorrelated data

2006-02-08 Thread Jesse . Whittington

Thanks for pointing out the aod package and the beta-binomial logistic
models Renaud.

While I see how betabinom could be applied to some of our other analyses ,
I don't see how it can be used in our habitat selection analysis where
individual locations are coded as 0 or 1 rather than proportions.  Gee
models (geeglm from geepack) could be used for our analyses.  Even though
these models are fit using maximum likelihood estimation, they do not solve
our model selection problem.

Beta-coefficients from gee, glm, glmm's, and lrm are nearly identical.  The
only thing that varies is the variance-covariance matrix and the resulting
standard errors.  Consequently, the deviances should be similar because
predicted values (p) are calculated from the beta-coefficients.  For an
individual data point, the loglikelihood = y * log(p) + (1 - y) * log(1-p)
and the deviance = -2 * sum(loglikelihoods).  Consequently, the difference
in deviance between two models is amplified by autocorrelated data and
causes models to be overparamaterized when using AIC or likelihood ratio
tests.

I am curious how others select models with autocorrelated data.

Thanks for your help,

Jesse






   
  Renaud Lancelot   
   
  renaud.lancelot@To:   [EMAIL PROTECTED] 
[EMAIL PROTECTED] 
  gmail.com   cc:   
r-help@stat.math.ethz.ch  
   Subject:  Re: [R] Logistic 
regression model selection with overdispersed/autocorrelated 
  31/01/2006 01:02  data
   

   

   




If you're not interested in fitting caribou-specific responses, you
can use beta-binomial logistic models. There are several package
available for this purpose on CRAN, among which aod. Because these
models are fitted using maximum-likelihood methods, you can use AIC
(or other information criteria) to compare different models.

Best,

Renaud

2006/1/30, [EMAIL PROTECTED] [EMAIL PROTECTED]:


 I am creating habitat selection models for caribou and other species with
 data collected from GPS collars.  In my current situation the
radio-collars
 recorded the locations of 30 caribou every 6 hours.  I am then comparing
 resources used at caribou locations to random locations using logistic
 regression (standard habitat analysis).

 The data is therefore highly autocorrelated and this causes Type I error
 two ways – small standard errors around beta-coefficients and
 over-paramaterization during model selection.  Robust standard errors are
 easily calculated by block-bootstrapping the data using animal as a
 cluster with the Design library, however I haven't found a satisfactory
 solution for model selection.

 A couple options are:
 1.  Using QAIC where the deviance is divided by a variance inflation
factor
 (Burnham  Anderson).  However, this VIF can vary greatly depending on
the
 data set and the set of covariates used in the global model.
 2.  Manual forward stepwise regression using both changes in deviance and
 robust p-values for the beta-coefficients.

 I have been looking for a solution to this problem for a couple years and
 would appreciate any advice.

 Jesse

 __
 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


--
Renaud LANCELOT
Département Elevage et Médecine Vétérinaire (EMVT) du CIRAD
Directeur adjoint chargé des affaires scientifiques

CIRAD, Animal Production and Veterinary Medicine Department
Deputy director for scientific affairs

Campus international de Baillarguet
TA 30 / B (Bât. B, Bur. 214)
34398 Montpellier Cedex 5 - France
Tél   +33 (0)4 67 59 37 17
Secr. +33 (0)4 67 59 39 04
Fax   +33 (0)4 67 59 37 95

__
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] Bloomberg Data Import to R

2006-02-08 Thread Vivek Satsangi
Hi Sumanta,

1. This messages is much more appropriate for the sig-finance DL
instead. Consider signing up (I read up on Amba, so I am sure you have
good contributions to make in that forum).

2. To my knowledge, there isn't a direct package. However, if you use
Bloomberg's excel plugin, just get the data into excel, save and then
bring it in as usual. I suspect that that's what you are doing
already.

3. You may have better luck with the S-Plus plugins. I am just getting
started (an don't have any support/maintenace contract), so I don't
know what all Insightful has up its sleeve, but I talked to Carol
Wedekind about this just thing yesterday. Dr. Yollin, who also listens
in on the sig-finance list, may be able to advise you better about
what exists.

With warm regards,

Vivek

Message: 70
Date: Wed, 8 Feb 2006 15:51:13 +0530
From: Sumanta Basak [EMAIL PROTECTED]
Subject: [R] Bloomberg Data Import to R
To: r-help@stat.math.ethz.ch
Message-ID:
   [EMAIL PROTECTED]
Content-Type: text/plain

Hi R-Experts,

Can anyone tell me how Bloomberg data can be directly downloaded to R?
Is there any package?

Sumanta Basak.

__
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] nested random effects in glmm.admb

2006-02-08 Thread Hans Skaug
Hi Jarrod ,

I think you are right that neither nested or cross-classified models can be 
specified
in glmm.admb() as it stands (except in ad-hoc ways). This is not a restriction 
of the underlying
software AD Model Builder, but it is a feature of how I wrote the R-interface.
I will try to figure out how to do 2-level nesting, and include that in future 
releases.

hans

-Original Message-
From: [EMAIL PROTECTED] 
[mailto:[EMAIL PROTECTED] On Behalf Of Jarrod Hadfield
Sent: Wednesday, February 08, 2006 2:26 PM
To: r-help@stat.math.ethz.ch
Subject: [R] nested random effects in glmm.admb

Hello all,

In a previous posting regarding glmm.admb it is stated that glmm.admb 
can handle 2 nested random effects.   I can only fit a single random 
term at the moment, and wondered if anyone could  provide me with some 
information on how to specify  a model with 2 (nested or 
cross-classified) random terms?

Thanks,

Jarrod.

__
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] rob var/cov + LAD regression

2006-02-08 Thread Angelo Secchi

Hi,
after looking around I was not able to get info about these two questions:

1. Is there a function to have a  jackknifed corrected  var/cov estimate (as 
described in MacKinnon and White 1985) in a standard OLS regression? 

2. Does R possess a LAD (Least Absolute Deviation) regression function?

Any help?
Thanks

-- 

 Angelo Secchi PGP Key ID:EA280337

__
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] envi clone in R

2006-02-08 Thread Wladimir Eremeev
Hello all,

  Research Systems (www.rsinc.com) have developed and distributes the language 
IDL,
  and the GIS ENVI, written in IDL.

  To my oppinion, R language is superior, compared to IDL, in all aspects.
  However, ENVI is the rather convenient and feature rich tool.

  Is anyone aware about any work, dedicated to the creation of
  something, similar to the ENVI, but in R?
  
  Also, recently, the R bindings to the GTK library have appeared...

---
Best regards,
Wladimirmailto:[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] insert value according to indice

2006-02-08 Thread Adrian Katschke
  R-Helpers,
   
  I am trying to insert a value into a dataframe. This value is a proportion 
calculated by counting the number of those individuals with that value and then 
inserting the proportion at the end of the dataframe to only those individuals 
with the given value. The problem I am running into is that the proportions are 
not being attached to only those individuals with the specified value for that 
proportion. 
   
  Below is an example of the code that I am using. I have also attached the 
data file that I am using to create this dataframe.
   
#Read in Data
  age.int - read.csv('C:/intage.csv',header = TRUE)
   

asubs112 - subset(age.int, rs1042364 != (2,2))

   
ages112 - sort(unique(na.omit(asubs112$first_drink)))
   
  for ( i in ages112) {
indce - which(na.omit(asubs112$first_drink == i))
prop - length(indce)/nrow(asubs112)
asubs112[indce,5] - prop
asubs112[indce,]
  }
   
  Below is the output that I get from the script above. Notice the proportion 
for the first NA but not any of the others. Not sure what I am doing wrong, any 
suggestions are a big help.
   
  TIA,
  Adrian
   
   asubs112[1:50,]
  IND_ID rs1042364 first_drink age_int  V5
4   10008007 (1,2)  NA  16 0.003891051
6   10013012 (1,2)  13  14 0.116731518
7   10015006 (1,2)  12  17 0.105058366
8   10015007 (1,1)  12  16 0.105058366
10  10021009 (1,2)  NA  15  NA
14  10039036 (1,2)  NA  15  NA
15  10039037 (1,2)  NA  13  NA
17  10045005 (1,2)  13  17 0.116731518
18  10045014 (1,2)  13  14 0.116731518
21  10055022 (1,2)  NA  15  NA
22  10059006 (1,2)  12  NA 0.105058366
23  10060021 (1,2)  NA  15  NA
24  10060022 (1,2)  NA  13  NA
27  10069028 (1,2)  16  17 0.066147860
29  10071022 (1,1)  14  16 0.116731518
30  10071026 (1,2)  NA  13  NA
31  10071028 (1,2)  NA  13  NA
32  10071032 (1,2)  16  16 0.066147860
34  10072004 (1,2)  16  17 0.066147860
37  10073021 (1,2)  12  NA 0.105058366
39  10077013 (1,2)  NA  14  NA
40  10077076 (1,2)  15  15 0.062256809
41  10084005 (1,2)  14  15 0.116731518
44  10088017 (1,2)  15  15 0.062256809
50  10093005 (1,2)  NA  NA  NA
51  10096003 (1,2)  17  NA 0.023346304
56  10108005 (1,2)  14  NA 0.116731518
57  10112001 (1,2)   6  16 0.003891051
58  10114003 (1,1)  13  17 0.116731518
59  10114004 (1,1)  11  NA 0.027237354
60  10114005 (1,2)  12  14 0.105058366
61  10114006 (1,1)  13  17 0.116731518
62  10114007 (1,2)  15  15 0.062256809
63  10115006 (1,2)  13  14 0.116731518
69  10118011 (1,2)  14  14 0.116731518
70  10118012 (1,2)  16  17 0.066147860
73  10123024 (1,2)  13  15 0.116731518
76  10130019 (1,2)  NA  13  NA
77  10130020 (1,2)  12  15 0.105058366
78  10130021 (1,2)  NA  14  NA
87  10144039 (1,2)  12  13 0.105058366
91  10155016 (1,2)  NA  13  NA
92  10156004 (1,2)  14  15 0.116731518
99  10170009 (1,2)  16  17 0.066147860
100 10171016 (1,2)  NA  15  NA
104 10171027 (1,2)  13  14 0.116731518
107 10175013 (1,2)   9  16 0.011673152
108 10181013 (1,2)  11  13 0.027237354
110 10181017 (1,1)  14  16 0.116731518
111 10181024 (1,1)  16  17 0.066147860




__
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] Compiling errors for Matrix_0.995-5.tar.gz under XP

2006-02-08 Thread Prof Brian Ripley
Please read the R-admin manual and as it suggests use the candidate 
compilers, now gcc 3.4.5.


You also need the Rtools at the front of your path, so you find find.exe 
not FIND.exe.


Finally, it seems to be requiring latex, so you may need to install that 
(I am really not sure why though).


On Wed, 8 Feb 2006, White, Charles E WRAIR-Wash DC wrote:


I installed the MinGW-5.0.0 compilers today (gcc-3.4.2 is now contained in the 
'Current' distribution. When the current compilers failed to compile the 
referenced Matrix update and not knowing how to check the exact version numbers 
for individual files, I applied the Id.exe and f771.exe fixes from the 
'Building R for Windows' page 
(http://www.murdoch-sutherland.com/Rtools/#ldbug). More compiler errors were 
obtained. I then checked my Pearl version (5.8.7) and updated my R tools since 
I couldn't tell how old they were. At that point, I obtained the following 
output:


C:\Documents and Settings\Whitece.AMED\My Documents\1 Pocket Office\R Repository
\lme4rcmd install matrix_0.995-5.tar.gz

latex: not found
latex: not found
latex: not found

-- Making package matrix 
latex: not found
 adding build stamp to DESCRIPTION
latex: not found
 installing NAMESPACE file and metadata
latex: not found
 running src/Makefile.win ...
latex: not found
make[3]: `Matrix.dll' is up to date.
 ... done
 installing DLL
latex: not found
 installing R files
latex: not found
 installing inst files
FIND: Parameter format not correct
make[2]: *** [C:/PROGRA~1/R/R-22~1.1/library/matrix/inst] Error 2
make[1]: *** [all] Error 2
make: *** [pkg-matrix] Error 2
*** Installation of matrix failed ***

Removing 'C:/PROGRA~1/R/R-22~1.1/library/matrix'
Restoring previous 'C:/PROGRA~1/R/R-22~1.1/library/matrix'

If I need to read one of R's many friendly manuals, I'd appreciate a reference 
to which one and approximately which section.

Thanks.

Chuck

Charles E. White, Senior Biostatistician, MS
Walter Reed Army Institute of Research
503 Robert Grant Ave., Room 1w102
Silver Spring, MD 20910-1557
301 319-9781
Personal/Professional Site: http://users.starpower.net/cwhite571/professional/

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



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

[R] GEE Modelle in Stata und R

2006-02-08 Thread Christian Bieli
Hall Christian

Ich habe Dir hier den Output desselben Models mir den selben Daten mit R 
und mit Stata gerechnet angehängt.
Wie Du siehst sind die Unterschiede nicht unbeträchtlich. Da Du bestimmt 
schon ähnliche Erfahrungen gemacht hast, wollte ich Dich fragen, ob 
diese Unterschiede im Rahmen  dessen sind, wie man sie zwischen zwei 
verschiedenen packages erwarten kann, oder nicht.

Für eine kurze Antwort wäre ich Dir sehr dankbar.
Liebe Grüsse
Christian

R output:

 GEE:  GENERALIZED LINEAR MODELS FOR DEPENDENT DATA
 gee S-function, version 4.13 modified 98/01/27 (1998)

Model:
 Link:  Logit
 Variance to Mean Relation: Binomial
 Correlation Structure: Exchangeable

Call:
gee(formula = y ~ Var1 * Var2 + Var3, id = Var4,
data = mydata, family = binomial, corstr = exchangeable,
scale.fix = TRUE)

Summary of Residuals:
Min  1Q  Median  3Q Max
-0.16457139 -0.10916961 -0.05774320 -0.01334249  0.98519918

Coefficients:
   Estimate Naive S.E. Naive z Robust S.E.
Robust z
(Intercept) -2.02946378  0.6152142 -3.29879234   0.6276423 
-3.23347186
Var1med -0.06978758  0.8108207 -0.08607031   0.8280726 
-0.08427713
Var1hi   0.08988940  0.9738316  0.09230487   0.9851523  
0.09124417
Var2yes -2.16869738  1.2386945 -1.75079278   1.4269696 
-1.51979227
Var3yes -0.10520805  0.5724176 -0.18379597   0.6881670 
-0.15288157
Var1med:Var2yes  1.58088457  1.3503015  1.17076411   1.3682419  
1.15541309
Var1hi:Var2yes   2.48367129  1.4694804  1.69016976   1.4707481  
1.68871291

Estimated Scale Parameter:  1

Stata Output:

xi: xtgee y i.Var1*i.Var2 Var3, family(binomial) link(logit) i(Var4)

GEE population-averaged model   Number of obs 
=   309
Group variable:   Var4  Number of groups  
=   215
Link:logit  Obs per group: min
= 1
Family:   binomial avg
=   1.4
Correlation:  exchangeable max
= 8
Wald chi2(6)  
=  7.68
Scale parameter: 1  Prob  chi2   
=0.2628


--
   y |  Coef.   Std. Err.  zP|z| [95% Conf.
Interval]

-+
   _cons |  -1.938584   .8662878-2.24   0.025-3.636477  
-.2406913
_IVar1_2 |  -.0610133   .8087995-0.08   0.940   
-1.6462311.524205
_IVar1_3 |   .0944082   .9720986 0.10   0.923
-1.810871.999686
_IVar2_2 |  -2.178428   1.240422-1.76   0.079
-4.60961.2527538
Var3 |  -.0977918   .5719084-0.17   0.864   
-1.2187121.023128
_IVarXVa~2_2 |   1.575095   1.351553 1.17   0.244   
-1.073901 4.22409
_IVarXVa~3_2 |   2.483814   1.470152 1.69   0.091   
-.3976316 5.36526

--


Christian

-- 
Christian Bieli, project assistant
Institute of Social and Preventive Medicine
University of Basel, Switzerland
Steinengraben 49
CH-4051 Basel
Tel.: +41 61 270 22 12
Fax:  +41 61 270 22 25
[EMAIL PROTECTED]
www.unibas.ch/ispmbs

__
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] Logistic regression - confidence intervals

2006-02-08 Thread Prof Brian Ripley

On Wed, 8 Feb 2006, Cox, Stephen wrote:


Please forgive a rather naïve question...

Could someone please give a quick explanation for the differences in 
conf intervals achieved via confint.glm (based on profile liklihoods) 
and the intervals achieved using the Design library.


Well, the Design library is not giving you confidence intervals for 
parameters, is it?  (Since there is no summary method for lrm it is a long 
haul to find out what it is giving you, which I leave to you.)



For example, the intervals in the following two outputs are different.

library(Design)
x = rnorm(100)
y = gl(2,50)
d = data.frame(x = x, y = y)
dd = datadist(d); options(datadist = 'dd')
m1 = lrm(y~x, data = d)
summary(m1)

m2 = glm(y~x, family = binomial, data = d)
confint(m2)

I have spent time trying to figure this out via archives, but have not had much 
luck.

Regards

Stephen


--
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] Logistic regression - confidence intervals

2006-02-08 Thread Frank E Harrell Jr
Cox, Stephen wrote:
 Please forgive a rather naïve question... 
 
 Could someone please give a quick explanation for the differences in conf 
 intervals achieved via confint.glm (based on profile liklihoods) and the 
 intervals achieved using the Design library.
 
 For example, the intervals in the following two outputs are different.
 
 library(Design)
 x = rnorm(100)
 y = gl(2,50)
 d = data.frame(x = x, y = y)
 dd = datadist(d); options(datadist = 'dd')
 m1 = lrm(y~x, data = d)
 summary(m1)
 
 m2 = glm(y~x, family = binomial, data = d)
 confint(m2)
 
 I have spent time trying to figure this out via archives, but have not had 
 much luck.
 
 Regards
 
 Stephen

Design uses Wald(large sample normality of parameter estimates) -based 
confidence intervals.  These are good for most situations but profile 
confidence intervals are preferred.   Someday I'll make Design do those.

One advantage to Wald statistics is that they extend readily to cluster 
sampling (e.g., using cluster sandwich covariance estimators) and other 
complications (e.g., adjustment of variances for multiple imputation), 
whereas likelihood ratio statistics do not (unless e.g. you have an 
explicit model for the correlation structure or other facits of the model).

Also note that confint is probably giving a confidence interval for a 
one-unit change in x whereas summary.Design is computing an 
interquartile-range effect (difference in x-values is shown in the 
summary output).

When posting a nice simulated example it's best to do 
set.seed(something) so everyone will get the same data.

Frank

-- 
Frank E Harrell Jr   Professor and Chair   School of Medicine
  Department of Biostatistics   Vanderbilt University

__
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] (no subject)

2006-02-08 Thread Nelson, Gary \(FWE\)



*
Gary A. Nelson, Ph.D
Massachusetts Division of Marine Fisheries
30 Emerson Avenue
Gloucester, MA 01930
Phone: (978) 282-0308 x114
Fax: (617) 727-3337
Email: [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 with the ts function

2006-02-08 Thread Nelson, Gary \(FWE\)
I have a time series of temperature data recorded every 2 hours and I
would like to generate a spectrogram using the spectrum function that
examines cycles per day.  My statement for coding the series using the
ts function is

bevtemp-ts(bevtemp,deltat=0.084) 

where 0.084 is 2 hours/24 hours.

I am wondering if this is the correct way to code the data?


Thanks for your help.

Gary Nelson.




*
Gary A. Nelson
Massachusetts Division of Marine Fisheries
30 Emerson Avenue
Gloucester, MA 01930
Phone: (978) 282-0308 x114
Fax: (617) 727-3337
Email: [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] what are the limits on R array sizes?

2006-02-08 Thread Mike Miller
I have some computers with a massive amount of memory, and I have some 
jobs that could use very large matrix sizes.  Can R handle matrices of 
larger than 2GB?  If I were to create a matrix of 1,000,000 x 1,000, it 
would use about 8GB.  Can R work with an array of that size if I have 
compiled R on an IA64 Linux system with 15GB of RAM?

Mike

__
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] adding variable into dataframe by indice

2006-02-08 Thread Adrian Katschke
  R-Helpers,
   
  I am trying to insert a value into a dataframe. This value is a proportion 
calculated by counting the number of those individuals with that value and then 
inserting the proportion at the end of the dataframe to only those individuals 
with the given value. The problem I am running into is that the proportions are 
not being attached to only those individuals with the specified value for that 
proportion. 
   
  Below is an example of the code that I am using. The data is made up for the 
dataframe. Should give you an idea, but the original has 'NA' in many rows. The 
original data is what is reported in the output below.
   
#Read in Data
  age.int - data.frame(IND_ID = seq(1, 140, 10),   rs1042364 = sample( 
c((1,1),(1,2),(2,2)),14,replace = T), 
  first_drink = sample(5:17,14,replace = T))

   

asubs112 - subset(age.int, rs1042364 != (2,2))

   
ages112 - sort(unique(na.omit(asubs112$first_drink)))
   
  for ( i in ages112) {
indce - which(na.omit(asubs112$first_drink == i))
prop - length(indce)/nrow(asubs112)
asubs112[indce,4] - prop
asubs112[indce,]
  }
   
  Below is the output that I get from the script above. Notice the proportion 
for the first NA but not any of the others. Not sure what I am doing wrong, any 
suggestions are a big help.
   
  TIA,
  Adrian
   
   asubs112[1:50,]
  IND_ID rs1042364 first_drink age_int  V5
4   10008007 (1,2)  NA  16 0.003891051
6   10013012 (1,2)  13  14 0.116731518
7   10015006 (1,2)  12  17 0.105058366
8   10015007 (1,1)  12  16 0.105058366
10  10021009 (1,2)  NA  15  NA
14  10039036 (1,2)  NA  15  NA
15  10039037 (1,2)  NA  13  NA
17  10045005 (1,2)  13  17 0.116731518
18  10045014 (1,2)  13  14 0.116731518
21  10055022 (1,2)  NA  15  NA






[[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] Lexis maps in R

2006-02-08 Thread Camarda, Carlo Giovanni
Dear R-users,
Sorry for bothering you twice in a day, but I was wondering whether
there is any R-function which can easily plot the single elements of a
Lexis diagram. I though that Lexis.diagram(Epi) could be the case, but
it just plot life times in a frame.
In particular I have been searching for something similar to the
function image which can plot either the single triangles of a Lexis
diagram or the parallelograms (e.g. probability of dying if the event is
the death). 
I wrote down a simple example in which I played around with the function
polygon, but in this case the procedure would be too long (normally data
are set in matrix) and also the colors are messed up.
Thanks,
Carlo Giovanni Camarda

## a wrong example for giving an idea of what I'd like to plot
x - 0:4
A - matrix(1:16,ncol=4)
image(x,x,A, col=white)
colo - rainbow(12)
for(i in 1:4){
x1 - c(0,1,2,1)
y1 - c(0,0,1,1) + i -1
x2 - x1+1
y2 - y1
x3 - x2+1
y3 - y2
polygon(x1,y1,col=colo[i + i - 1])
polygon(x2,y2,col=colo[i+i])
polygon(x3,y3,col=colo[i+i+1])
}




+
This mail has been sent through the MPI for Demographic Rese...{{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] Compiling errors for Matrix_0.995-5.tar.gz under XP

2006-02-08 Thread Peter Dalgaard
White, Charles E WRAIR-Wash DC [EMAIL PROTECTED] writes:

 I installed the MinGW-5.0.0 compilers today (gcc-3.4.2 is now
 contained in the 'Current' distribution. When the current compilers
 failed to compile the referenced Matrix update and not knowing how
 to check the exact version numbers for individual files, I applied
 the Id.exe and f771.exe fixes from the 'Building R for Windows' page
 (http://www.murdoch-sutherland.com/Rtools/#ldbug). More compiler
 errors were obtained. I then checked my Pearl version (5.8.7) and
 updated my R tools since I couldn't tell how old they were. At that
 point, I obtained the following output:
 
 
 C:\Documents and Settings\Whitece.AMED\My Documents\1 Pocket Office\R 
 Repository
 \lme4rcmd install matrix_0.995-5.tar.gz
 
 latex: not found
 latex: not found
 latex: not found
 
 -- Making package matrix 
 latex: not found
   adding build stamp to DESCRIPTION
 latex: not found
   installing NAMESPACE file and metadata
 latex: not found
   running src/Makefile.win ...
 latex: not found
 make[3]: `Matrix.dll' is up to date.
   ... done
   installing DLL
 latex: not found
   installing R files
 latex: not found
   installing inst files
 FIND: Parameter format not correct

This looks like an issue with your PATH setting. You're picking up the
wrong find command.

 make[2]: *** [C:/PROGRA~1/R/R-22~1.1/library/matrix/inst] Error 2
 make[1]: *** [all] Error 2
 make: *** [pkg-matrix] Error 2
 *** Installation of matrix failed ***
 
 Removing 'C:/PROGRA~1/R/R-22~1.1/library/matrix'
 Restoring previous 'C:/PROGRA~1/R/R-22~1.1/library/matrix'
 
 If I need to read one of R's many friendly manuals, I'd appreciate a
 reference to which one and approximately which section.

According to README.packages,

Instructions for installing the toolset and building packages using the
standard methods are in the `R Installation and Administration' manual
(which is available in various formats as R-admin.* in the doc/manual
directory).

As fara as I can see Appendix F is the most relevant part, but also
look in Ch 3 and 6.



 Thanks.
 
 Chuck
 
 Charles E. White, Senior Biostatistician, MS
 Walter Reed Army Institute of Research
 503 Robert Grant Ave., Room 1w102
 Silver Spring, MD 20910-1557
 301 319-9781
 Personal/Professional Site: http://users.starpower.net/cwhite571/professional/
 
 __
 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 Øster Farimagsgade 5, Entr.B
  c/ /'_ --- Dept. of Biostatistics PO Box 2099, 1014 Cph. K
 (*) \(*) -- University of Copenhagen   Denmark  Ph:  (+45) 35327918
~~ - ([EMAIL PROTECTED])  FAX: (+45) 35327907

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


Re: [R] Bloomberg Data Import to R

2006-02-08 Thread Neuro LeSuperHéros
Check this out:

https://stat.ethz.ch/pipermail/r-sig-finance/2004q3/51.html

You should consider adapting it with rcom instead of RDCOMClient

Neuro


From: Sumanta Basak [EMAIL PROTECTED]
To: r-help@stat.math.ethz.ch
Subject: [R] Bloomberg Data Import to R
Date: Wed, 8 Feb 2006 15:51:13 +0530



Hi R-Experts,



Can anyone tell me how Bloomberg data can be directly downloaded to R?
Is there any package?

Sumanta Basak.


---
This e-mail may contain confidential and/or privileged infor...{{dropped}}

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

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


[R] slightly off-topic re prcomp()

2006-02-08 Thread Laura Quinn
Hi,

I was wondering if anyone could tell me why prcomp() will Invent modes
of variation in a PCA on identical replicates of data? I would have
expected 50 (or whatever number) of identical replicates to return a null
score in such an analysis (or at the least, all variables would share the
same PC score). This is not the case and I was wondering could someone
point me in the direction of some literature to explain the reason behind
this?

Laura Quinn
Institute of Atmospheric Science
School of Earth and Environment
University of Leeds
Leeds
LS2 9JT

tel: +44 113 343 1596
fax: +44 113 343 6716
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] tutorials on statistical aspects of R

2006-02-08 Thread Ben Bolker

[EMAIL PROTECTED] wrote:

 There are lots of tutorials at 
 http://cran.r-project.org/other-docs.html.

 I have those of course. I was looking for further tutorials.

 What do you mean the statistical aspect of R?

 I mean using and building statistical models for data analysis 
 specifying the possibilities of variations appearing in R. An example 
 would be specifying Split-plot ANOVA with both random and fixed factors.
 A lot of the tutorials in above url try to explain R as a programming 
 language and therefore cannot allow too many explanation. That is the 
 case of Jack of all trades... etc. R is useful for quite a lot of 
 things, however I'm looking for something like a statistics course in R.
 Just to prevent misunderstanding, I do own, and am familiar with, 
 exhaustive statistical texts. So I don't exactly need a course in 
 statistics.

 Thanks in advance,

 Gil

 (I'm redirecting this to the general R list, since it's not 
particularly Mac specific any more.)
 Despite your claim,  there are statistics-oriented tutorials available in
the other docs section (esp. Faraway and Fox).  However, if I recall 
correctly
and if you need split-plot ANOVA etc., these may not be quite advanced 
enough
(statistically) for you (Faraway has about 5 pages on block designs).  
You may need to buy or
borrow a book: I would recommend Crawley's
books (Statistics: an Introduction using R has only 4 or so pages, 
Statistical Computing
has a whole 16-page chapter); Venables and Ripley (the bible) has a 
chapter on random and
mixed effects, and Pinheiro and Bates is an entire book on mixed models 
... all of these
except Statistical Computing are listed on the R books page.  Faraway 
also has
Linear models with R, which has a chapter on block designs.

  That should give you some starting points ...

 Ben Bolker

__
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] rob var/cov + LAD regression

2006-02-08 Thread Berton Gunter
RSiteSearch() is your friend.

For 1) Try RSiteSearch('Jackknife',restrict='functions')

For 2) see package quantreg

-- Bert Gunter
Genentech Non-Clinical Statistics
South San Francisco, CA
 
The business of the statistician is to catalyze the scientific learning
process.  - George E. P. Box
 
 

 -Original Message-
 From: [EMAIL PROTECTED] 
 [mailto:[EMAIL PROTECTED] On Behalf Of Angelo Secchi
 Sent: Wednesday, February 08, 2006 8:23 AM
 To: r-help@stat.math.ethz.ch
 Subject: [R] rob var/cov + LAD regression
 
 
 Hi,
 after looking around I was not able to get info about these 
 two questions:
 
 1. Is there a function to have a  jackknifed corrected  
 var/cov estimate (as described in MacKinnon and White 1985) 
 in a standard OLS regression? 
 
 2. Does R possess a LAD (Least Absolute Deviation) regression 
 function?
 
 Any help?
 Thanks
 
 -- 
 
  Angelo Secchi PGP Key ID:EA280337
 
 __
 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] expand.grid without expanding

2006-02-08 Thread Luís Torgo
Dear list,
I've recently came across a problem that I think I've solved and that I wanted 
to share with you for two reasons:
- Maybe others come across the same problem.
- Maybe someone has a much simpler solution that wants to share with me ;-)

The problem is as follows: expand.grid() allows you to generate a data.frame 
with all combinations of a set of values, e.g.:
 expand.grid(par1=-1:1,par2=c('a','b'))
  par1 par2
1   -1a
20a
31a
4   -1b
50b
61b

There is nothing wrong with this nice function except when you have too many 
combinations to fit in your computer memory, and that was my problem: I 
wanted to do something for each combination of a set of variants, but this 
set was to large for storing in memory in a data.frame generated by 
expand.grid. A possible solution would be to have a set of nested for() 
cycles but I preferred a solution that involved a single for() cycle going 
from 1 to the number of combinations and then at each iteration having some 
form of generating the combination i. And this was the real problem: how 
to generate a function that picks the same style of arguments as 
expand.grid() and provides me with the values corresponding to line i of 
the data frame that would have been created bu expand.grid(). For instance, 
if I wanted the line 4 of the above call to expand.grid() I should get the 
same as doing:
 expand.grid(par1=-1:1,par2=c('a','b'))[4,]
  par1 par2
4   -1b

but obviously without having to use expand.grid() as that involves generating 
a data frame that in my case wouldn't fit in the memory of my computer.

Now, the function I've created was the following:

getVariant - function(id,vars) {

  if (!is.list(vars)) stop('vars needs to be a list!')

  nv - length(vars)

  lims - sapply(vars,length)
  if (id  prod(lims)) stop('id above the number of combinations!')
  
  res - vector(list,nv)

  for(i in nv:2) {

f - prod(lims[1:(i-1)])

res[[i]] - vars[[i]][ceiling(id / f)]

id - id - (ceiling(id/f)-1)*f
  }

  res[[1]] - vars[[1]][id]
  names(res) - names(vars)
  res

}
--
 expand.grid(par1=-1:1,par2=c('a','b'))[4,]
  par1 par2
4   -1b
 getVariant(4,list(par1=-1:1,par2=c('a','b')))
$par1
[1] -1

$par2
[1] b

I would be glad to know if somebody came across the same problem and has a 
better suggestion on how to solve this.

Thanks,
Luis

-- 
Luis Torgo
FEP/LIACC, University of Porto   Phone : (+351) 22 339 20 93
Machine Learning Group   Fax   : (+351) 22 339 20 99
R. de Ceuta, 118, 6o email : [EMAIL PROTECTED]
4050-190 PORTO - PORTUGALWWW   : http://www.liacc.up.pt/~ltorgo

__
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] rob var/cov + LAD regression

2006-02-08 Thread Kjetil Brinchmann Halvorsen
Angelo Secchi wrote:
 Hi,
 after looking around I was not able to get info about these two questions:
 
 1. Is there a function to have a  jackknifed corrected  var/cov estimate 
 (as described in MacKinnon 

and White 1985) in a standard OLS regression?

Not sure, but look at package  sandwich  (on CRAN).

 
 2. Does R possess a LAD (Least Absolute Deviation) regression function?

This can be done with package quantreg  (on CRAN).

Kjetil

 
 Any help?
 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] problem to install R on linux

2006-02-08 Thread André Beló
Dear members,

this can sound trivial for some people but I don't have experience on 
compilation.

I'm trying to install R-2.2.1 on a laptop running Mandriva 2006. I 
already installed many of the recommended packages/libraries but it 
seems that something is still missing. The problem is that I cannot 
identify... Could somebody give me some advise?

I put the output of the command ./configure bellow. When I tryed to 
install the R-2.0.0-1mdk.i586.rpm I got:

[EMAIL PROTECTED] Download]# rpm -i R-2.0.0-1mdk.i586.rpm
warning: R-2.0.0-1mdk.i586.rpm: Header V3 DSA signature: NOKEY, key ID 
6c60ceea
error: Failed dependencies:
info is needed by R-2.0.0-1mdk.i586
[EMAIL PROTECTED] Download]#


Thanks in advance,
AB


[EMAIL PROTECTED] R-2.2.1]# ./configure
checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
loading site script './config.site'
loading build specific script './config.site'
checking for pwd... /bin/pwd
checking whether builddir is srcdir... yes
checking for working aclocal... found
checking for working autoconf... found
checking for working automake... found
checking for working autoheader... found
checking for working makeinfo... found
checking for gawk... gawk
checking for egrep... grep -E
checking whether ln -s works... yes
checking for ranlib... ranlib
checking for bison... no
checking for byacc... no
checking for ar... ar
checking for a BSD-compatible install... /usr/bin/install -c
checking for sed... /bin/sed
checking for less... /usr/bin/less
checking for perl... /usr/bin/perl
checking whether perl version is at least 5.004... yes
checking for dvips... /usr/bin/dvips
checking for tex... /usr/bin/tex
checking for latex... /usr/bin/latex
checking for makeindex... /usr/bin/makeindex
checking for pdftex... /usr/bin/pdftex
checking for pdflatex... /usr/bin/pdflatex
checking for makeinfo... /usr/bin/makeinfo
checking for unzip... /usr/bin/unzip
checking for zip... /usr/bin/zip
checking for gzip... /bin/gzip
checking for firefox... no
checking for mozilla... no
checking for netscape... no
checking for galeon... no
checking for kfmclient... no
checking for opera... no
checking for gnome-moz-remote... /usr/bin/gnome-moz-remote
using default browser ... /usr/bin/gnome-moz-remote
checking for acroread... /usr/bin/acroread
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ANSI C... none needed
checking how to run the C preprocessor... gcc -E
checking whether gcc needs -traditional... no
checking how to run the C preprocessor... gcc -E
checking for gfortran... gfortran
checking whether we are using the GNU Fortran 77 compiler... no
checking whether gfortran accepts -g... no
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking how to run the C++ preprocessor... g++ -E
checking for a sed that does not truncate output... /bin/sed
checking for ld used by gcc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for /usr/bin/ld option to reload object files... -r
checking for BSD-compatible nm... /usr/bin/nm -B
checking how to recognise dependent libraries... pass_all
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking dlfcn.h usability... yes
checking dlfcn.h presence... yes
checking for dlfcn.h... yes
checking the maximum length of command line arguments... 32768
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking for objdir... .libs
checking for ranlib... (cached) ranlib
checking for strip... strip
checking if gcc static flag  works... yes
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC
checking if gcc PIC flag -fPIC works... yes
checking if gcc supports -c -o file.o... yes
checking whether the gcc linker (/usr/bin/ld) supports shared 
libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... no
configure: creating libtool
appending configuration tag CXX to libtool
checking for ld used by g++... /usr/bin/ld
checking if the linker (/usr/bin/ld) 

Re: [R] [R-sig-Geo] envi clone in R

2006-02-08 Thread Barry Rowlingson
Wladimir Eremeev wrote:
 Hello all,
 
   Research Systems (www.rsinc.com) have developed and distributes the 
 language IDL,
   and the GIS ENVI, written in IDL.

  I find it hard to believe they wrote it all in IDL! I'm guessing its 
probably scriptable in IDL, but underneath its written in something 
else... I could be wrong though!

   To my oppinion, R language is superior, compared to IDL, in all aspects.
   However, ENVI is the rather convenient and feature rich tool.

  I clicked on 'Product Documentation' on the ENVI site and it wanted me 
to log in or create a new user. To see the documentation? To find out 
what the program is about?

  Oh, what I really wanted was the Feature Tour..

   Is anyone aware about any work, dedicated to the creation of
   something, similar to the ENVI, but in R?

  Last year I looked at GIS-R linkages, with the added criteria of being 
open source and cross-platform. There are now a few free GIS packages 
that can do this kind of thing, with a little added glue.

  I settled on OpenEV - it has vector and raster support, its extensible 
in Python and uses Gtk for dialogs which you can customise. All I needed 
was to get Python talking to R, so I wrote some Python bindings to 
Rserve. Now I've got a GIS with a menu that drops down, you choose the 
point layers you want to work on, click 'Go', and R does some analysis 
that ends up as a raster layer back in the GIS. The user doesnt care 
that R did it.

Other GIS solutions are available!

Barry

__
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] logical condition in vector operation

2006-02-08 Thread Federico Calboli
HI All,

I have a data frame such as:

 test
 x y  p  d
[1,] 1 0 10 21 0
[2,] 2 3 11 12 0
[3,] 3 4 12 23 0
[4,] 3 5 13 24 0


and I want to perfor some operations on the first two coulums,
conditional on the uneqaulity values on the 3rd and 4th columns.

For instance:

j = 3
test[test[,1] == j, 5] = test[test[,1] == j,2] + test[test[,2] == j,1]

gives me the result:

test:

 x y  p  d
[1,] 1 0 10 21 0
[2,] 2 3 11 12 0
[3,] 3 4 12 23 6
[4,] 3 5 13 24 7


My probblem is the following: I want to perform the operation
test[test[,1] == j,2] + test[test[,2] == j,1] only if the value of
column p and column d are different at the positions where x or y = j.
In practice, I don't want to perform the first operation because
test[2,4 is 12 and test[1,3] is 12 as well.

I tried an if statement with little success:

if(test[test[,1] == j,3] != test[test[,2] == j,4]){
test[test[,1] == j, 5] = test[test[,1] == j,2] + test[test[,2] == j,1]
}
Warning message:
the condition has length  1 and only the first element will be used in:
if (test[test[, 1] == j, 3] != test[test[, 2] == j, 4]) {

Could anyone lend some advice?

Cheers,

Federico
-- 
Federico C. F. Calboli
Department of Epidemiology and Public Health
Imperial College, St Mary's Campus
Norfolk Place, London W2 1PG

Tel  +44 (0)20 7594 1602 Fax (+44) 020 7594 3193

f.calboli [.a.t] imperial.ac.uk
f.calboli [.a.t] gmail.com

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


[R] last command history???

2006-02-08 Thread David Ruau
Hi,

I am using R 2.2.0 on Mac OS X 10.3.9. But I test the issue also with R 
2.2.1 on OS X 10.4 (Tiger)
I have a question regarding the functioning of the history from the 
command line.
When I press the 'up-arrow' I call back the last command (everything 
ok), let's say that I go back until the level n-5, but when I get down 
to return to the empty line, I cannot reach the empty line... The empty 
line 'level' show me the content of the line n-4.
example, let's say I did this sequence of command:
  x - c(1:10)
  mean(x)
[1] 5.5
  sd(x)
[1] 3.027650
  x
  [1]  1  2  3  4  5  6  7  8  9 10
 
# If I return to the command 'x - c(1:10)' and then get down the 
bottom line is :
  mean(x)

Well it doesn't work like that under Windows and I guess under Linux. 
What is the setting that I should change?
Or where is the error I made...

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


Re: [R] rob var/cov + LAD regression

2006-02-08 Thread roger koenker

On Feb 8, 2006, at 10:22 AM, Angelo Secchi wrote:


 1. Is there a function to have a  jackknifed corrected  var/cov  
 estimate (as described in MacKinnon and White 1985) in a standard  
 OLS regression?

package:  sandwich

 2. Does R possess a LAD (Least Absolute Deviation) regression  
 function?

package:  quantreg

url:www.econ.uiuc.edu/~rogerRoger Koenker
email[EMAIL PROTECTED]Department of Economics
vox: 217-333-4558University of Illinois
fax:   217-244-6678Champaign, IL 61820

__
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] slightly off-topic re prcomp()

2006-02-08 Thread Berton Gunter
If you don't get a response:

reproducible example, please.

I suspect that you're looking at numerical analysis artifacts, assuming I
have correctly interpreted you.

-- Bert Gunter
Genentech Non-Clinical Statistics
South San Francisco, CA
 
The business of the statistician is to catalyze the scientific learning
process.  - George E. P. Box
 
 

 -Original Message-
 From: [EMAIL PROTECTED] 
 [mailto:[EMAIL PROTECTED] On Behalf Of Laura Quinn
 Sent: Wednesday, February 08, 2006 9:50 AM
 To: r-help@stat.math.ethz.ch
 Subject: [R] slightly off-topic re prcomp()
 
 Hi,
 
 I was wondering if anyone could tell me why prcomp() will 
 Invent modes
 of variation in a PCA on identical replicates of data? I would have
 expected 50 (or whatever number) of identical replicates to 
 return a null
 score in such an analysis (or at the least, all variables 
 would share the
 same PC score). This is not the case and I was wondering could someone
 point me in the direction of some literature to explain the 
 reason behind
 this?
 
 Laura Quinn
 Institute of Atmospheric Science
 School of Earth and Environment
 University of Leeds
 Leeds
 LS2 9JT
 
 tel: +44 113 343 1596
 fax: +44 113 343 6716
 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


Re: [R] slightly off-topic re prcomp()

2006-02-08 Thread Duncan Murdoch
On 2/8/2006 12:50 PM, Laura Quinn wrote:
 Hi,
 
 I was wondering if anyone could tell me why prcomp() will Invent modes
 of variation in a PCA on identical replicates of data? I would have
 expected 50 (or whatever number) of identical replicates to return a null
 score in such an analysis (or at the least, all variables would share the
 same PC score). This is not the case and I was wondering could someone
 point me in the direction of some literature to explain the reason behind
 this?

I think you'll need to show us an example.  I just tried what I think 
you described, and got all the components with 0 standard deviation, as 
I would have expected.

Duncan Murdoch


 
 Laura Quinn
 Institute of Atmospheric Science
 School of Earth and Environment
 University of Leeds
 Leeds
 LS2 9JT
 
 tel: +44 113 343 1596
 fax: +44 113 343 6716
 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


Re: [R] what are the limits on R array sizes?

2006-02-08 Thread Prof Brian Ripley
On Wed, 8 Feb 2006, Mike Miller wrote:

 I have some computers with a massive amount of memory, and I have some
 jobs that could use very large matrix sizes.  Can R handle matrices of
 larger than 2GB?  If I were to create a matrix of 1,000,000 x 1,000, it
 would use about 8GB.  Can R work with an array of that size if I have
 compiled R on an IA64 Linux system with 15GB of RAM?

Yes. See ?Memory-limits.

help.search(limits) gets you there.

-- 
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] problem to install R on linux

2006-02-08 Thread Bhola, Gautam
Hi

I had similar issue which was resolved by ensuring that I have the lib/include 
folder for readline in my LD_LIBRARY_PATH and PATH respectively.


Thanks 
Gautam Bhola



-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of André Beló
Sent: Wednesday, February 08, 2006 1:09 PM
To: r-help@stat.math.ethz.ch
Subject: [R] problem to install R on linux

Dear members,

this can sound trivial for some people but I don't have experience on 
compilation.

I'm trying to install R-2.2.1 on a laptop running Mandriva 2006. I 
already installed many of the recommended packages/libraries but it 
seems that something is still missing. The problem is that I cannot 
identify... Could somebody give me some advise?

I put the output of the command ./configure bellow. When I tryed to 
install the R-2.0.0-1mdk.i586.rpm I got:

[EMAIL PROTECTED] Download]# rpm -i R-2.0.0-1mdk.i586.rpm
warning: R-2.0.0-1mdk.i586.rpm: Header V3 DSA signature: NOKEY, key ID 
6c60ceea
error: Failed dependencies:
info is needed by R-2.0.0-1mdk.i586
[EMAIL PROTECTED] Download]#


Thanks in advance,
AB


[EMAIL PROTECTED] R-2.2.1]# ./configure
checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
loading site script './config.site'
loading build specific script './config.site'
checking for pwd... /bin/pwd
checking whether builddir is srcdir... yes
checking for working aclocal... found
checking for working autoconf... found
checking for working automake... found
checking for working autoheader... found
checking for working makeinfo... found
checking for gawk... gawk
checking for egrep... grep -E
checking whether ln -s works... yes
checking for ranlib... ranlib
checking for bison... no
checking for byacc... no
checking for ar... ar
checking for a BSD-compatible install... /usr/bin/install -c
checking for sed... /bin/sed
checking for less... /usr/bin/less
checking for perl... /usr/bin/perl
checking whether perl version is at least 5.004... yes
checking for dvips... /usr/bin/dvips
checking for tex... /usr/bin/tex
checking for latex... /usr/bin/latex
checking for makeindex... /usr/bin/makeindex
checking for pdftex... /usr/bin/pdftex
checking for pdflatex... /usr/bin/pdflatex
checking for makeinfo... /usr/bin/makeinfo
checking for unzip... /usr/bin/unzip
checking for zip... /usr/bin/zip
checking for gzip... /bin/gzip
checking for firefox... no
checking for mozilla... no
checking for netscape... no
checking for galeon... no
checking for kfmclient... no
checking for opera... no
checking for gnome-moz-remote... /usr/bin/gnome-moz-remote
using default browser ... /usr/bin/gnome-moz-remote
checking for acroread... /usr/bin/acroread
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ANSI C... none needed
checking how to run the C preprocessor... gcc -E
checking whether gcc needs -traditional... no
checking how to run the C preprocessor... gcc -E
checking for gfortran... gfortran
checking whether we are using the GNU Fortran 77 compiler... no
checking whether gfortran accepts -g... no
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking how to run the C++ preprocessor... g++ -E
checking for a sed that does not truncate output... /bin/sed
checking for ld used by gcc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for /usr/bin/ld option to reload object files... -r
checking for BSD-compatible nm... /usr/bin/nm -B
checking how to recognise dependent libraries... pass_all
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking dlfcn.h usability... yes
checking dlfcn.h presence... yes
checking for dlfcn.h... yes
checking the maximum length of command line arguments... 32768
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking for objdir... .libs
checking for ranlib... (cached) ranlib
checking for strip... strip
checking if gcc static flag  works... yes
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC
checking if gcc PIC flag -fPIC works... yes
checking if gcc supports -c -o file.o... yes
checking whether the gcc linker (/usr/bin/ld) supports shared 
libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library 

[R] ERROR: no applicable method for TukeyHSD

2006-02-08 Thread Darren Weber
Why do I see this error?

 library(stats)
 require(stats)
[1] TRUE

 tHSD - TukeyHSD(aov)
Error in TukeyHSD(aov) : no applicable method for TukeyHSD


In case it helps:


 aov

Call:
aov(formula = roi ~ (Cue * Hemisphere) + Error(Subject/(Cue *
Hemisphere)), data = roiDataframe)

Grand Mean: 8.195069

Stratum 1: Subject

Terms:
Residuals
Sum of Squares   645.7444
Deg. of Freedom 7

Residual standard error: 9.604645

Stratum 2: Subject:Cue

Terms:
 Cue Residuals
Sum of Squares  0.386987  4.015740
Deg. of Freedom1 7

Residual standard error: 0.7574148
1 out of 2 effects not estimable
Estimated effects are balanced

Stratum 3: Subject:Hemisphere

Terms:
Hemisphere Residuals
Sum of Squares153.4860  827.6699
Deg. of Freedom  1 7

Residual standard error: 10.87376
1 out of 2 effects not estimable
Estimated effects are balanced

Stratum 4: Subject:Cue:Hemisphere

Terms:
Cue:Hemisphere Residuals
Sum of Squares5.085930  4.279707
Deg. of Freedom  1 7

Residual standard error: 0.7819122
Estimated effects are balanced


[[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] jpeg or tiff file formats

2006-02-08 Thread Dean Sonneborn
I have been creating some graphic postscript files using xyplot but now 
I find that I need then in either the jpeg or tiff format.  I have tried 
re-running just the lattice plot so that it is on the screen and then 
using the jpeg(filename=myplot. from the bmp, jpec and png 
graphics devices documentation. It seems to create an empty file. Is it 
that this function can not work with lattice plots? Can R directly write 
a jpeg or pgn file?

-- 
Dean Sonneborn, MS
Programmer Analyst
Department of Public Health Sciences
University of California, Davis
(530) 754-9516

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


Re: [R] [R-sig-Geo] envi clone in R

2006-02-08 Thread Tim Keitt
Barry,

I hope you will share your code! We've been using QGIS and I have in
mind just such an interface to R.

We have ENVI in the lab and it is very powerful for image processing. It
would take many many person years to reproduce all of the advanced
algorithms in that package. (It does a lot of simple operations as well
and those could easily be recoded in R.)

THK

On Wed, 2006-02-08 at 18:09 +, Barry Rowlingson wrote:
 Wladimir Eremeev wrote:
  Hello all,
  
Research Systems (www.rsinc.com) have developed and distributes the 
  language IDL,
and the GIS ENVI, written in IDL.
 
   I find it hard to believe they wrote it all in IDL! I'm guessing its 
 probably scriptable in IDL, but underneath its written in something 
 else... I could be wrong though!
 
To my oppinion, R language is superior, compared to IDL, in all aspects.
However, ENVI is the rather convenient and feature rich tool.
 
   I clicked on 'Product Documentation' on the ENVI site and it wanted me 
 to log in or create a new user. To see the documentation? To find out 
 what the program is about?
 
   Oh, what I really wanted was the Feature Tour..
 
Is anyone aware about any work, dedicated to the creation of
something, similar to the ENVI, but in R?
 
   Last year I looked at GIS-R linkages, with the added criteria of being 
 open source and cross-platform. There are now a few free GIS packages 
 that can do this kind of thing, with a little added glue.
 
   I settled on OpenEV - it has vector and raster support, its extensible 
 in Python and uses Gtk for dialogs which you can customise. All I needed 
 was to get Python talking to R, so I wrote some Python bindings to 
 Rserve. Now I've got a GIS with a menu that drops down, you choose the 
 point layers you want to work on, click 'Go', and R does some analysis 
 that ends up as a raster layer back in the GIS. The user doesnt care 
 that R did it.
 
 Other GIS solutions are available!
 
 Barry
 
 ___
 R-sig-Geo mailing list
 R-sig-Geo@stat.math.ethz.ch
 https://stat.ethz.ch/mailman/listinfo/r-sig-geo
-- 
Timothy H. Keitt
Assistant Professor
http://www.keittlab.org/
http://www.utexas.edu/directory/index.php?q=Keitt

__
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] bwplot: how to display response variables separately in same panel?

2006-02-08 Thread Chris Behr
Hi -

I have two response variables 'y1' and 'y2' and a factor 'x'. I would like
to create paired box-whiskers plots for y1~x and y2~x and labeled for the
same x. the b-w plots would be side-by-side in the same panel - almost like
a barchart with two parallel columns for the same x.

the code 'bwplot(y1+y2~x, outer=T)' gives me two side-by-side panels. this
is ok, but not exactly what i am looking for.
any ideas?

thanks, chris


Christopher Behr
Principal Analyst

eDesign Dynamics
www.edesigndynamics.com

4024 Calvert St. NW
Washington DC 20007
(202) 298-6437 (t/f)
(551) 998-4823 (c)

__
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] jpeg or tiff file formats

2006-02-08 Thread Roger Bivand
On Wed, 8 Feb 2006, Dean Sonneborn wrote:

 I have been creating some graphic postscript files using xyplot but now 
 I find that I need then in either the jpeg or tiff format.  I have tried 
 re-running just the lattice plot so that it is on the screen and then 
 using the jpeg(filename=myplot. from the bmp, jpec and png 
 graphics devices documentation. It seems to create an empty file. Is it 
 that this function can not work with lattice plots? Can R directly write 
 a jpeg or pgn file?

Either FAQ 7.22 or dev.off()?

 
 

-- 
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] expand.grid without expanding

2006-02-08 Thread Ray Brownrigg
 From: =?iso-8859-1?q?Lu=EDs_Torgo?= [EMAIL PROTECTED]
 Date: Wed, 8 Feb 2006 18:08:40 +
 
 Dear list,
 I've recently came across a problem that I think I've solved and that I 
 wanted 
 to share with you for two reasons:
 - Maybe others come across the same problem.
 - Maybe someone has a much simpler solution that wants to share with me ;-)
 
 The problem is as follows: expand.grid() allows you to generate a data.frame 
 with all combinations of a set of values, e.g.:
  expand.grid(par1=-1:1,par2=c('a','b'))
   par1 par2
 1   -1a
 20a
 31a
 4   -1b
 50b
 61b
 
 There is nothing wrong with this nice function except when you have too many 
 combinations to fit in your computer memory, and that was my problem: I 
 wanted to do something for each combination of a set of variants, but this 
 set was to large for storing in memory in a data.frame generated by 
 expand.grid. A possible solution would be to have a set of nested for() 
 cycles but I preferred a solution that involved a single for() cycle going 
 from 1 to the number of combinations and then at each iteration having some 
 form of generating the combination i. And this was the real problem: how 
 to generate a function that picks the same style of arguments as 
 expand.grid() and provides me with the values corresponding to line i of 
 the data frame that would have been created bu expand.grid(). For instance, 
 if I wanted the line 4 of the above call to expand.grid() I should get the 
 same as doing:
  expand.grid(par1=-1:1,par2=c('a','b'))[4,]
   par1 par2
 4   -1b
 
 but obviously without having to use expand.grid() as that involves generating 
 a data frame that in my case wouldn't fit in the memory of my computer.
 
 Now, the function I've created was the following:
 
 getVariant - function(id,vars) {
   if (!is.list(vars)) stop('vars needs to be a list!')
   nv - length(vars)
   lims - sapply(vars,length)
   if (id  prod(lims)) stop('id above the number of combinations!')
   res - vector(list,nv)
   for(i in nv:2) {
 f - prod(lims[1:(i-1)])
 res[[i]] - vars[[i]][ceiling(id / f)]
 id - id - (ceiling(id/f)-1)*f
   }
   res[[1]] - vars[[1]][id]
   names(res) - names(vars)
   res
 }
 --
  expand.grid(par1=-1:1,par2=c('a','b'))[4,]
   par1 par2
 4   -1b
  getVariant(4,list(par1=-1:1,par2=c('a','b')))
 $par1
 [1] -1
 
 $par2
 [1] b
 
 I would be glad to know if somebody came across the same problem and has a 
 better suggestion on how to solve this.
 
A few minor improvements:
1) let id be a vector of indices
2) use %% and %/% instead of ceiling (perhaps debateable)
3) return a data frame as does expand.grid

So your function now looks like:

getVariant - function(id, vars) {
  if (!is.list(vars)) stop('vars needs to be a list!')
  nv - length(vars)
  lims - sapply(vars, length)
  if (any(id  prod(lims))) stop('id above the number of combinations!')
  res - vector(list, nv)
  for(i in nv:2) {
f - prod(lims[1:(i-1)])
res[[i]] - vars[[i]][(id - 1)%/%f + 1]
id - (id - 1)%%f + 1
  }
  res[[1]] - vars[[1]][id]
  names(res) - names(vars)
  return(as.data.frame(res))
}

Now, for example, you get:

 expand.grid(par1=-1:1,par2=c('a','b'),par3=c('w','x','y','z'))[12:15,]
   par1 par2 par3
121bx
13   -1ay
140ay
151ay
 getVariant(12:15,list(par1=-1:1,par2=c('a','b'), par3=c('w','x','y','z')))
  par1 par2 par3
11bx
2   -1ay
30ay
41ay
  

Note that you will run into trouble when the product of the lengths is
greater than the largest representable integer on your system.

Hope this helps,
Ray Brownrigg

__
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] Simple optim - question

2006-02-08 Thread Carsten Steinhoff
Hello,

I want to find the parameters mu and sigma that minimize the following
function.
It's important, that mu and sigma are strictly positive.

-
optimiere = function(fmean,smean,d,x,mu,sigma)
{
merk = c()
for (i in 1:length(d))
  merk=c(merk,1/(d[i]^2)*(d[i]-1/(fmean*(1-plnorm(x[i],mu,sigma^2)
return(sum(merk))
}
-

To do that I'm using the nlm function, but I only get results for ONE of the
two parameters.
I cannot cope with optimizing the two parameter problem simultaneously.
I've started with:

nlm(optimiere,p=5,fmean=10,smean=1,d=c(40,10),x=c(50,5),sigma=3.
5)

Then I tried to combine mu and sigma in one Vector. I get back two
parameters but the results are unreasonable since mu and sigma are
-0.3247726 and 4.7905308 but have to be strictly positive.

I've given up after hours and hope to get your help..
I'm sure the problem should be easily solved by one of the experts.

Thanks a lot.

__
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] Plotting a count process

2006-02-08 Thread voodooochild
hello everybody,

i want to plot a count process in the following way, but i don't know
how i can do that. i have data for example x-(0,2,6,2,8,4,.) and
dates y which is a vector of weekly dates for example
(01/01/06, 08/01/06, 15/01/06, 22/01/06, ), now i want to plot the
y's an the horizontal axis. On each date the count process jumps upwards
1 unit, so the vertical axis is 0, 1, 2, 3, ..
the distance between the dates is shown in vector x, so for example the
distance between 08/01/06 and 15/01/06 should be 2. maybe i can use some
times series functions for doing this?

i would be very thankful for any advice.

best regards
Andreas

__
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] ROracle installation problem with R2.2

2006-02-08 Thread Mathieu Drapeau
Hi,
I just installed R version 2.2.1, I installed DBI package and worked 
fine and then I installed ROracle but I got this error:

[EMAIL PROTECTED] bin]$ R CMD INSTALL 
--configure-args='--enable-extralibs' ../../ROracle_0.5-5.tar.gz
* Installing *source* package 'ROracle' ...
creating cache ./config.cache
checking how to run the C preprocessor... cc -E
updating cache ./config.cache
creating ./config.status
creating src/Makevars
sed: file conftest.s1 line 29: Unterminated `s' command
creating src/Makefile
sed: file conftest.s1 line 29: Unterminated `s' command
** libs
make: *** No targets.  Stop.
ERROR: compilation failed for package 'ROracle'
** Removing '/home/drapeau/download/R-2.2.1/library/ROracle'


Any idea what could cause this problem?
I used to install the same ROracle version with R version 1.9 and it worked.

Thanks,
Mathieu

__
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] bwplot: how to display response variables separately in same panel?

2006-02-08 Thread Deepayan Sarkar
On 2/8/06, Chris Behr [EMAIL PROTECTED] wrote:
 Hi -

 I have two response variables 'y1' and 'y2' and a factor 'x'. I would like
 to create paired box-whiskers plots for y1~x and y2~x and labeled for the
 same x. the b-w plots would be side-by-side in the same panel - almost like
 a barchart with two parallel columns for the same x.

 the code 'bwplot(y1+y2~x, outer=T)' gives me two side-by-side panels. this
 is ok, but not exactly what i am looking for.
 any ideas?

Unless you want to write your own panel function, you need to start by
coercing the data into the `long' format, e.g.

df - data.frame(y = c(y1, y2), x = rep(x, 2), which = gl(2, length(x)))

Then you can probably do [untested]

bwplot(y ~ which | x, df, layout = c(nlevels(x), 1))

or

bwplot(y ~ x:which, df)

Deepayan

__
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] Newton-Raphson algorithm

2006-02-08 Thread Frank Johannes
Hi,
I want to maximize a liklihood function with multiple parameters. There
is no closed-form analytical solution to the estimates of the
parameters, and I would like to implement a Newton-Raphson iterrative
approach. Is there a maximization procedure, such as the Newton-Raphson
algorithm, available in R? If not, does anybody have an idea how to best
go about solving simultenous equations numerically in R?

Thanks for your help.
Frank.

-- 

  love email again

__
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] List Conversion

2006-02-08 Thread Liz Dem
Hello,

I have a list (mode and class are list) in R that is many elements long and of 
the form:
length(list)
[1] 5778
list[1:4]
$ID1
[1] num1
$ID2
[1] num2 num3
$ID3
[1] num4
$ID4
[1] NA

I'd like to convert the $ID2 value to be in one element rather than in two.  It 
shows up as c(\num2\, \num3\) if I try to use paste(list[2], collapse=).  
I need to do this over the length of the entire list, however list2 - 
apply(list, 1, paste, collapse=) tells me 'Error in apply : dim(X) must have 
a positive length'.  dim(list) does not have a positive length, which I think 
is due to the fact that it's a list and not a matrix or data frame.  

What I want to get is:
list[1:4]
$ID1
[1] num1
$ID2
[1] num2 num3
$ID3
[1] num4
$ID4
[1] NA

Thanks.
Liz

-- 
___
Play 100s of games for FREE! http://games.mail.com/

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


Re: [R] List Conversion

2006-02-08 Thread Berwin A Turlach
 LD == Liz Dem [EMAIL PROTECTED] writes:

LD I have a list (mode and class are list) in R that is many elements long 
and of the form:
 length(list)
LD [1] 5778
 list[1:4]
LD $ID1
LD [1] num1
LD $ID2
LD [1] num2 num3
LD $ID3
LD [1] num4
LD $ID4
LD [1] NA

LD I'd like to convert the $ID2 value to be in one element rather
LD than in two.  It shows up as c(\num2\, \num3\) if I try to
LD use paste(list[2], collapse=).
You want list[[2]], not list[2]:

 tt - list(ID1=num1, ID2=c(num2, num3), ID3 = num4, ID4 =NA)
 tt
$ID1
[1] num1

$ID2
[1] num2 num3

$ID3
[1] num4

$ID4
[1] NA

 paste(tt[2], collapse=)
[1] c(\num2\, \num3\)
  paste(tt[[2]], collapse=)
[1] num2num3
  paste(tt[[2]], collapse= )
[1] num2 num3


LD I need to do this over the length of the entire list, however
LD list2 - apply(list, 1, paste, collapse=) tells me 'Error in
LD apply : dim(X) must have a positive length'.
You want to use `lapply' not `apply':
 tt1 - lapply(tt, paste, collapse= )
 tt1
$ID1
[1] num1

$ID2
[1] num2 num3

$ID3
[1] num4

$ID4
[1] NA

LD What I want to get is:
 list[1:4]
LD $ID1
LD [1] num1
LD $ID2
LD [1] num2 num3
LD $ID3
LD [1] num4
LD $ID4
LD [1] NA
In that case, if you don't want NA's to turn into strings:

 tt2 - lapply(tt, function(x) if(is.na(x[1])) NA else paste(x, collapse= ))
 tt2
$ID1
[1] num1

$ID2
[1] num2 num3

$ID3
[1] num4

$ID4
[1] NA

HTH.

Cheers,

Berwin

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

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


  1   2   >