Re: [R] Re:How to create a R -application

2004-10-08 Thread Petr Pikal


On 7 Oct 2004 at 17:49, Adaikalavan Ramasamy wrote:

 This is not answering your question directly.
 
 I usually use the BATCH command for running R non-interactively. You
 can also use commandArgs() to get any arguments from the command line.
 For more information, see help(BATCH) or help(commandArgs).
 

Or you can make a function from your commands and use it to 
process your data. See ?function and Writing your own functions 
in intro docs.

Or you can copy/paste to some suitable text editor, save it as plain 
text and copy/paste it back to R later (with any modifications).

Cheers
Petr


 
 On Thu, 2004-10-07 at 16:14, Kunal Shetty wrote:
  Dear R- users and Helpers
  
 I am a beginner for R. I am using R to implement EM algorithm
 for treating Missing values. I would like to know how can
 save or compile my logical R commands to an application; so
 that the next time I could just execute the R- file.
  
  Example for calculating the mean of  a data set
  
  x - c(8,11,16,18,6,4,20,25,9,13)
  u - mean(x)
  u
  
  Now I would like to save these commands as batch or an application
  
  Anybody could please help or direct me in this problem
  Thank you
  Regards
  Kunal
  
  __
  [EMAIL PROTECTED] mailing list
  https://stat.ethz.ch/mailman/listinfo/r-help
  PLEASE do read the posting guide!
  http://www.R-project.org/posting-guide.html
 
 
 __
 [EMAIL PROTECTED] mailing list
 https://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]

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


[R] reading partial file content

2004-10-08 Thread Marc Mamin
hi,


I'd like to extract data from very large files (ca 1-2 Mio lines),
and I already know which lines of these files I need.

Is there a way to do it without filling the memory with the whole file content?

The lines I need are randomly distributed within the files.

Thanks,

Marc






-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of Kunal Shetty
Sent: Friday, October 08, 2004 5:16 AM
To: Austin, Matt
Cc: R-help
Subject: RE: [R] Read.Table Reading a Text file




  thanks austin, it worked..it was exactly what I was looking for

regards
Kunal


Austin, Matt [EMAIL PROTECTED] wrote:
 x.1$V1
 or
 x.1[,1]
 or
 x.1['V1']
 
 and you shouldn't need to call print.default() directly, just call
 print().
 
 --Matt
 -Original Message-
 From: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED] Behalf Of Kunal Shetty
 Sent: Thursday, October 07, 2004 18:44 PM
 To: [EMAIL PROTECTED]
 Cc: R-help
 Subject: Re: [R] Read.Table Reading a Text file
 
 
 
 James
Thank you for response. I am working on treatment for missing
 data for both bivariate and multivariate normal data. Coming back to
 example. My problem was that once we do execute this command 
 x.1 - read.table('/tempxx.txt', fill=T)
 
 
 How can access the particular column say X8 and all it's values so that I
 could assign some other operations on them.
 Because if I say 
 print.default(x.1)
 
 the result..
 
V1  V2
 1  Xy
 2  810
 3 11   1 4
 4 16   16
 5 18   15
 6  620
 7  4 4
 8 20   18
 9 2522
 
 
 and I want to access V1  values.
 
 
 thank you
 regards
 Kunal
 
 
 [EMAIL PROTECTED] wrote:
 
 
 
 
  If you have an unequal number of columns, then use 'fill=T' onread.table
 
  It putsNAs.
 
  Is this what youwant?
 
  Here is what happens on the input file which is your data and someextra
 columns:
 
  8   10
  11  14
  16  16
  18   15  12
  6   20
  44  12
  20  18
 
 
   x.1 - read.table('/tempxx.txt',fill=T)
  x.1
 X8X10
  11 14 NA
  16 16 NA
  18 15 12
  6  20 NA
  4   4 12
  20 18 NA
 __
  James HoltmanWhat is the problem you are trying tosolve?
  Executive Technical Consultant  --  Office of Technology,Convergys
 [EMAIL PROTECTED]
  +1 (513)723-2929
 
 
 
  KunalShetty
  [EMAIL PROTECTED] To:[EMAIL PROTECTED]
  .educc:
  Sent by: Subject: [R] Read.Table Reading a Textfile
 [EMAIL PROTECTED]
 ath.ethz.ch
 
 
  10/07/200416:18
 
 
 
 
 
 
  Dear R users andHelpers
 
  I am beginner with using R and interested in carrying out certaintask
 for
  my statisticalresearch.
  I am reading data for a text file, which could contain data infollowing
 pattern
 
  x   y
  8   10
  11  14
  16  16
  18  15
  6   20
  4   4
  20  18
 
  As per the example I have two columns and 7 rows of data ineach.
  However is real life data situation I may not know how many columnsare
  present and how rows are present  and also with the certain datais
  missing. Yes I am assuming the data is delimited myTab.
 
 
  My question or rather problem is I want read data from each colum saycol
 x
  (8,11,16,18âEUR¦.20) and store it into a variable so that I couldperform
 some
  operations onthem.
 
  I have also looked into certain R-help for Read.table and data.framebut
  still struggling on my requirement. Theyare
 
 http://tolstoy.newcastle.edu.au/R/help/04/07/2040.html
 http://tolstoy.newcastle.edu.au/R/help/04/07/3152.html
 
 
 Regards
 Kunal
 
 __
  [EMAIL PROTECTED] mailinglist
 https://stat.ethz.ch/mailman/listinfo/r-help
  PLEASE do read the postingguide!
 http://www.R-project.org/posting-guide.html
 
 
 __
 [EMAIL PROTECTED] mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide!
 http://www.R-project.org/posting-guide.html

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

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


Re: [R] reading partial file content

2004-10-08 Thread Prof Brian Ripley
Please do not tack your question on to a different one (as the posting 
guide does ask you not to).

On Fri, 8 Oct 2004, Marc Mamin wrote:

 hi,
 
 
 I'd like to extract data from very large files (ca 1-2 Mio lines),
 and I already know which lines of these files I need.
 
 Is there a way to do it without filling the memory with the whole file
 content?

Yes, several, and it has been discussed on this list on Wednesday, in a 
thread entitled

`Performing Analysis on Subset of External data'

Please look in the archives.

 The lines I need are randomly distributed within the files.

[irrelevant other message discarded here.]

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

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


Re: [R] Read.Table Reading a Text file

2004-10-08 Thread Petr Pikal


On 7 Oct 2004 at 20:18, Kunal Shetty wrote:

 Dear R users and Helpers
 
 I am beginner with using R and interested in carrying out certain task
 for my statistical research. I am reading data for a text file, which
 could contain data in following pattern
 
 x y
 8 10
 1114
 1616
 1815
 6 20
 4 4
 2018
 
 As per the example I have two columns and 7 rows of data in each.
 However is real life data situation I may not know how many columns
 are present and how rows are present  and also with the certain data
 is missing. Yes I am assuming the data is delimited my Tab.
 
 
 My question or rather problem is I want read data from each colum say
 col x (8,11,16,18?.20) and store it into a variable so that I could
 perform some operations on them.

Hi

Better to read by appropriate read.whatever() function to data 
frame, see eg. ?read.table 

I hope you have already read some intro documents in which there 
is stated how you could read your data and organize them. I also 
recommend to go through Paul Johnsons Rtips. You can find it by 
e.g. Google.

Cheers
Petr



 
 I have also looked into certain R-help for Read.table and data.frame
 but still struggling on my requirement. They are
 
 http://tolstoy.newcastle.edu.au/R/help/04/07/2040.html
 http://tolstoy.newcastle.edu.au/R/help/04/07/3152.html
 
 
 Regards
 Kunal
 
 __
 [EMAIL PROTECTED] 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]

__
[EMAIL PROTECTED] 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] Read.Table Reading a Text file

2004-10-08 Thread Petr Pikal
Hi

you really should spend some time to go through introductory 
documentation and do some examples provided.

snip

On 8 Oct 2004 at 3:15, Kunal Shetty wrote:

you probably read it by read.table without saying/specifying 
header=TRUE so your X and y is included to your data not as 
names but as values. Therefore V1 and V2 are factors.

Please consult especially R-intro manual in doc directory. It helps 
you to save a lot of frustration and misunderstanding, especially at 
the begging of your work with R. 

And consider help list as a last source of help as what you have 
learned yourself you remember better and you understand better.

Cheers
Petr

 
  
 V1  V2
  1  Xy
  2  810
  3 11   1 4
  4 16   16
  5 18   15
  6  620
  7  4 4
  8 20   18
  9 2522
  
  
  and I want to access V1  values.
  
  
  thank you
  regards
  Kunal
  
  
  [EMAIL PROTECTED] wrote:
  
  
  
  
   If you have an unequal number of columns, then use 'fill=T'
   onread.table
  
   It putsNAs.
  
   Is this what youwant?
  
   Here is what happens on the input file which is your data and
   someextra
  columns:
  
   8   10
   11  14
   16  16
   18   15  12
   6   20
   44  12
   20  18
  
  
x.1 - read.table('/tempxx.txt',fill=T)
   x.1
  X8X10
   11 14 NA
   16 16 NA
   18 15 12
   6  20 NA
   4   4 12
   20 18 NA
  __
   James HoltmanWhat is the problem you are trying tosolve?
   Executive Technical Consultant  --  Office of Technology,Convergys
  [EMAIL PROTECTED]
   +1 (513)723-2929
  
  
  
   KunalShetty
   [EMAIL PROTECTED] To:[EMAIL PROTECTED]
   .educc:
   Sent by: Subject: [R] Read.Table Reading a Textfile
  [EMAIL PROTECTED]
  ath.ethz.ch
  
  
   10/07/200416:18
  
  
  
  
  
  
   Dear R users andHelpers
  
   I am beginner with using R and interested in carrying out
   certaintask
  for
   my statisticalresearch.
   I am reading data for a text file, which could contain data
   infollowing
  pattern
  
   x   y
   8   10
   11  14
   16  16
   18  15
   6   20
   4   4
   20  18
  
   As per the example I have two columns and 7 rows of data ineach.
   However is real life data situation I may not know how many
   columnsare present and how rows are present  and also with the
   certain datais missing. Yes I am assuming the data is delimited
   myTab.
  
  
   My question or rather problem is I want read data from each colum
   saycol
  x
   (8,11,16,18EUR.20) and store it into a variable so that I
   couldperform
  some
   operations onthem.
  
   I have also looked into certain R-help for Read.table and
   data.framebut still struggling on my requirement. Theyare
  
  http://tolstoy.newcastle.edu.au/R/help/04/07/2040.html
  http://tolstoy.newcastle.edu.au/R/help/04/07/3152.html
  
  
  Regards
  Kunal
  
  __
   [EMAIL PROTECTED] mailinglist
  https://stat.ethz.ch/mailman/listinfo/r-help
   PLEASE do read the postingguide!
  http://www.R-project.org/posting-guide.html
  
  
  __
  [EMAIL PROTECTED] mailing list
  https://stat.ethz.ch/mailman/listinfo/r-help
  PLEASE do read the posting guide!
  http://www.R-project.org/posting-guide.html
 
 __
 [EMAIL PROTECTED] mailing list
 https://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]

__
[EMAIL PROTECTED] 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] library in R2.0.0 - summary

2004-10-08 Thread Petr Pikal
Thanks to Andy Liaw and prof.Ripley for their comments.

I finally managed my function set work without need for proper 
installation. However I must try it sometimes.

I got tools from 
http://www.murdoch-sutherland.com/Rtools/tools.zip

but I did not install Pearl yet. I tried

make pkg-fun

which resulted in sequence of errors which I corrected according 
what I was told by screen and documentation (best thanks to all 
who provided it)

and finally I end with

1. modified DESCRIPTION file
2. functional set of my functions
3. error message perl: not found

So next step will be trying to install perl (if I am allowed by 
suspicious network administrator) and completing the whole 
installation.

Thanks again.

Petr


  From: Petr Pikal
  
  Hi all
  
  I upgraded to 2.0.0 version and did everything as I used to do
  before.
  
  I installed windows binary, copy/paste other than bundled 
  packages. 
  
  I got e.g.
   library(chron)
  Error in library(chron) : 'chron' is not a valid package -- 
  installed  
  2.0.0?
  
  so I loaded it from CRAN and everything worked OK except my 
  own personal functions (they are not on CRAN). So I went 
  through NEWS file which says:
  
  o   Packages must have been re-installed for this version, and
  library() will enforce this.
  
  I have never done it, my simple set of functions was never actually
  installed. I used copy/paste the directory from old R version to new
  one and I used library(fun) in personal .Rprofile to load my
  function set. Doing that again I got:
  
  Error in library(fun) : There is no package called 'fun'
  
  I know I can use source
  source(D:/programy/R/rw2000/library/fun/R/fun)
  but I feel library way is better way and I think I could try it.
  
  Before I start to try transferring my function set to a real 
  package I 
  would like to ask simple ***question***.
  
  Is the error message result of not installing package fun correctly
  (at all) or I shall do something more than follow instructions in
  README.packages and other documentation?
  --
  ---
  
  Thank you.
  
  Petr Pikal
  [EMAIL PROTECTED]
  
Petr Pikal
[EMAIL PROTECTED]

__
[EMAIL PROTECTED] 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] Bug in nlme under version 2.0.0

2004-10-08 Thread Søren Højsgaard
Dear all,
Under version 2.0.0, I get the error below when calling summary() on a lme-object, 
whereas it works under version 1.9.1 (well, it did last week, before I upgraded). Any 
help on this?
Thx in advance
Søren

 library(nlme)
 mf - formula(Weight~Cu*(Time+I(Time^2)+I(Time^3)))
 lme1 - lme(mf, data = dietox, random=~1|Pig)
 summary(lme1)
Linear mixed-effects model fit by REML
 Data: dietox 
   AIC  BIClogLik
  4748.664 4815.081 -2360.332

Random effects:
 Formula: ~1 | Pig
(Intercept) Residual
StdDev:6.360083 3.116751

Fixed effects: Error in as.vector(x, list) : cannot coerce to vector

__
[EMAIL PROTECTED] 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] Evaluating Assignment-Operator R 2.0.0

2004-10-08 Thread friedemann
Dear Helpers,

in which way I have to use the assignment-operator evaluating left to right 
with R 2.0.0?

With R 2.0.0 (w2k-installation) the superassignment operator '-' seems to 
have a different behaviour compared with R 1.9.1 :

   x-4
   x
  [1] 4
   attr(x,'y')-5
  Error: Object x not found
  

Using earlier versions of R I never got this error.

In the NEWS file and the docs coming along with R 2.0.0 I did not found 
anything concerning this problem.
AFAIK '=' instead of '-' works - but is allowed only for toplevel-
assignments. 

Thanks in advance, Friedemann

__
[EMAIL PROTECTED] 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] confidence interval for nls

2004-10-08 Thread Peter Dalgaard
Henrik Andersson [EMAIL PROTECTED] writes:

 I tried the example and it works fine,
 
 but why o why, do I not get any gradient from another prediction?


Apparently this depends on whether you supply an RHS which returns the
gradient. The built-in SS all do that.
 
 ##plot(yran~x)
 mich - function(x,K,rmax) rmax*x/(x+K)
 mm.nls - nls(yran~mich(x,K,rmax),start=list(K=5,rmax=3))

So: Here you need to add a gradient computation to mich(). One simple
way (and pretty much what nls does internally) is

mich - function(x,K,rmax)
   numericDeriv(quote(rmax*x/(x+K)),c(K,rmax),
   parent.frame())

(well, figuring out the parent.frame() bit wasn't all *that* trivial!)

Or, nice when dealing with simple functions:

mmDeriv - deriv(quote(rmax*x/(x+K)),c(K,rmax))
mich - function(x,K,rmax) eval.parent(mmDeriv)

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

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


Re: [R] Evaluating Assignment-Operator R 2.0.0

2004-10-08 Thread Prof Brian Ripley
On Fri, 8 Oct 2004, friedemann wrote:

 Dear Helpers,
 
 in which way I have to use the assignment-operator evaluating left to right 
 with R 2.0.0?

- is the operator you should normally use.

 With R 2.0.0 (w2k-installation) the superassignment operator '-' seems to 
 have a different behaviour compared with R 1.9.1 :
 
x-4
x
   [1] 4
attr(x,'y')-5
   Error: Object x not found
   
 
 Using earlier versions of R I never got this error.
 
 In the NEWS file and the docs coming along with R 2.0.0 I did not found 
 anything concerning this problem.

Did you not notice NEWS contains

   o   Complex superassignments were wrong when a variable with the same
name existed locally, and were not documented in R-lang.

 AFAIK '=' instead of '-' works - but is allowed only for toplevel-
 assignments. 

= is allowed almost everywhere - is, and not just at top-level.
I don't know what you are really trying to do, but

x - 4
testit - function() attr(x,'y') - 5
testit()
x

works as documented, and that is the normal type of usage of
superassignments.  As the NEWS entry says, R-lang (`The R Language 
Definition') gives fuller details (and I guess the help page for - 
should point 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

__
[EMAIL PROTECTED] 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] Evaluating Assignment-Operator R 2.0.0

2004-10-08 Thread Peter Dalgaard
friedemann [EMAIL PROTECTED] writes:

 With R 2.0.0 (w2k-installation) the superassignment operator '-' seems to 
 have a different behaviour compared with R 1.9.1 :
 
x-4
x
   [1] 4
attr(x,'y')-5
   Error: Object x not found
   
 
 Using earlier versions of R I never got this error.
 
 In the NEWS file and the docs coming along with R 2.0.0 I did not found 
 anything concerning this problem.

It's there. Look for complex superassignment.

 AFAIK '=' instead of '-' works - but is allowed only for toplevel-
 assignments. 

Eh? You mean assignments in the current environment? 

Why do you want to use - at top level (the command-line) anyway? 

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

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


Re: [R] R-(wiki)-pedia?

2004-10-08 Thread Barry Rowlingson
Here's a function for searching the Rwiki from R:
rwiki.search - function(string){
  RwikiURL=http://fawn.unibw-hamburg.de/cgi-bin/Rwiki.pl;
  RwikiSearchURL=paste(RwikiURL(),?search=,string,sep='')
  browseURL(RwikiSearchURL)
  return(invisible(0))
}
Then you can do rwiki.search(gabor) and the results pop up in your 
browser.

Perhaps we need some more documentation-getting functions in R, such as 
this, something to search the mailing list archives, and maybe a 
readPostingGuide() function...

Or is this spoonfeeding too much, and people should be able to go to a 
web page and stick something in the search box?

Baz
__
[EMAIL PROTECTED] 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] submitting to R

2004-10-08 Thread Ziedonis Grislis
Dear Colleagues,
would you like to explain in which way we can get possibility to use some version of R 
for Window.
Sincerely yours
Ziedonis Greislis

***
  Dr. Ziedonis Grislis
Head of Laboratory of Quantitative Genetics
Department of Animal Science
LatviaUniversity of Agriculture
2, Liela Str, Jelgava, LV-3001
LATVIA
Tel.:  +371-30-05661, +371-30- 05663
Fax: +371- 30-27238
E-mail: [EMAIL PROTECTED]
**

__
[EMAIL PROTECTED] 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] Correlation Matrix

2004-10-08 Thread Vito Ricci
Hi,

I'm dealing with a datamining analysis: I've a lot of
categories of product sold per week (n. week =26, n.
categories about 50.
my dataframe is like this:

  Settimana ALIMENTI..ALTRI. ALIMENTI.APROTEICI
1  13 19
2  22  0
3  31 22
4  42  6

I computed correlation coefficents among categories
having a correlation matrix (53X53). Now I will
extract from this matrix only significative
correlations, or, in alternative correlations 0.5 and
-0.5, excluding  the other, and put this coefficients
in a dataframe.

I'm looking for significative correlations among
categories.

Is someone could help me? Many thanks in advance.
Is also someone using R for dataminig analysis like
me?

Vito


=
Diventare costruttori di soluzioni

The business of the statistician is to catalyze 
the scientific learning process.  
George E. P. Box


Visitate il portale http://www.modugno.it/
e in particolare la sezione su Palese http://www.modugno.it/archivio/cat_palese.shtml

__
[EMAIL PROTECTED] 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] submitting to R

2004-10-08 Thread Christian Hennig
Read the (Windows-)FAQ.

Next time, please read the FAQ and the posting guide before posting to
r-help...

Christian

On Fri, 8 Oct 2004, Ziedonis Grislis wrote:

 Dear Colleagues,
 would you like to explain in which way we can get possibility to use some version of 
 R for Window.
 Sincerely yours
 Ziedonis Greislis
 
   ***
 Dr. Ziedonis Grislis
   Head of Laboratory of Quantitative Genetics
   Department of Animal Science
   LatviaUniversity of Agriculture
   2, Liela Str, Jelgava, LV-3001
   LATVIA
   Tel.:  +371-30-05661, +371-30- 05663
   Fax: +371- 30-27238
   E-mail: [EMAIL PROTECTED]
   **
 
 __
 [EMAIL PROTECTED] mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
 

***
Christian Hennig
Fachbereich Mathematik-SPST/ZMS, Universitaet Hamburg
[EMAIL PROTECTED], http://www.math.uni-hamburg.de/home/hennig/
###
ich empfehle www.boag-online.de

__
[EMAIL PROTECTED] 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] submitting to R

2004-10-08 Thread Dimitris Rizopoulos
try these urls:
http://www.cran.mirrors.pair.com/bin/windows/
http://www.cran.mirrors.pair.com/bin/windows/base/
Best,
Dimitris

Dimitris Rizopoulos
Ph.D. Student
Biostatistical Centre
School of Public Health
Catholic University of Leuven
Address: Kapucijnenvoer 35, Leuven, Belgium
Tel: +32/16/396887
Fax: +32/16/337015
Web: http://www.med.kuleuven.ac.be/biostat/
http://www.student.kuleuven.ac.be/~m0390867/dimitris.htm
- Original Message - 
From: Ziedonis Grislis [EMAIL PROTECTED]
To: '[EMAIL PROTECTED]' [EMAIL PROTECTED]
Sent: Friday, October 08, 2004 1:21 PM
Subject: [R] submitting to R


Dear Colleagues,
would you like to explain in which way we can get possibility to use 
some version of R for Window.
Sincerely yours
Ziedonis Greislis

***
  Dr. Ziedonis Grislis
Head of Laboratory of Quantitative Genetics
Department of Animal Science
LatviaUniversity of Agriculture
2, Liela Str, Jelgava, LV-3001
LATVIA
Tel.:  +371-30-05661, +371-30- 05663
Fax: +371- 30-27238
E-mail: [EMAIL PROTECTED]
**
__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! 
http://www.R-project.org/posting-guide.html

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


Re: [R] Correlation Matrix

2004-10-08 Thread Sundar Dorai-Raj

Vito Ricci wrote:
Hi,
I'm dealing with a datamining analysis: I've a lot of
categories of product sold per week (n. week =26, n.
categories about 50.
my dataframe is like this:
  Settimana ALIMENTI..ALTRI. ALIMENTI.APROTEICI
1  13 19
2  22  0
3  31 22
4  42  6
I computed correlation coefficents among categories
having a correlation matrix (53X53). Now I will
extract from this matrix only significative
correlations, or, in alternative correlations 0.5 and
-0.5, excluding  the other, and put this coefficients
in a dataframe.
I'm looking for significative correlations among
categories.
Is someone could help me? Many thanks in advance.
Is also someone using R for dataminig analysis like
me?
Vito
Assuming `x' is your data above, how about the following:
r - cor(x)
y - which(lower.tri(r), TRUE)
z - data.frame(row = rownames(r)[y[, 1]],
col = colnames(r)[y[, 2]],
cor = r[y])
subset(z, abs(cor)  0.5)
#row   colcor
# 1 ALIMENTI..ALTRI. Settimana -0.6324555
--sundar
__
[EMAIL PROTECTED] 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] Correlation Matrix

2004-10-08 Thread Vito Ricci
Hi Sundar,
many thanks for your suggestion: it's just I wished!
Best
Vito



 --- Sundar Dorai-Raj [EMAIL PROTECTED] ha
scritto: 
 
 
 Vito Ricci wrote:
 
  Hi,
  
  I'm dealing with a datamining analysis: I've a lot
 of
  categories of product sold per week (n. week =26,
 n.
  categories about 50.
  my dataframe is like this:
  
Settimana ALIMENTI..ALTRI. ALIMENTI.APROTEICI
  1  13 19
  2  22  0
  3  31 22
  4  42  6
  
  I computed correlation coefficents among
 categories
  having a correlation matrix (53X53). Now I will
  extract from this matrix only significative
  correlations, or, in alternative correlations 0.5
 and
  -0.5, excluding  the other, and put this
 coefficients
  in a dataframe.
  
  I'm looking for significative correlations among
  categories.
  
  Is someone could help me? Many thanks in advance.
  Is also someone using R for dataminig analysis
 like
  me?
  
  Vito
  
 
 Assuming `x' is your data above, how about the
 following:
 
 r - cor(x)
 y - which(lower.tri(r), TRUE)
 z - data.frame(row = rownames(r)[y[, 1]],
  col = colnames(r)[y[, 2]],
  cor = r[y])
 subset(z, abs(cor)  0.5)
 
 #row   colcor
 # 1 ALIMENTI..ALTRI. Settimana -0.6324555
 
 --sundar
 
 
  

=
Diventare costruttori di soluzioni

The business of the statistician is to catalyze 
the scientific learning process.  
George E. P. Box


Visitate il portale http://www.modugno.it/
e in particolare la sezione su Palese http://www.modugno.it/archivio/cat_palese.shtml

__
[EMAIL PROTECTED] 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] RWinEdt

2004-10-08 Thread henna001
Hi,

I have troubles getting RWinEdt with the R2.0.0 Version startet.

Do I have to install a different version of RWinEdt or WinEdt?
I have RWinEdt 1.6.1 and WinEdt 5.3.

Thanks
Anna Hennig

__
[EMAIL PROTECTED] 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] RWinEdt

2004-10-08 Thread Andy Bunn
Anna:

That is the most current version of RWinEdt. Uwe Ligges is working on a
version for 2.0.0 so check back soon for a new release.

http://cran.r-project.org/contrib/extra/winedt/

Also, when inquiring about a specific package it is often helpful to contact
the maintainer directly and not R-help.

HTH,
Andy

 -Original Message-
 From: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED] Behalf Of
 [EMAIL PROTECTED]
 Sent: Friday, October 08, 2004 8:14 AM
 To: [EMAIL PROTECTED]
 Subject: [R] RWinEdt


 Hi,

 I have troubles getting RWinEdt with the R2.0.0 Version startet.

 Do I have to install a different version of RWinEdt or WinEdt?
 I have RWinEdt 1.6.1 and WinEdt 5.3.

 Thanks
 Anna Hennig

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


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


Re: [R] RWinEdt

2004-10-08 Thread Uwe Ligges
[EMAIL PROTECTED] wrote:
Hi,
I have troubles getting RWinEdt with the R2.0.0 Version startet.
Do I have to install a different version of RWinEdt or WinEdt?
I have RWinEdt 1.6.1 and WinEdt 5.3.
You have either to wait for RWinEdt_1.6-2 (which already has been 
uploaded to CRAN's incoming area and waits for the CRAN maintainers to 
move it) or to follow the alternative way for installation described in 
the ReadMe, or to get it right now (but only temporarily available) from 
the following link:

http://www.statistik.uni-dortmund.de/~ligges/RWinEdt_1.6-2.zip
Maybe of interest to all the other R-WinEdt users (some of them already 
wrote private messages, which is the appropriate way in this case!):
The new version of R-WinEdt is updated for use with R-2.0.0. 
Installation has been simplified, because Omegahat's SWinRegistry 
package is no longer required. The complete code from SWinRegistry has 
been included in the RWinEdt package, therefore many thanks to Duncan 
Temple Lang.

Uwe Ligges

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


Re: [R] submitting to R

2004-10-08 Thread Duncan Murdoch
On Fri, 8 Oct 2004 13:34:42 +0200, Dimitris Rizopoulos
[EMAIL PROTECTED] wrote :

try these urls:

http://www.cran.mirrors.pair.com/bin/windows/
http://www.cran.mirrors.pair.com/bin/windows/base/

The pair.com mirror can certainly handle the traffic, but you might
find one of the European mirrors (see the list at
http://cran.r-project.org/mirrors.html) is faster from Leuven or
Jelgava.

Duncan Murdoch

Best,
Dimitris


Dimitris Rizopoulos
Ph.D. Student
Biostatistical Centre
School of Public Health
Catholic University of Leuven

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


- Original Message - 
From: Ziedonis Grislis [EMAIL PROTECTED]
To: '[EMAIL PROTECTED]' [EMAIL PROTECTED]
Sent: Friday, October 08, 2004 1:21 PM
Subject: [R] submitting to R


 Dear Colleagues,
 would you like to explain in which way we can get possibility to use 
 some version of R for Window.
 Sincerely yours
 Ziedonis Greislis

 ***
   Dr. Ziedonis Grislis
 Head of Laboratory of Quantitative Genetics
 Department of Animal Science
 LatviaUniversity of Agriculture
 2, Liela Str, Jelgava, LV-3001
 LATVIA
 Tel.:  +371-30-05661, +371-30- 05663
 Fax: +371- 30-27238
 E-mail: [EMAIL PROTECTED]
 **

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


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

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


[R] testing for differences in parameter estimates from parametric bootstrapping

2004-10-08 Thread Victor Gravenholt
Based on a rather complicated model I do parametric bootstrapping to obtain 
bootstrap distributions of the parameters of interest. What is the proper 
way to test whether the parameter estimates are significantly different (the 
differences in parameter estimates are expected from including different 
covariates in the model)?

__
[EMAIL PROTECTED] 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] Bug in nlme under version 2.0.0

2004-10-08 Thread Douglas Bates
Søren Højsgaard wrote:
Dear all,
Under version 2.0.0, I get the error below when calling summary() on a lme-object, 
whereas it works under version 1.9.1 (well, it did last week, before I upgraded). Any 
help on this?
Thx in advance
Søren

library(nlme)
mf - formula(Weight~Cu*(Time+I(Time^2)+I(Time^3)))
lme1 - lme(mf, data = dietox, random=~1|Pig)
summary(lme1)
Linear mixed-effects model fit by REML
 Data: dietox 
   AIC  BIClogLik
  4748.664 4815.081 -2360.332

Random effects:
 Formula: ~1 | Pig
(Intercept) Residual
StdDev:6.360083 3.116751
Fixed effects: Error in as.vector(x, list) : cannot coerce to vector
I can't reproduce this problem on a simple example like
library(nlme)
example(lme)
summary(fm1)
Can you give us more information on your platform, the version of nlme, 
and perhaps make the data set available on the Internet so we can try to 
reproduce the problem?

Just as a guess, do you happen to have the lme4 package loaded before 
loading nlme?  The two packages cannot be loaded simultaneously.  This 
is detected if you load them in the order nlme, lme4 but not if you load 
them in the other order.

__
[EMAIL PROTECTED] 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] provide extra variables to environment in call

2004-10-08 Thread Khamenia, Valery
Hi all,

Situation: 

 there is a function `f' already defined by someone and 
 provided in package. `f' looks like that:

  f - function() {
x+1
  }

 i.e. `f' is not closed i.r.t. term `x'

 now I have my own function `g', where I'd like
 to override variable `x' while calling `f':

  x - dummy gloabal value

  g - function() {
x - 42
eval(f(), environment()) # how to make loacl `x' visible in `f'?
  }

  g() # = Error in x + 1 : non-numeric argument to binary operator

Here comes the question:

 What is the right way to call `f' in order to override 
 global value of `x' with the local value defined within 
 of function `g' ?

I see that i've missed something in docs for eval/environments and related.

Thank you in advance.
--
Valery.

__
[EMAIL PROTECTED] 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] provide extra variables to environment in call

2004-10-08 Thread Liaw, Andy
Not an direct answer to your question, but why not do something like:

 f - function() x + 1
 x - 10
 f()
[1] 11
 g - function(x, ...) {
+ my.f - f
+ formals(my.f) - c(list(x=NULL), formals(f))
+ my.f(x, ...)
+ }
 g(5)
[1] 6

Andy

 From: Khamenia, Valery
 
 Hi all,
 
 Situation: 
 
  there is a function `f' already defined by someone and 
  provided in package. `f' looks like that:
 
   f - function() {
 x+1
   }
 
  i.e. `f' is not closed i.r.t. term `x'
 
  now I have my own function `g', where I'd like
  to override variable `x' while calling `f':
 
   x - dummy gloabal value
 
   g - function() {
 x - 42
 eval(f(), environment()) # how to make loacl `x' visible in `f'?
   }
 
   g() # = Error in x + 1 : non-numeric argument to binary operator
 
 Here comes the question:
 
  What is the right way to call `f' in order to override 
  global value of `x' with the local value defined within 
  of function `g' ?
 
 I see that i've missed something in docs for 
 eval/environments and related.
 
 Thank you in advance.
 --
 Valery.
 
 __
 [EMAIL PROTECTED] mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide! 
 http://www.R-project.org/posting-guide.html
 


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


Re: [R] provide extra variables to environment in call

2004-10-08 Thread Gabor Grothendieck
Khamenia, Valery V.Khamenia at biovision-discovery.de writes:

: 
: Hi all,
: 
: Situation: 
: 
:  there is a function `f' already defined by someone and 
:  provided in package. `f' looks like that:
: 
:   f - function() {
: x+1
:   }
: 
:  i.e. `f' is not closed i.r.t. term `x'
: 
:  now I have my own function `g', where I'd like
:  to override variable `x' while calling `f':
: 
:   x - dummy gloabal value
: 
:   g - function() {
: x - 42
: eval(f(), environment()) # how to make loacl `x' visible in `f'?
:   }
: 
:   g() # = Error in x + 1 : non-numeric argument to binary operator
: 
: Here comes the question:
: 
:  What is the right way to call `f' in order to override 
:  global value of `x' with the local value defined within 
:  of function `g' ?
: 
: I see that i've missed something in docs for eval/environments and related.

f - function() x+1
g - function() {
   x - 42
   environment(f) - environment()
   f()
}

__
[EMAIL PROTECTED] 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] polr and optim question

2004-10-08 Thread Peter Flom
Hello again

I am trying to fit an ordinal logistic model using the polr function
from MASS.  When I run

model.loan.ordinal - polr(loancat~age + sex + racgp + yrseduc +
 needlchg + gallery  + sniffball + smokeball + sniffher +
 smokeher + nicocaine + inject + poly(year.of.int,3)  + druginj +
inj.years)


I get an error 

Error in optim(start, fmin, gmin, method = BFGS, hessian = Hess, ...)
: 
non-finite value supplied by optim


I checked in the MASS book, and in John Fox's book An R and S-Plus
Companion to Applied Regression,  I also checked in R-help, where a
similar problem was solved by using as.ordered, but that did not help
here.

Any help appreciated

Thanks



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

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


Re: [R] provide extra variables to environment in call

2004-10-08 Thread Thomas Lumley
On Fri, 8 Oct 2004, Khamenia, Valery wrote:
Hi all,
Situation:
there is a function `f' already defined by someone and
provided in package. `f' looks like that:
 f - function() {
   x+1
 }
i.e. `f' is not closed i.r.t. term `x'
now I have my own function `g', where I'd like
to override variable `x' while calling `f':
 x - dummy gloabal value
 g - function() {
   x - 42
   eval(f(), environment()) # how to make loacl `x' visible in `f'?
 }
 g() # = Error in x + 1 : non-numeric argument to binary operator
Here comes the question:
What is the right way to call `f' in order to override
global value of `x' with the local value defined within
of function `g' ?
This is messy because f() should not have been defined that way.
You can't do it without modifying (a copy of) f().
If the package has a namespace, so that you can't override the definition 
of f() it may be impossible.

If you can override the definition of f() you can do something like
  environment(f)-environment()
inside g().  On the other hand, you could then just replace the definition 
of f() with one that takes x as an argument.

-thomas
__
[EMAIL PROTECTED] 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] constrained opt with lagrange multiplier example?

2004-10-08 Thread Jeff D. Hamann
I'm curious to find out if there is an example of R code for optimization
of two variable function, with contraints, using lagrange multiplier
(using optim/nlm?). I have a problem that contains one discrete variable,
but need a simple problem/example to start with.

I haven't been able to find any examples and thought I should ask here
before I plunged into writing a few miles of R code.

Thanks,
Jeff.


-- 
Jeff D. Hamann
Forest Informatics, Inc.
PO Box 1421
Corvallis, Oregon 97339-1421
office 541-753-4218
fax 541-752-0288
home 541-754-1428
[EMAIL PROTECTED]
http://www.forestinformatics.com

__
[EMAIL PROTECTED] 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] polr and optim question

2004-10-08 Thread John Fox
Dear Peter,

It's hard to know from your message what the source of the problem might be,
but a good guess is that data are ill-conditioned in some way. Some things
to check: What's the distribution of the response variable? (Are there many
categories, some with very few observations?) How ill-conditioned is the
model matrix?

I hope this helps,
 John 
 

 -Original Message-
 From: [EMAIL PROTECTED] 
 [mailto:[EMAIL PROTECTED] On Behalf Of Peter Flom
 Sent: Friday, October 08, 2004 9:18 AM
 To: [EMAIL PROTECTED]
 Subject: [R] polr and optim question
 
 Hello again
 
 I am trying to fit an ordinal logistic model using the polr 
 function from MASS.  When I run
 
 model.loan.ordinal - polr(loancat~age + sex + racgp + 
 yrseduc +  needlchg + gallery  + sniffball + smokeball + 
 sniffher +  smokeher + nicocaine + inject + 
 poly(year.of.int,3)  + druginj +
 inj.years)
 
 
 I get an error 
 
 Error in optim(start, fmin, gmin, method = BFGS, hessian = 
 Hess, ...)
 : 
 non-finite value supplied by optim
 
 
 I checked in the MASS book, and in John Fox's book An R and 
 S-Plus Companion to Applied Regression,  I also checked in 
 R-help, where a similar problem was solved by using 
 as.ordered, but that did not help here.
 
 Any help appreciated
 
 Thanks
 
 
 
 Peter L. Flom, PhD
 Assistant Director, Statistics and Data Analysis Core Center 
 for Drug Use and HIV Research National Development and 
 Research Institutes
 71 W. 23rd St
 www.peterflom.com
 New York, NY 10010
 (212) 845-4485 (voice)
 (917) 438-0894 (fax)
 
 __
 [EMAIL PROTECTED] mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide! 
 http://www.R-project.org/posting-guide.html

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


[R] problem Installing R 2.0.0 on SuSe 9.1

2004-10-08 Thread Richards, Thomas
Hello:

I first tried it by using ./configure with the source files, but found that 
there is a huge problem with the gcc-g77 package, then I tried using the RPM obtained 
from CRAN, getting the following, the first of which appears to be another 
manifestation of the g77 problem:

linux:/tmp # rpm -i R-base-2.0.0-1.i586.rpm
warning: R-base-2.0.0-1.i586.rpm: V3 DSA signature: NOKEY, key ID a3278da3
error: Failed dependencies:
libg2c.so.0 is needed by R-base-2.0.0-1
libglade-gnome.so.0 is needed by R-base-2.0.0-1
libglade.so.0 is needed by R-base-2.0.0-1

Do you have a suggestion about what I (a suse beginner) should do in order to get R up 
and running under suse 9.1?  I have done some looking around and I do not see any 
package on suse for version 3.3.3 of the gcc-g77 package that corresponds to the 
gcc-g++ version 3.3.3, and I don't know if I am up to changing the versions of 
everything, so I hope I don't have to do that.  Thanks in advance.

__
[EMAIL PROTECTED] 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] Java and help.start() search engine

2004-10-08 Thread Prof Brian Ripley
The latest Sun Java release is jre-1_5_0, and unlike the recent versions
of j2re-1_4_2-0[2345], this one does work with Firefox 1.0PR, Mozilla
1.7.3 and Netscape 7.1 (and hopefully other Mozilla-based browsers).

From http://plugindoc.mozdev.org/faqs/java.html:

  Java Runtime Environment 5.0 has been released, and fixes many problems 
  users are having with Java. Go get it!. 

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

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


Re: [R] Chernoff faces

2004-10-08 Thread Wolfram Fischer
  Kenneth == Kenneth Cabrera [EMAIL PROTECTED] writes:
 
 Kenneth Hello everybody: Does any one has a function to build Chernoff
 Kenneth faces?
 
 Many of us don't think it's worth them.
 But we know that opinions differ and gladly incorporate
 (good quality) submissions of source code.
 
 R *is* an open source project and to some extent a community effort.
 Please don't hesitate to contribute and enter the hall of fame of R
 contributors :-)
 
 Martin 

An example code from H.P. Wolf (2003) can be found at:
http://www.wiwi.uni-bielefeld.de/~wolf/ : S/R - functions : faces

Wolfram

__
[EMAIL PROTECTED] 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] Number of characters per line

2004-10-08 Thread tofesi
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 7bit
Received-SPF: none (hypatia: domain of [EMAIL PROTECTED] does not designate permitted 
sender hosts)
X-Virus-Scanned: by amavisd-new at stat.math.ethz.ch
X-Spam-Checker-Version: SpamAssassin 2.63 (2004-01-11) on hypatia.math.ethz.ch
X-Spam-Level: *
X-Spam-Status: No, hits=1.9 required=5.0 tests=AWL,NO_REAL_NAME,RCVD_IN_BL_SPAMCOP_NET 
autolearn=no version=2.63

Hi all,

how can I tell R after how many characters it should do a line break in its output?
For example, instead of this output

[1] 0.692927557 0.016564402 0.053789695 0.457274207 0.320261162 0.343467947
[7] 0.289319881 0.820783841 0.737314682 0.305060765 0.009107208 0.271747209

I'd like to have that output:

[1] 0.692927557 0.016564402 0.053789695 0.457274207
[5] 0.320261162 0.343467947 0.289319881 0.820783841
[9] 0.737314682 0.305060765 0.009107208 0.271747209

Running R 1.9.1 (2004-06-21),
ESS 5.1.21 from within XEmacs 21.4.15 (April 2004),
Suse 9.1

I've tried to find out in FAQ and R-help archive, without success, so thanks a lot in 
advance for any help.
  Tobi

__
Mit WEB.DE FreePhone mit hoechster Qualitaet ab 0 Ct./Min.

__
[EMAIL PROTECTED] 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] creating named elements of lists on the fly

2004-10-08 Thread Ben Shapiro
HI Folks,

I'm trying to create a list with named elements. Only, I don't know the names of the 
elements a priori (they come from the data being calculated). Currently, my approach 
is to create an environment, then assign things to the environement, then as.list the 
environment to get a list. 

Running the code gives, for example:
 e2 - new.env(FALSE, NULL)
 assign(dude, 123, env=e2)
 assign(chick, 456, env=e2)
 as.list(e2)
Error in as.vector(x, list) : cannot coerce to vector

Is this the best way to make a list like this? 

Thanks,
Ben

__
[EMAIL PROTECTED] 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] Number of characters per line

2004-10-08 Thread John Fox
Dear Tobi,

You can use options(width=n.of.characters).

I hope this helps,
 John

 -Original Message-
 From: [EMAIL PROTECTED] 
 [mailto:[EMAIL PROTECTED] On Behalf Of [EMAIL PROTECTED]
 Sent: Friday, October 08, 2004 11:36 AM
 To: [EMAIL PROTECTED]
 Subject: [R] Number of characters per line
 
 Content-Type: text/plain; charset=iso-8859-1
 Content-Transfer-Encoding: 7bit
 Received-SPF: none (hypatia: domain of [EMAIL PROTECTED] does not 
 designate permitted sender hosts)
 X-Virus-Scanned: by amavisd-new at stat.math.ethz.ch
 X-Spam-Checker-Version: SpamAssassin 2.63 (2004-01-11) on 
 hypatia.math.ethz.ch
 X-Spam-Level: *
 X-Spam-Status: No, hits=1.9 required=5.0 
 tests=AWL,NO_REAL_NAME,RCVD_IN_BL_SPAMCOP_NET autolearn=no 
 version=2.63
 
 Hi all,
 
 how can I tell R after how many characters it should do a 
 line break in its output?
 For example, instead of this output
 
 [1] 0.692927557 0.016564402 0.053789695 0.457274207 
 0.320261162 0.343467947 [7] 0.289319881 0.820783841 
 0.737314682 0.305060765 0.009107208 0.271747209
 
 I'd like to have that output:
 
 [1] 0.692927557 0.016564402 0.053789695 0.457274207 [5] 
 0.320261162 0.343467947 0.289319881 0.820783841 [9] 
 0.737314682 0.305060765 0.009107208 0.271747209
 
 Running R 1.9.1 (2004-06-21),
 ESS 5.1.21 from within XEmacs 21.4.15 (April 2004), Suse 9.1
 
 I've tried to find out in FAQ and R-help archive, without 
 success, so thanks a lot in advance for any help.
   Tobi
 
 __
 Mit WEB.DE FreePhone mit hoechster Qualitaet ab 0 Ct./Min.
 
 __
 [EMAIL PROTECTED] mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide! 
 http://www.R-project.org/posting-guide.html

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


RE: [R] creating named elements of lists on the fly

2004-10-08 Thread John Fox
Dear Ben,

Is this the kind of thing you had in mind?

 lst - list()
 element - a
 lst[[element]] - 1:5
 element - b
 lst[[element]] - letters[1:5]
 lst
$a
[1] 1 2 3 4 5

$b
[1] a b c d e


I hope this helps,
 John 

 -Original Message-
 From: [EMAIL PROTECTED] 
 [mailto:[EMAIL PROTECTED] On Behalf Of Ben Shapiro
 Sent: Friday, October 08, 2004 11:46 AM
 To: [EMAIL PROTECTED]
 Subject: [R] creating named elements of lists on the fly 
 
 HI Folks,
 
 I'm trying to create a list with named elements. Only, I 
 don't know the names of the elements a priori (they come from 
 the data being calculated). Currently, my approach is to 
 create an environment, then assign things to the 
 environement, then as.list the environment to get a list. 
 
 Running the code gives, for example:
  e2 - new.env(FALSE, NULL)
  assign(dude, 123, env=e2)
  assign(chick, 456, env=e2)
  as.list(e2)
 Error in as.vector(x, list) : cannot coerce to vector
 
 Is this the best way to make a list like this? 
 
 Thanks,
 Ben

__
[EMAIL PROTECTED] 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] Number of characters per line

2004-10-08 Thread Gavin Simpson
[EMAIL PROTECTED] wrote:
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 7bit
Received-SPF: none (hypatia: domain of [EMAIL PROTECTED] does not designate permitted 
sender hosts)
X-Virus-Scanned: by amavisd-new at stat.math.ethz.ch
X-Spam-Checker-Version: SpamAssassin 2.63 (2004-01-11) on hypatia.math.ethz.ch
X-Spam-Level: *
X-Spam-Status: No, hits=1.9 required=5.0 tests=AWL,NO_REAL_NAME,RCVD_IN_BL_SPAMCOP_NET 
autolearn=no version=2.63
Hi all,
how can I tell R after how many characters it should do a line break in its output?
For example, instead of this output
[1] 0.692927557 0.016564402 0.053789695 0.457274207 0.320261162 0.343467947
[7] 0.289319881 0.820783841 0.737314682 0.305060765 0.009107208 0.271747209
I'd like to have that output:
[1] 0.692927557 0.016564402 0.053789695 0.457274207
[5] 0.320261162 0.343467947 0.289319881 0.820783841
[9] 0.737314682 0.305060765 0.009107208 0.271747209
?options
which states...
 'width': controls the number of characters on a line. You may want
  to change this if you re-size the window that R is running
  in.  Valid values are 10...1 with default normally 80.
  (The valid values are in file 'Print.h' and can be changed by
  re-compiling R.)
Gav
--
%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%
Gavin Simpson [T] +44 (0)20 7679 5522
ENSIS Research Fellow [F] +44 (0)20 7679 7565
ENSIS Ltd.  ECRC [E] [EMAIL PROTECTED]
UCL Department of Geography   [W] http://www.ucl.ac.uk/~ucfagls/cv/
26 Bedford Way[W] http://www.ucl.ac.uk/~ucfagls/
London.  WC1H 0AP.
%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%
__
[EMAIL PROTECTED] 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] creating named elements of lists on the fly

2004-10-08 Thread Sundar Dorai-Raj

Ben Shapiro wrote:
HI Folks,
I'm trying to create a list with named elements. Only, I don't know the names of the elements a priori (they come from the data being calculated). Currently, my approach is to create an environment, then assign things to the environement, then as.list the environment to get a list. 

Running the code gives, for example:
e2 - new.env(FALSE, NULL)
assign(dude, 123, env=e2)
assign(chick, 456, env=e2)
as.list(e2)
Error in as.vector(x, list) : cannot coerce to vector
Is this the best way to make a list like this? 

Thanks,
Ben
You can use the [[ operator for list objects:
nm - c(dude, chick)
e2[[nm[1]]] - 123
e2[[nm[2]]] - 456
HTH,
--sundar
__
[EMAIL PROTECTED] 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] creating named elements of lists on the fly

2004-10-08 Thread Gabor Grothendieck
Ben Shapiro bshapiro-lists-R at getdown.org writes:

: 
: HI Folks,
: 
: I'm trying to create a list with named elements. Only, I don't know the 
names of the elements a priori (they
: come from the data being calculated). Currently, my approach is to create an 
environment, then assign
: things to the environement, then as.list the environment to get a list. 
: 
: Running the code gives, for example:
:  e2 - new.env(FALSE, NULL)
:  assign(dude, 123, env=e2)
:  assign(chick, 456, env=e2)
:  as.list(e2)
: Error in as.vector(x, list) : cannot coerce to vector
: 
: Is this the best way to make a list like this? 
: 
: Thanks,
: Ben


If you need to add them one at a time then John Fox has
already provided an answer.  If you want to create it
all at once and you have the contents in a list and
the names in a vector like this:

nams - letters[1:3]
contents - list(1:3, 4:5, 6:9)

# then here are two ways:

# 1
mapply({, nams, contents, SIMPLIFY = FALSE)

# 2
names(contents) -  nams
contents

#  Actually in your example the elements are all homogeneous so
#  you could alternately use a vector to hold the results:

# 1a
contents - c(1, 2, 3)
mapply({, nams, contents)

# 2a
names(contents) - nams
contents

__
[EMAIL PROTECTED] 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] nlme vs gls

2004-10-08 Thread Doran, Harold
Dear List:

My question is more statistical than R oriented (although it originates
from my work with nlme). I know statistical questions are occasionally
posted, so I hope my question is relevant to the list as I cannot turn
up a solution anywhere else. I will frame it in the context of an R
related issue.

To illustrate the problem, consider student achievement test score data
with multiple observations available for each student. One way of
modeling these data might be

Y_{ti} = (\mu + \mu_{i} ) + (\beta_0 + \beta_{i} )*(time) +
\epsilon_{ti} ; t indexes time and i indexes student

The nlme code is 

tt-lme(reponse~time, data, random=~time|ID)

With this, I can extract the growth rate for each individual in the data
set. Conceptually this is the sum of the main effect for time plus the
empirical bayes estimate for each individual:

\beta_0 + \beta_{i}

I can use the coef(tt, ...) to extract these coefficients. 

Now, assume that I do not want to include random effects associated with
the slope and intercept, but instead use a gls to account for the
variances and covariances through an unstructured covariance matrix.

For example, assume the following model fit to the same data

Y_{ti} = \mu  + \beta_0 * (time) + \epsilon_{ti}; where e~N(0, \Sigma) 

With Sigma forming a more complex covariance matrix. We can use the gls
option as follows for example, 

tt1-gls(response~time, data, correlation=corSymm(form=~1|ID),
weights=varIdent(form=~1|time))

On p. 254 of PB, they note that the mixed model gives as a by-product,
estimates for the random effects, which may be of interest in
themselves. And in my situation they are. Specifically, I want to
estimate the growth rate for each individual student.

My questions boils down to:

1) Is there any way possible to extract or to compute (estimate) the
growth rate of individual i when the data have been modeled using gls? 

2) Can anyone point me to an example or reference where this has been
done? I have searched but have really turned up empty handed.

It seems that there must be a methodology for doing so as we are
accomplishing a similar task. Would there be information in the new
covariance matrix, Sigma, that would help play this role?

These only illustrate the issue, the actual model I am dealing with is
more complex, but the issue generalizes. Fitting random effects in the
current model I am dealing with is not a particularly attractive
solution.  I actually have the issue layed out in more detail in a paper
I am working on and would be happy to share if requested.

I would appreciate any thoughts you might have on this problem.

Harold



 

[[alternative HTML version deleted]]

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


[R] reading Systat into R

2004-10-08 Thread Jacob Wegelin

How do I read a Systat file into R?  The  following email by Marc Schwartz
http://tolstoy.newcastle.edu.au/R/help/04/06/1005.html deals with reading Systat on
a Linux machine.  I'm running R on Windows (precise version info below).  A colleague
sent me data in systat, a *.SYD file.  Do I have to ask the colleague to re-save the
data as Excel or text?

(I tried opening it in SPSS, and SPSS also does not seem to recognize an SYD file.)

Thanks for any info.

Jake Wegelin

 version
 _
platform i386-pc-mingw32
arch i386
os   mingw32
system   i386, mingw32
status
major1
minor9.1
year 2004
month06
day  21
language R

__
[EMAIL PROTECTED] 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] reading Systat into R

2004-10-08 Thread Jonathan Baron
On 10/08/04 12:02, Jacob Wegelin wrote:

How do I read a Systat file into R?  The  following email by Marc Schwartz
http://tolstoy.newcastle.edu.au/R/help/04/06/1005.html deals with reading Systat on
a Linux machine.  I'm running R on Windows (precise version info below).  A colleague
sent me data in systat, a *.SYD file.  Do I have to ask the colleague to re-save the
data as Excel or text?

Unfortunately, yes, to my knowledge.  Text, of course, could be
SYC, or one of the various outputs that Systat produces.

Because I used to use Systat, and many of my colleagues still do,
I spent some time investigating this problem.  Here are some
excerpts from correspondence.  Because one was just to me and
not the list, I'm removing the From.  I have the code, but I
could not get it to work.  I put it aside.  I think it needs
someone who is more familiar with c than I am (which doesn't take
much).

Jon
---

Contact [EMAIL PROTECTED] because his dataload program will
import from SYSTAT and output to an .rda file.  But I fear that dataload
is no longer available to new users, only those grandfathered in before
a license issue came up.  -Frank

 Thanks.  DataLoad does have a free version, but the whole thing
 is Windows only.  (Just search for dataload on Google.)  If I had
 Windows, I'd have Systat.

No, David gave me the ready-to-run linux executable.  Never used it on 
windows.

--

I've put three header files and two pre-ANSI C files in a tarball. I note
that sys_errlist causes an error under compilation now, but for code last
looked at 12 years ago, that's not bad. The reading code was written by me
alone based on reverse engineering, but when I had a question - as you'll
see from the code - someone I think called P. Fleury from Systat sent me
some C that they'd been trying out, which I saw after writing my own. I
think mine was more thorough. 

The endian-ness was because I needed to read and write on non-Intel
machines (you may need the functions I used then - please ask if so, or
substitute more modern ones if required). Please treat this as GPL - I
think there was not difficulty with Systat at the time, and they knew that
I had this on my ftp server then (a 1992 paper in Computers and
Geosciences).  I still have *.sys files that I could try it on if it works
- please let me know if there are unresolved calls (walert() wrote an
error message, for example).

Best wishes,

Roger [Bivand]

From [EMAIL PROTECTED]  Wed Jun 16 11:33:01 2004

The commercial package dbmscopy has a Linux version. 
I have used dbmscopy for several years and have been happy 
with it as it converts data files among many spreadsheets and 
statistics programs.

http://www.conceptual.com/dbmscopt.htm

However, somewhat recently they were purchased by SAS, so 
I'm not sure of current state of the program. There are 
probably other commercial packages as well.

Anne

Hi Jon and Anne!

One other commercial product to check out is Stat/Transfer.  More
information on supported formats is at:
http://www.stattransfer.com/html/formats.html

They do support Windows, MacOS and Unix/Linux. Demo downloads are
available from: http://www.stattransfer.com/html/download.html

Unix/Linux pricing is available at:
http://www.stattransfer.com/html/prices_-_unix.html.

HTH,

Marc Schwartz


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

__
[EMAIL PROTECTED] 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-(wiki)-pedia?

2004-10-08 Thread David Forrest
On Fri, 8 Oct 2004, Barry Rowlingson wrote:

 Here's a function for searching the Rwiki from R:

 rwiki.search - function(string){

RwikiURL=http://fawn.unibw-hamburg.de/cgi-bin/Rwiki.pl;
RwikiSearchURL=paste(RwikiURL(),?search=,string,sep='')
browseURL(RwikiSearchURL)

return(invisible(0))
 }


Hmm, that's nice.


 Then you can do rwiki.search(gabor) and the results pop up in your
 browser.

 Perhaps we need some more documentation-getting functions in R, such as
 this, something to search the mailing list archives, and maybe a
 readPostingGuide() function...

 Or is this spoonfeeding too much, and people should be able to go to a
 web page and stick something in the search box?

Some people need spoonfeeding, and sometimes its nice to be able to do
things more than one way.


rwiki.search('SearchFunctions')

help.search.archive-function(string){
   RURL=http://www.google.com/u/newcastlemaths;
   RSearchURL=paste(RURL,?q=,string,sep='')
   browseURL(RSearchURL)
   return(invisible(0))
 }

help.search.archive('wiki')

Dave
-- 
 Dave Forrest
 [EMAIL PROTECTED](804)684-7900w
 [EMAIL PROTECTED] (804)642-0662h
   http://maplepark.com/~drf5n/

__
[EMAIL PROTECTED] 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] reading Systat into R

2004-10-08 Thread Jacob Wegelin

Thanks to Jonathan and Marc for your swift replies.  Here is how I solved
the problem:

I downloaded a 30 day trial version of systat from
http://www.clecom.co.uk/science/systat/systat_download.html, installed it
on my PC, opened the file in Systat, then used File, Save As and saved it
in every imaginable format: Excel, ascii, SPSS, and SAS.

The SPSS *.SAV file, when I opened it, proved not to have any data in it.
It only contained the variable view not the data view.  But the Excel
file appears to contain the data.

Jake Wegelin

On Fri, 8 Oct 2004, Marc Schwartz wrote:

 On Fri, 2004-10-08 at 14:02, Jacob Wegelin wrote:
  How do I read a Systat file into R?  The  following email by Marc Schwartz
  http://tolstoy.newcastle.edu.au/R/help/04/06/1005.html deals with reading Systat on
  a Linux machine.  I'm running R on Windows (precise version info below).  A 
  colleague
  sent me data in systat, a *.SYD file.  Do I have to ask the colleague to re-save 
  the
  data as Excel or text?
 
  (I tried opening it in SPSS, and SPSS also does not seem to recognize an SYD file.)
 
  Thanks for any info.
 
  Jake Wegelin

 Jacob,

 Stat/Transfer does support reading SYSTAT files on Windows. The W
 logos on the formats page
 (http://www.stattransfer.com/html/formats.html) indicate that those
 other particular formats are available on Windows only. SYSTAT file
 support is available on each supported OS.

 There are inexpensive academic/student prices available for
 Stat/Transfer if this is something that makes sense to invest in. If
 this is going to be a one-time issue, I would have your colleague
 re-save the data file to an ASCII CSV file, if possible.

 HTH,

 Marc





__
[EMAIL PROTECTED] 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] reading Systat into R

2004-10-08 Thread Robert W. Baer, Ph.D.
 The SPSS *.SAV file, when I opened it, proved not to have any data in it.
 It only contained the variable view not the data view.  But the Excel
 file appears to contain the data.


My experience with getting spss files suggests that you might actually be
seeing the file as a list.  Look at help for
?read.spss.  The most usable format to get a data frame is:

dframe=read.spss(MyData.sav,to.data.frame=T)

See if this doesn't do what you expect.

__
[EMAIL PROTECTED] 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] nlme vs gls

2004-10-08 Thread Raubertas, Richard
One thing to be aware of (as Pinheiro and Bates point out on
the same page) is that the general random effects and gls
models are not nested.  This means that the general covariance
matrix you estimate with gls may not correspond to *any* 
random effects model.  In that case there are no subject-
specific coefficients (e.g. slopes), in the random effects sense.

Rich Raubertas

 -Original Message-
 From: [EMAIL PROTECTED] 
 [mailto:[EMAIL PROTECTED] On Behalf Of Doran, Harold
 Sent: Friday, October 08, 2004 1:27 PM
 To: [EMAIL PROTECTED]
 Subject: [R] nlme vs gls
 
 
 Dear List:
 
 My question is more statistical than R oriented (although it 
 originates
 from my work with nlme). I know statistical questions are occasionally
 posted, so I hope my question is relevant to the list as I cannot turn
 up a solution anywhere else. I will frame it in the context of an R
 related issue.
 
 To illustrate the problem, consider student achievement test 
 score data
 with multiple observations available for each student. One way of
 modeling these data might be
 
 Y_{ti} = (\mu + \mu_{i} ) + (\beta_0 + \beta_{i} )*(time) +
 \epsilon_{ti} ; t indexes time and i indexes student
 
 The nlme code is 
 
 tt-lme(reponse~time, data, random=~time|ID)
 
 With this, I can extract the growth rate for each individual 
 in the data
 set. Conceptually this is the sum of the main effect for time plus the
 empirical bayes estimate for each individual:
 
 \beta_0 + \beta_{i}
 
 I can use the coef(tt, ...) to extract these coefficients. 
 
 Now, assume that I do not want to include random effects 
 associated with
 the slope and intercept, but instead use a gls to account for the
 variances and covariances through an unstructured covariance matrix.
 
 For example, assume the following model fit to the same data
 
 Y_{ti} = \mu  + \beta_0 * (time) + \epsilon_{ti}; where 
 e~N(0, \Sigma) 
 
 With Sigma forming a more complex covariance matrix. We can 
 use the gls
 option as follows for example, 
 
 tt1-gls(response~time, data, correlation=corSymm(form=~1|ID),
 weights=varIdent(form=~1|time))
 
 On p. 254 of PB, they note that the mixed model gives as a 
 by-product,
 estimates for the random effects, which may be of interest in
 themselves. And in my situation they are. Specifically, I want to
 estimate the growth rate for each individual student.
 
 My questions boils down to:
 
 1) Is there any way possible to extract or to compute (estimate) the
 growth rate of individual i when the data have been modeled 
 using gls? 
 
 2) Can anyone point me to an example or reference where this has been
 done? I have searched but have really turned up empty handed.
 
 It seems that there must be a methodology for doing so as we are
 accomplishing a similar task. Would there be information in the new
 covariance matrix, Sigma, that would help play this role?
 
 These only illustrate the issue, the actual model I am dealing with is
 more complex, but the issue generalizes. Fitting random effects in the
 current model I am dealing with is not a particularly attractive
 solution.  I actually have the issue layed out in more detail 
 in a paper
 I am working on and would be happy to share if requested.
 
 I would appreciate any thoughts you might have on this problem.
 
 Harold
 
 
 
  
 
   [[alternative HTML version deleted]]
 
 __
 [EMAIL PROTECTED] mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide! 
 http://www.R-project.org/posting-guide.html
 


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


[R] Survey of moving window statistical functions - still looking f or fast mad function

2004-10-08 Thread Tuszynski, Jaroslaw W.
Hi,

Lately I run into a problem that my code R code is spending hours performing
simple moving window statistical operations.  As a result I did searched
archives for alternative (faster) ways of performing: mean, max, median and
mad operation over moving window (size 81)  on a vector with about 30K
points. And performed some timing for several ways that were suggested, and
few ways I come up with. The purpose of this email is to share some of my
findings and ask for more suggestions (especially about moving mad
function).

Sum over moving window can be done using many different ways. Here are some
sorted from the fastest to the slowest:
1.  runmean = function(x, k) { 
  n= length(x) 
  y= x[ k:n ] - x[ c(1,1:(n-k)) ] # this is a difference
from the previous cell
  y[1] = sum(x[1:k]); # find the first sum
  y= cumsum(y)# apply precomputed
differences
  return(y/k) # return mean not sum
}
2.  filter(x, rep(1/k,k), sides=2, circular=T) - (stats package)
3.  kernapply(x, kernel(daniell, m), circular=T) 
4.  apply(embed(x,k), 1, mean)  
5.  mywinfun - function(x, k, FUN=mean, ...) 
{ # suggested in news group
   n - length(x) 
   A - rep(x, length=k*(n+1)) 
   dim(A) - c(n+1, k) 
   sapply(split(A, row(A)), FUN, ...)[1:(n-k+1)] 
}
6.  rollFun(x, k, FUN=mean) - (fSeries package)
7.  rollMean(x, k)  - (fSeries package)
8.  SimpleMeanLoop = function(x, k) {
   n = length(x) # simple-minded loop used as a
baseline
   y = rep(0, n) 
   k = k%/%2;
   for (i in (1+k):(n-k)) y[i] = mean(x[(i-k):(i+k)]) 
   }
9.  running(x, fun=mean, width=k) - (gtools package)

Some of above functions return results that are the same length as x and
some return arrays with length n-k+1. The relative speeds (on Windows
machine) were as follow: 0.01, 0.09, 1.2, 8.1, 11.2, 13.4, 27.3, 63, 345. As
one can see there are about 5 orders of magnitude between the fastest and
the slowest. 


Maximum over moving window can be done as follow, in order of speed
1.  runmax = function(x, k) { 
  n = length(x) 
  y = rep(0, n) 
  m = k%/%2;
  a = 0;
  for (i in (1+m):(n-m)) {
if (a==y[i-1]) y[i] = max(x[(i-m):(i+m)])  # calculate
max of the window
else   y[i] = max(y[i-1], x[i+m]); # max of the
window is =y[i-1] 
a = x[i-m]  # point that will be removed from the window
  }
  return(y)
} 
2.  apply(embed(x,k), 1, max)  
3.  SimpleMaxLoop(x, k) - similar to SimpleMeanLoop above
4.  mywinfun(x, k, FUN=max) - see above
5.  rollFun(x, k, FUN=max) - fSeries package
6.  rollMax(x, k)  - fSeries package
7.  running(x, fun=max, width=k) - gtools package
The relative speeds were: 0.01, 3, 3.4, 5.3, 7.5, 7.7, 15.3

Median over moving window can be done as follows:
1.  runmed(x, k) - from stats package
2.  SimpleMedLoop(x, k) - similar to SimpleMeanLoop above
3.  apply(embed(x,k), 1, median)  
4.  mywinfun(x, k, FUN=median) - see above
5.  rollFun (x, k, FUN=median) - fSeries package
6.  running(x, fun=max, width=k) - gtools package
Speeds: 0.01, 3.4, 9, 15, 29, 165

Mad over moving window can be done as follows:
1.  runmad = function(x, k) 
{ 
   n = length(x) 
   A = embed(x,k)
   A = abs(A - rep(apply(A, 1, median), k))
   dim(A) = c(n-k+1, k) 
   apply(A, 1, median)
} 
2.  apply(embed(x,k), 1, mad)  
3.  mywinfun(x, k, FUN=mad) - see above
4.  SimpleMadLoop(x, k) - similar to SimpleMeanLoop above
5.  rollFun(x, k, FUN=mad) - fSeries package
6.  running(x, fun=mad, width=k) - gtools package
Speeds: 11, 18, 25, 50, 50, 400

Some thoughts about those results:
*   All functions from Stats package (runmed, filter, kernapply)
are fast and hard to improve on.
*   In case of Mean and Max a simple un-optimized R codes are
much faster than specialized functions build for the same purpose.
*   apply(embed(x,k), 1, fun) - seem to be always faster than
any functions from fSeries package or mywinfun 
*   running function from gtools package is horribly slow
compared to anything else
*   mywinfun proposed as a faster version of
apply(embed(x,k), 1, fun) seems 

Re: [R] RWinEdt

2004-10-08 Thread Emili Tortosa-Ausina
Hi,
All do also have troubles. In my case, I get the following message:
 install.packages(choose.files('',filters=Filters[c('zip','All'),]), 
.libPaths()[1], CRAN = NULL)
package 'RWinEdt' successfully unpacked and MD5 sums checked
updating HTML package descriptions
 local({pkg - select.list(sort(.packages(all.available = TRUE)))
+ if(nchar(pkg)) library(pkg, character.only=TRUE)})
Error in firstlib(which.lib.loc, package) :
couldn't find function lazyLoad
In addition: Warning message:
package RWinEdt was built under R version 2.0.0
Error in library(pkg, character.only = TRUE) :
.First.lib failed


Any help would be appreciated!!!
Emili
At 05:14 AM 10/8/2004, [EMAIL PROTECTED] wrote:
Hi,
I have troubles getting RWinEdt with the R2.0.0 Version startet.
Do I have to install a different version of RWinEdt or WinEdt?
I have RWinEdt 1.6.1 and WinEdt 5.3.
Thanks
Anna Hennig
__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] Adding factor variable to a CoxPH

2004-10-08 Thread Neil Leonard
I think this is a pretty basic statistic question:
If I have a variable which has 4 factors how can I add it to a coxph 
model? I have other variables added which have digits 1-4 instead of 
four factors. If I recode the variable will that work?

Thanks
Neil
__
[EMAIL PROTECTED] 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] polr problem solved

2004-10-08 Thread Peter Flom
I'd like to thank John Fox and Chuck Cleland for their help in resovling
this issue.  It turned out to be something simple, but perhaps others
have had similar problems

In my original data frame, I had 4 categories of race/ethnicity.  One of
the categories (other) was very small, and not similar to any of the
other three categories, so I created a new data frame deleting those
people.

However, the level other was still there, with no one in it.
This didn't cause a problem for glm or lm, but it did for polr.  When I
eliminated that level, the problem disappeared.

Thanks again for the help

Peter

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

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


Re: [R] RWinEdt

2004-10-08 Thread Emili Tortosa-Ausina
OK, now it's fine.
Thanks,
Emili
At 05:50 PM 10/8/2004, Emili Tortosa-Ausina wrote:
Hi,
All do also have troubles. In my case, I get the following message:
 install.packages(choose.files('',filters=Filters[c('zip','All'),]), 
.libPaths()[1], CRAN = NULL)
package 'RWinEdt' successfully unpacked and MD5 sums checked
updating HTML package descriptions
 local({pkg - select.list(sort(.packages(all.available = TRUE)))
+ if(nchar(pkg)) library(pkg, character.only=TRUE)})
Error in firstlib(which.lib.loc, package) :
couldn't find function lazyLoad
In addition: Warning message:
package RWinEdt was built under R version 2.0.0
Error in library(pkg, character.only = TRUE) :
.First.lib failed


Any help would be appreciated!!!
Emili
At 05:14 AM 10/8/2004, [EMAIL PROTECTED] wrote:
Hi,
I have troubles getting RWinEdt with the R2.0.0 Version startet.
Do I have to install a different version of RWinEdt or WinEdt?
I have RWinEdt 1.6.1 and WinEdt 5.3.
Thanks
Anna Hennig
__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html