[R] Icon proposal

2007-02-08 Thread Frederik Elwert
Hello!

In my eyes, the R logo looks somewhat old-fashioned and I don't like
that 3D-ish style. Therefor, I played a bit around with Inkscape and
made an R logo according to the Tango Icon Theme Guidelines
http://tango.freedesktop.org/Tango_Icon_Theme_Guidelines. It is in SVG
format, and therefor scalable, but optimized for 48x48 and larger.
Smaller sizes might need some retouching to stay sharp.

Not everybody might feel about the R logo as I do, so this is in no way
an attempt to replace the current logo. But maybe somebody likes the
look of my new logo and wants to use it as an icon or something.

The SVG file:
http://www-user.uni-bremen.de/~felwert/R/R.svg

The logo in about the size of the R's website's logo:
http://www-user.uni-bremen.de/~felwert/R/Rlogo-neu.png

The logo as 48x48 icon:
http://www-user.uni-bremen.de/~felwert/R/scientific-r-48.png

The files themselves are Public Domain, the logo is property of the R
Foundation, I assume - but I couldn't find anything specific on the web
site, so I welcome information on that topic.

I'd like to hear what you think about the logo and if it is of any use
for you.

Regards,
Frederik

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] the plotting position of theoretical quantile for qqnorm

2007-02-08 Thread fengfeng
Hello,

I have a doubt about the plotting position of the theoretical quantile for
the qqnorm
command in R.

Let F be the theoretical distribution of Y, we observed a sample of size n,
y1,y2, ...,
yn. We then sort it and comspare these empirical quantiles to the expected
ones
from F. For the plotting poition, there are several options:

1. i/(n+1)
2. (i-.375)/(n+.25)
3. (i- .3175)/ (n + .365)
etc.

Which one is qqnorm used?

Thx a lot!

Liz

[[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
and provide commented, minimal, self-contained, reproducible code.


[R] circle fill problem

2007-02-08 Thread MINI GHOSH
Dear R user,

I want to know is there a way to find the minimum
number of circles (of given radius) required to fill a
given area (say rectangular) where overlapping of
circles is allowed.

Thanks,
Regards,
Mini Ghosh

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Attachments to R-help postings (Re: Singular Gradient)

2007-02-08 Thread Martin Maechler
 DB == Douglas Bates [EMAIL PROTECTED]
 on Wed, 7 Feb 2007 17:24:40 -0600 writes:

DB On 2/7/07, This Wiederkehr [EMAIL PROTECTED] wrote:
 I tried to fit data with the following function:
 
 fit-nls(y~ Is*(1-exp(-l*x))+Iph,start=list(Is=-2e-5,l=2.3,Iph=-0.3
 ),control=list(maxiter=500,minFactor=1/1,tol=10e-05),trace=TRUE)
 But I get only a singular Gradient warning...

DB Did you get any trace output at all?  It is not clear if you got the
DB singular gradient warning before the first iteration completed, which
DB means there is a problem at the starting estimates, or after a few
DB iterations.  Without the data it is difficult to decide.

 the data can by found attached(there are two sampels of data col 1/2 and
 3/4).

DB Thanks for offering to include the data.  My copy of your message did
DB not have the data enclosed.  Did you perhaps forget to attach the
DB file?

More probably he did not attach them with mime type text/plain.
Many e-mail clients nowadays attach everything and notably text
as unspecified binary (application/octet-stream).
For security (and anti-spam) reasons, such attachments are
eliminated from postings.

I've now slightly modified this content-filtering option for
R-help, such that (I think) such e-mails will be *rejected* instead 
of just the attachment removed -- I'm just trying that now,
attaching a 2 line text file


Martin





 I tried to fix it by chanching the start parameters but that didn't solve
 the problem.

 Would it be a possibiliti to use the selfstart Model? How?

DB Yes.  Try SSasymp.  I believe that model is equivalent to your model
DB but in a different parameterization.

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] path for source()

2007-02-08 Thread Vladimir Eremeev

Here is the discussion about the function search.path()
http://finzi.psych.upenn.edu/R/Rhelp02a/archive/34411.html
which searches the PATH variable for your script and returns the full path.

You also can put your script contents in functions, then create a package
and load it with library(). 
package.skeleton() can help you.

Anyway, source()'ing every time does not seem to be a good idea, because
every time you do this you obtain one more copy of your functions and
variables in the newly created workspace.
If you don't want to create a package, you can save your functions in a file
with the .Rdata extension and attach that file.

Try going here
https://www.stat.math.ethz.ch/pipermail/r-help/2004-July/thread.html and
searching source() in the page (i.e. in message headers). I believe,
discussions could provide you with several more good ideas.


colliera wrote:
 
 i have a couple of .R files distributed about my file system. i commonly
 source() these from other files, but i have to include the full file path.
 this is not always convenient if you move files around. is there a way of
 setting the search path for source()?
 

-- 
View this message in context: 
http://www.nabble.com/-R--path-for-source%28%29-tf3191709.html#a8861457
Sent from the R help mailing list archive at Nabble.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
and provide commented, minimal, self-contained, reproducible code.


Re: [R] path for source()

2007-02-08 Thread Wolfgang Raffelsberger
Hi,
an easy way to address this is to change directory within R before 
calling source() :
setwd(D:/Projects/yourProject)
source(yourCode.R)

Of course you need to know where your .R files are.
Using getwd() you can always check where you are and using dir() you can 
check the files in your directory (which you could combine with grep() 
to search for .R) ..

Wolfgang

[EMAIL PROTECTED] a écrit :
 hello,

 i have a couple of .R files distributed about my file system. i commonly 
 source() these from other files, but i have to include the full file path. 
 this is not always convenient if you move files around. is there a way of 
 setting the search path for source()?

 thanks a lot!

 cheers,
 andrew.

   


-- 

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 
. . . . .

Wolfgang Raffelsberger, PhD
Laboratoire de BioInformatique et Génomique Intégrative
IGBMC
1 rue Laurent Fries,  67404 Illkirch  Strasbourg,  France
Tel (+33) 388 65 3300 Fax (+33) 388 65 3276
[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
and provide commented, minimal, self-contained, reproducible code.


Re: [R] circle fill problem

2007-02-08 Thread Robin Hankin
Mini

This is a hard problem in general.

Recreational mathematics has wrestled with
this and similar problems over the years; the
general field is the set cover problem but
in your case the sets are uncountably infinite
(and there are uncountably many of them).

I would be surprised if your problem were not NP complete.


HTH


Robin


On 8 Feb 2007, at 05:15, MINI GHOSH wrote:

 Dear R user,

 I want to know is there a way to find the minimum
 number of circles (of given radius) required to fill a
 given area (say rectangular) where overlapping of
 circles is allowed.

 Thanks,
 Regards,
 Mini Ghosh

 __
 R-help@stat.math.ethz.ch mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide http://www.R-project.org/posting- 
 guide.html
 and provide commented, minimal, self-contained, reproducible code.

--
Robin Hankin
Uncertainty Analyst
National Oceanography Centre, Southampton
European Way, Southampton SO14 3ZH, UK
  tel  023-8059-7743

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] the plotting position of theoretical quantile for qqnorm

2007-02-08 Thread Martin Maechler
 LizF == fengfeng  [EMAIL PROTECTED]
 on Wed, 7 Feb 2007 23:08:31 -0600 writes:

LizF Hello,
LizF I have a doubt about the plotting position of the theoretical 
quantile for
LizF the qqnorm
LizF command in R.

LizF Let F be the theoretical distribution of Y, we observed a sample of 
size n,
LizF y1,y2, ...,
LizF yn. We then sort it and comspare these empirical quantiles to the 
expected
LizF ones
LizF from F. For the plotting poition, there are several options:

LizF 1. i/(n+1)
LizF 2. (i-.375)/(n+.25)
LizF 3. (i- .3175)/ (n + .365)
LizF etc.

yes, particularly etc  ;-)

LizF Which one is qqnorm used?

It's right in front of you if you read  help(qqnorm)  carefully :

   See Also:
   
  'ppoints', used by 'qqnorm' to generate approximations to expected
  order statistics for a normal distribution.
   

So it uses ppoints()  and  help(ppoints) tells you what's going
on: The formula used depends on (n = 10) but see that help page.

LizF Thx a lot!

You're welcome,
Martin Maechler, ETH Zurich

LizF Liz

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] circle fill problem

2007-02-08 Thread Ingmar Visser
Robin  Mini,
For those interested, googling for the 'orange packing problem' as it  
is known, or more officially the sphere packing problems gives you  
quite a few hits on these and similar problems.
So at least the 3-d case the problem has been solved (I imagine the  
problem is easier in 2-d ...)
hth, Ingmar

On 8 Feb 2007, at 09:52, Robin Hankin wrote:

 Mini

 This is a hard problem in general.

 Recreational mathematics has wrestled with
 this and similar problems over the years; the
 general field is the set cover problem but
 in your case the sets are uncountably infinite
 (and there are uncountably many of them).

 I would be surprised if your problem were not NP complete.


 HTH


 Robin


 On 8 Feb 2007, at 05:15, MINI GHOSH wrote:

 Dear R user,

 I want to know is there a way to find the minimum
 number of circles (of given radius) required to fill a
 given area (say rectangular) where overlapping of
 circles is allowed.

 Thanks,
 Regards,
 Mini Ghosh

 __
 R-help@stat.math.ethz.ch mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide http://www.R-project.org/posting-
 guide.html
 and provide commented, minimal, self-contained, reproducible code.

 --
 Robin Hankin
 Uncertainty Analyst
 National Oceanography Centre, Southampton
 European Way, Southampton SO14 3ZH, UK
   tel  023-8059-7743

 __
 R-help@stat.math.ethz.ch mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide http://www.R-project.org/posting- 
 guide.html
 and provide commented, minimal, self-contained, reproducible code.

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] setting a number of values to NA over a data.frame.

2007-02-08 Thread Jim Lemon
John Kane wrote:
 This is probably a simple problem but I don't see a
 solution.
 
 I have a data.frame with a number of columns where I
 would like 0 - NA
 
Hi John,
You might have a look at toNA in the prettyR package. Wait for version 
1.0-4, just uploaded, as I have fixed a bug in that function.

Jim

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] circle fill problem

2007-02-08 Thread MINI GHOSH
Dear Ingmar and Robin,

Thanks for you suggestions. I will see to it.

Regards,
Mini
--- Ingmar Visser [EMAIL PROTECTED] wrote:

 Robin  Mini,
 For those interested, googling for the 'orange
 packing problem' as it  
 is known, or more officially the sphere packing
 problems gives you  
 quite a few hits on these and similar problems.
 So at least the 3-d case the problem has been solved
 (I imagine the  
 problem is easier in 2-d ...)
 hth, Ingmar
 
 On 8 Feb 2007, at 09:52, Robin Hankin wrote:
 
  Mini
 
  This is a hard problem in general.
 
  Recreational mathematics has wrestled with
  this and similar problems over the years; the
  general field is the set cover problem but
  in your case the sets are uncountably infinite
  (and there are uncountably many of them).
 
  I would be surprised if your problem were not NP
 complete.
 
 
  HTH
 
 
  Robin
 
 
  On 8 Feb 2007, at 05:15, MINI GHOSH wrote:
 
  Dear R user,
 
  I want to know is there a way to find the minimum
  number of circles (of given radius) required to
 fill a
  given area (say rectangular) where overlapping of
  circles is allowed.
 
  Thanks,
  Regards,
  Mini Ghosh
 
  __
  R-help@stat.math.ethz.ch mailing list
  https://stat.ethz.ch/mailman/listinfo/r-help
  PLEASE do read the posting guide
 http://www.R-project.org/posting-
  guide.html
  and provide commented, minimal, self-contained,
 reproducible code.
 
  --
  Robin Hankin
  Uncertainty Analyst
  National Oceanography Centre, Southampton
  European Way, Southampton SO14 3ZH, UK
tel  023-8059-7743
 
  __
  R-help@stat.math.ethz.ch mailing list
  https://stat.ethz.ch/mailman/listinfo/r-help
  PLEASE do read the posting guide
 http://www.R-project.org/posting- 
  guide.html
  and provide commented, minimal, self-contained,
 reproducible code.
 


__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] circle fill problem

2007-02-08 Thread Robin Hankin
Hello Ingmar

In Kepler's sphere packing problem the
spheres are not allowed to overlap, which
would suggest to me that different tactics should
perhaps be used.

Mini's problem is formally a cover problem, and
the sphere packing problem is a packing problem.
The two are related, but tend not to have direct
relevance to one another.

Also be aware that Kepler's conjecture refers to the
packing fraction limit as  the space available tends to
infinity.

My understanding is that Kepler's conjecture has now been
proved beyond all reasonable doubt, but how to use this in
Mini's problem is not clear to me.


rksh


On 8 Feb 2007, at 09:21, Ingmar Visser wrote:

 Robin  Mini,
 For those interested, googling for the 'orange packing problem' as it
 is known, or more officially the sphere packing problems gives you
 quite a few hits on these and similar problems.
 So at least the 3-d case the problem has been solved (I imagine the
 problem is easier in 2-d ...)
 hth, Ingmar

 On 8 Feb 2007, at 09:52, Robin Hankin wrote:

 Mini

 This is a hard problem in general.

 Recreational mathematics has wrestled with
 this and similar problems over the years; the
 general field is the set cover problem but
 in your case the sets are uncountably infinite
 (and there are uncountably many of them).

 I would be surprised if your problem were not NP complete.


 HTH


 Robin


 On 8 Feb 2007, at 05:15, MINI GHOSH wrote:

 Dear R user,

 I want to know is there a way to find the minimum
 number of circles (of given radius) required to fill a
 given area (say rectangular) where overlapping of
 circles is allowed.

 Thanks,
 Regards,
 Mini Ghosh

 __
 R-help@stat.math.ethz.ch mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide http://www.R-project.org/posting-
 guide.html
 and provide commented, minimal, self-contained, reproducible code.

 --
 Robin Hankin
 Uncertainty Analyst
 National Oceanography Centre, Southampton
 European Way, Southampton SO14 3ZH, UK
   tel  023-8059-7743

 __
 R-help@stat.math.ethz.ch mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide http://www.R-project.org/posting-
 guide.html
 and provide commented, minimal, self-contained, reproducible code.

 __
 R-help@stat.math.ethz.ch mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide http://www.R-project.org/posting- 
 guide.html
 and provide commented, minimal, self-contained, reproducible code.

--
Robin Hankin
Uncertainty Analyst
National Oceanography Centre, Southampton
European Way, Southampton SO14 3ZH, UK
  tel  023-8059-7743

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] path for source()

2007-02-08 Thread Prof Brian Ripley

I don't think anyone have answered the actual question yet.

The answer is simple: the search path for search is '.', the current 
directory.  Just as it is for almost all the software on your system 
except binaries and package addons (including, e.g. R's search path for 
packages).


But R is a progamming language and it takes less time to add a search than 
to post a message here.  Something like (untested)


search.source - function(file, path=., ...)
{
   for(p in path) {
   fp - file.path(p, f)
   if(file.exists(fp)) return(source(fp, ...))
  }
  stop(file , sQuote(file),  not found)
}

On Thu, 8 Feb 2007, Wolfgang Raffelsberger wrote:


Hi,
an easy way to address this is to change directory within R before
calling source() :
setwd(D:/Projects/yourProject)
source(yourCode.R)

Of course you need to know where your .R files are.
Using getwd() you can always check where you are and using dir() you can
check the files in your directory (which you could combine with grep()
to search for .R) ..

Wolfgang

[EMAIL PROTECTED] a écrit :

hello,

i have a couple of .R files distributed about my file system. i 
commonly source() these from other files, but i have to include the 
full file path. this is not always convenient if you move files around. 
is there a way of setting the search path for source()?


thanks a lot!

cheers,
andrew.








--
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
and provide commented, minimal, self-contained, reproducible code.


[R] step in a model with strata

2007-02-08 Thread Pietro Bulian
Dear experts,
when I call the step function for a coxph model with n covariates and a 
dicotomous variable included as strata, the first term removed by step is 
always the strata variable. This is not what I want and then I do a manual 
step updating the model minus the least significant covariate and testing 
with anova, until I have minimized the model. Is there a package were this 
can be done? or am I doing something wrong ? (I'm not a statistician).

Thanks for hints

Pietro Bulian

Clinical and Experimental Hematology Research Unit
Centro di Riferimento Oncologico, I.R.C.C.S.
Via Pedemontana, 12
I-33081 Aviano (PN) - Italy

phone: +39 0434 659 412
fax: +39 0434 659 409
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
and provide commented, minimal, self-contained, reproducible code.


[R] Diffrerence in %in% function to boundry setting via

2007-02-08 Thread Benjamin Otto
Hi,

There is a point which is irritating me currently quite a bit and that is an
aspect of different behaviour between the %in% function and the
smaller/bigger than signs (). Here is are two examples to demonstrate what
I mean:

Example1:
 c(1,1,2,2,3,4,4,6,7) %in% c(1,2,3)
[1]  TRUE  TRUE  TRUE  TRUE  TRUE FALSE FALSE FALSE FALSE

Right, that is what I expect.

Example2:
 ps - seq(-0.502,0.378,by=0.001)
 ps[494]
[1] -0.009

 class(ps[494])
[1] numeric
 class(-0.009)
[1] numeric
 class(ps[494])
[1] numeric

 ps[494] == -0.009
[1] FALSE
 ps[494] %in% -0.009
[1] FALSE
 ps[494] == c(-0.009)
[1] FALSE
 ps[494] %in% c(-0.009)
[1] FALSE
 ps[494] = -0.008
[1] TRUE
 ps[494] = -0.010
[1] TRUE
 -0.009 == -0.009
[1] TRUE

BUT: 
 ps[249]
[1] -0.254
 class(ps[249])
[1] numeric
 ps[249] %in% -0.254
[1] TRUE

OK! Can sombody explain to me what is happening here? Honestly? I don't
understand where the difference but it's critical! Because obviuosly when I
have a set of numeric values (ALL have three digits) and to boundry values
lb/up, a lower and an upper boundry, I could (from what I thought until now)
chosse between:

Version1:
 small.set - set[set %in% seq(lb,up,by=0.001)]

Version2:
 small.set - set[set = lb  set = up]

Unfortunately with my data I used I got around 8000 values from my set with
version1 but about 24000 with version2. IS there some main diffrence I
didn't take into account or is my system just behaving irrational (that's
what I think if you look at Example2)?

I checked the behaviour under R-2.4.1 (Windows) and under 2.2.1 (Linux). The
result was the same.

Sincere regards

Benjamin Otto 

-- 
Benjamin Otto
Universitaetsklinikum Eppendorf Hamburg
Institut fuer Klinische Chemie
Martinistrasse 52
20246 Hamburg

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] boxplot statistics in ggplot

2007-02-08 Thread Vikas Rawal
It will be useful if you could explain the how to use the weighted boxplot
function. The manual does not give details. I have not been able to
make it work. Specifically, how does one write the function?

Vikas



On Wed, Feb 07, 2007 at 07:12:26AM -0600, hadley wickham wrote:
 Hi Vikas,
 
 Exactly what do you want to label them with?  Generally the purpose of
 the plot is to avoid having explicit labels - you can just read the
 numbers of the axes.  If you want the exact numbers, presenting them
 in a table might be more appropriate.
 
 I'm not at my development computer at the moment, so I can't give you
 the exact details, but you will have to calculate the statistics
 yourself (using the weighted boxplot function in ggplot) and add them
 to the plot in some way.  This should be a bit easier in the next
 version of ggplot, where the calculation and display are a little more
 distinct.
 
 Hadley
 
 On 2/7/07, Vikas Rawal [EMAIL PROTECTED] wrote:
 I need to make weighted boxplots. I found that ggplot makes them. I
 would however like to label them with the boxplot statistics (the
 median, q1 and q3). In the boxplot function in r-base, I could output
 boxplot statistics and then write a text on the plot to place the
 labels. How would one do it with ggplot?
 
 Vikas
 
 __
 R-help@stat.math.ethz.ch mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide 
 http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.
 


__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Diffrerence in %in% function to boundry setting via

2007-02-08 Thread Roger Bivand
On Thu, 8 Feb 2007, Benjamin Otto wrote:

A version of FAQ 7.31 Why doesn't R think these numbers are equal?

http://cran.r-project.org/doc/FAQ/R-FAQ.html#Why-doesn_0027t-R-think-these-numbers-are-equal_003f

 ps - seq(-0.502,0.378,by=0.001)
 ps[494]
[1] -0.009
 print(ps[494], digits=16)
[1] -0.009008
 all.equal(ps[494], -0.009)
[1] TRUE


 Hi,
 
 There is a point which is irritating me currently quite a bit and that is an
 aspect of different behaviour between the %in% function and the
 smaller/bigger than signs (). Here is are two examples to demonstrate what
 I mean:
 
 Example1:
  c(1,1,2,2,3,4,4,6,7) %in% c(1,2,3)
 [1]  TRUE  TRUE  TRUE  TRUE  TRUE FALSE FALSE FALSE FALSE
 
 Right, that is what I expect.
 
 Example2:
  ps - seq(-0.502,0.378,by=0.001)
  ps[494]
 [1] -0.009
 
  class(ps[494])
 [1] numeric
  class(-0.009)
 [1] numeric
  class(ps[494])
 [1] numeric
 
  ps[494] == -0.009
 [1] FALSE
  ps[494] %in% -0.009
 [1] FALSE
  ps[494] == c(-0.009)
 [1] FALSE
  ps[494] %in% c(-0.009)
 [1] FALSE
  ps[494] = -0.008
 [1] TRUE
  ps[494] = -0.010
 [1] TRUE
  -0.009 == -0.009
 [1] TRUE
 
 BUT: 
  ps[249]
 [1] -0.254
  class(ps[249])
 [1] numeric
  ps[249] %in% -0.254
 [1] TRUE
 
 OK! Can sombody explain to me what is happening here? Honestly? I don't
 understand where the difference but it's critical! Because obviuosly when I
 have a set of numeric values (ALL have three digits) and to boundry values
 lb/up, a lower and an upper boundry, I could (from what I thought until now)
 chosse between:
 
 Version1:
  small.set - set[set %in% seq(lb,up,by=0.001)]
 
 Version2:
  small.set - set[set = lb  set = up]
 
 Unfortunately with my data I used I got around 8000 values from my set with
 version1 but about 24000 with version2. IS there some main diffrence I
 didn't take into account or is my system just behaving irrational (that's
 what I think if you look at Example2)?
 
 I checked the behaviour under R-2.4.1 (Windows) and under 2.2.1 (Linux). The
 result was the same.
 
 Sincere regards
 
 Benjamin Otto 
 
 

-- 
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
and provide commented, minimal, self-contained, reproducible code.


[R] Zeta and Zipf distribution

2007-02-08 Thread Mauro Rossi

Dear R user,
I want to estimate the parameter of ZETA or/and ZIPF distributions 
using R, given a series of integer values. Do you know a package 
(similar to MASS) or a function (similar to fitdistr) I can use to 
estimate the parameter of these distributions using MLE method? 
Otherwise do you know a function (which use MLE method to estimate 
distribution parameters) that allow me to specify a PDF or PMF?

Thanks,
Regards
Mauro Rossi

--
Mauro Rossi
Istituto di Ricerca per la Protezione Idrogeologica
Consiglio Nazionale delle Ricerche
Via della Madonna Alta, 126
06128 Perugia
Italia
Tel. +39 075 5014421
Fax +39 075 5014420
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Zeta and Zipf distribution

2007-02-08 Thread David Barron
Does the zipf function in the VGAM package do what you want?

On 08/02/07, Mauro Rossi [EMAIL PROTECTED] wrote:

 Dear R user,
 I want to estimate the parameter of ZETA or/and ZIPF distributions
 using R, given a series of integer values. Do you know a package
 (similar to MASS) or a function (similar to fitdistr) I can use to
 estimate the parameter of these distributions using MLE method?
 Otherwise do you know a function (which use MLE method to estimate
 distribution parameters) that allow me to specify a PDF or PMF?
 Thanks,
 Regards
 Mauro Rossi

 --
 Mauro Rossi
 Istituto di Ricerca per la Protezione Idrogeologica
 Consiglio Nazionale delle Ricerche
 Via della Madonna Alta, 126
 06128 Perugia
 Italia
 Tel. +39 075 5014421
 Fax +39 075 5014420

 __
 R-help@stat.math.ethz.ch mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide
 http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.




-- 
=
David Barron
Said Business School
University of Oxford
Park End Street
Oxford OX1 1HP

[[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
and provide commented, minimal, self-contained, reproducible code.


[R] Partial file name

2007-02-08 Thread Jerry Pressnell
Hello all,

 

I wish to write an R script to read a specific .txt file each day. The file
is downloaded from a external source and the file name is the same three
letters followed by the date and time of download.

 

For example

 

Day 1

 

AAA_08_02_2007_06_18_98.txt

 

Day 2

 

AAA_09_02_2007_10_12_03.txt

 

Is it possible to use read.table() in such a way that it only needs the
start of the file name?

 

Many thanks,

 

Jerry


[[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
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Partial file name

2007-02-08 Thread Duncan Murdoch
On 2/8/2007 6:51 AM, Jerry Pressnell wrote:
 Hello all,
 
  
 
 I wish to write an R script to read a specific .txt file each day. The file
 is downloaded from a external source and the file name is the same three
 letters followed by the date and time of download.
 
  
 
 For example
 
  
 
 Day 1
 
  
 
 AAA_08_02_2007_06_18_98.txt
 
  
 
 Day 2
 
  
 
 AAA_09_02_2007_10_12_03.txt
 
  
 
 Is it possible to use read.table() in such a way that it only needs the
 start of the file name?

read.table() would need the full name, but other functions could give 
that to you.  For example, this should work, assuming there's always 
just one file that will match:

read.table( list.files( pattern = ^AAA_ ) )

or if you like file system wildcards better than regular expressions,

read.table( list.files( pattern = glob2rx(AAA_*) ) )

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
and provide commented, minimal, self-contained, reproducible code.


[R] Re : Re: setting a number of values to NA over a data.frame.

2007-02-08 Thread Olivier ETERRADOSSI
Hi John,

Unless I miss a point, why dont you try something like :

# some fake data
  fake-as.data.frame(cbind(seq(1,10,by=1),c(rep(1,4),rep(0,4),rep(2,2
  V1 V2
 111
 221
 331
 441
 550
 660
 770
 880
 992
10   102

# change 0 by NA
  fake[fake==0]-NA  # or fake$V2[fake$V2==0]-NA if you don't want all 
0 in the dataframe to be changed to NA
# test
  is.na(fake$V2)
[1] FALSE FALSE FALSE FALSE  TRUE  TRUE  TRUE  TRUE FALSE FALSE

Sorry if I did not understand the issue. Hope this helps. Olivier


Jim Lemon wrote :

 John Kane wrote:
   
  This is probably a simple problem but I don't see a
  solution.
  
  I have a data.frame with a number of columns where I
  would like 0 - NA
  
 
 Hi John,
 You might have a look at toNA in the prettyR package. Wait for version 
 1.0-4, just uploaded, as I have fixed a bug in that function.

 Jim

-- 
Olivier ETERRADOSSI
Maître-Assistant
CMGD / Equipe Propriétés Psycho-Sensorielles des Matériaux
Ecole des Mines d'Alès
Hélioparc, 2 av. P. Angot, F-64053 PAU CEDEX 9
tel std: +33 (0)5.59.30.54.25
tel direct: +33 (0)5.59.30.90.35 
fax: +33 (0)5.59.30.63.68
http://www.ema.fr

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Re : Re: setting a number of values to NA over a data.frame.

2007-02-08 Thread Olivier ETERRADOSSI

Hi again,

Awfully sorry John, I should have been sleeping and did not see your 
full post


here is a way, unless I miss the point again :

fake-as.data.frame(cbind(seq(1,10,by=1),c(rep(1,4),rep(0,4),rep(2,2 
# from my previous post


# one moree column this time !
fake3-cbind(fake,fake$V2)
index-c(2,3)
fake3[,index][fake3[,index]==0]-NA

not nice, but seems to do the job.
Hope this helps... this time :-)
Olivier

--
Olivier ETERRADOSSI
Maître-Assistant
CMGD / Equipe Propriétés Psycho-Sensorielles des Matériaux
Ecole des Mines d'Alès
Hélioparc, 2 av. P. Angot, F-64053 PAU CEDEX 9
tel std: +33 (0)5.59.30.54.25
tel direct: +33 (0)5.59.30.90.35 
fax: +33 (0)5.59.30.63.68

http://www.ema.fr

---BeginMessage---

Hi John,

Unless I miss a point, why dont you try something like :

# some fake data
 fake-as.data.frame(cbind(seq(1,10,by=1),c(rep(1,4),rep(0,4),rep(2,2
 V1 V2
111
221
331
441
550
660
770
880
992
10   102

# change 0 by NA
 fake[fake==0]-NA  # or fake$V2[fake$V2==0]-NA if you don't want all 
0 in the dataframe to be changed to NA

# test
 is.na(fake$V2)
[1] FALSE FALSE FALSE FALSE  TRUE  TRUE  TRUE  TRUE FALSE FALSE

Sorry if I did not understand the issue. Hope this helps. Olivier


Jim Lemon wrote :


John Kane wrote:
  

 This is probably a simple problem but I don't see a
 solution.
 
 I have a data.frame with a number of columns where I

 would like 0 - NA
 


Hi John,
You might have a look at toNA in the prettyR package. Wait for version 
1.0-4, just uploaded, as I have fixed a bug in that function.


Jim


--
Olivier ETERRADOSSI
Maître-Assistant
CMGD / Equipe Propriétés Psycho-Sensorielles des Matériaux
Ecole des Mines d'Alès
Hélioparc, 2 av. P. Angot, F-64053 PAU CEDEX 9
tel std: +33 (0)5.59.30.54.25
tel direct: +33 (0)5.59.30.90.35 
fax: +33 (0)5.59.30.63.68

http://www.ema.fr


---End Message---
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Re : Re: setting a number of values to NA over a data.frame.

2007-02-08 Thread Prof Brian Ripley
I think you do understand it. Indexing a data frame by a logical matrix is 
provided just for applications like this and the reverse,

mydf[is.na(mydf)]  - something

prettyR's toNA seems to believe that data frames can be other than 2D, 
which is surprising.

On Thu, 8 Feb 2007, Olivier ETERRADOSSI wrote:

 Hi John,

 Unless I miss a point, why dont you try something like :

 # some fake data
  fake-as.data.frame(cbind(seq(1,10,by=1),c(rep(1,4),rep(0,4),rep(2,2
  V1 V2
 111
 221
 331
 441
 550
 660
 770
 880
 992
 10   102

 # change 0 by NA
  fake[fake==0]-NA  # or fake$V2[fake$V2==0]-NA if you don't want all
 0 in the dataframe to be changed to NA
 # test
  is.na(fake$V2)
 [1] FALSE FALSE FALSE FALSE  TRUE  TRUE  TRUE  TRUE FALSE FALSE

 Sorry if I did not understand the issue. Hope this helps. Olivier


 Jim Lemon wrote :

 John Kane wrote:

 This is probably a simple problem but I don't see a
 solution.

 I have a data.frame with a number of columns where I
 would like 0 - NA


 Hi John,
 You might have a look at toNA in the prettyR package. Wait for version
 1.0-4, just uploaded, as I have fixed a bug in that function.

 Jim



-- 
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
and provide commented, minimal, self-contained, reproducible code.


[R] smartpred depends on fitted() in flexmix?

2007-02-08 Thread Michael Kubovy
Hi,

I was going through the examples in smartpred. It seems there's an  
unstated dependency on the fitted() function in package flexmix.

n = 20
set.seed(86)
x = sort(runif(n))
y = sort(runif(n))
library(splines)
fit = lm(y ~ ns(x, df=5))
plot(x, y)
lines(x, fitted(fit)) # won't work w/o prior loading of the flexmix  
package.
newx = seq(0, 1, len=n)
points(newx, predict(fit, data.frame(x=newx)), type=b, col=2, err=-1)
_
Professor Michael Kubovy
University of Virginia
Department of Psychology
USPS: P.O.Box 400400Charlottesville, VA 22904-4400
Parcels:Room 102Gilmer Hall
 McCormick RoadCharlottesville, VA 22903
Office:B011+1-434-982-4729
Lab:B019+1-434-982-4751
Fax:+1-434-982-4766
WWW:http://www.people.virginia.edu/~mk9y/

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Newbie: Acf function

2007-02-08 Thread Martin Percossi
Hi, I would like to use acf.plot on a correlogram that is computed 
externally. In other words, I would like to fake out the acf object. 
Is this possible?-- any help would be appreciated.

TIA
Martin

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Newbie: Acf function

2007-02-08 Thread Vincent Goulet
Le Jeudi 8 Février 2007 09:41, Martin Percossi a écrit :
 Hi, I would like to use acf.plot on a correlogram that is computed
 externally. In other words, I would like to fake out the acf object.
 Is this possible?-- any help would be appreciated.

Well, essentially plot.acf() makes a plot with 'type = h'. Playing around 
with that so give you the desired output.

Now wait a little bit... There, I already wrote such a function:

tacf - function(x, ...)
{
plot(x, type = h, ylab = ACF, xlab = Lag,
 ylim = c(-1, 1), ...)
abline(h = 0)
}

('x' contains the autocorrelations.)

HTH

-- 
  Vincent Goulet, Associate Professor
  École d'actuariat
  Université Laval, Québec 
  [EMAIL PROTECTED]   http://vgoulet.act.ulaval.ca

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] step in a model with strata

2007-02-08 Thread Henric Nilsson (Public)
Den To, 2007-02-08, 10:47 skrev Pietro Bulian:
 Dear experts,
 when I call the step function for a coxph model with n covariates and a
 dicotomous variable included as strata, the first term removed by step is
 always the strata variable. This is not what I want

So, what do you want exactly? (You didn't tell.)

I'm just guessing here, but it sounds like you'd always want the strata
to stay in the model. In that case, use the `scope' argument i.e.
something like `step(fit, scope = list(lower = ~ strata(x)))' if your
fitted model object is called `fit' and your stratification variable is
called `x' -- see ?step.

 and then I do a manual step updating the model minus the least
 significant covariate and testing with anova, until I have minimized
 the model.

So, let me see if I understand this correctly, you have a two-stage
procedure where you first minimize the AIC criterion and then remove
non-significant predictors in a stepwise fashion?

 Is there a package were this can be done?

If you're referring to the procedure above, I'm not aware of any such
package.

 or am I doing something wrong ? (I'm not a statistician).

Well, it depends... If you want some guidance on model selection, see e.g.

@BOOK{R:Harrell:2001,
  AUTHOR = {Frank E. Harrell},
  TITLE = {Regression Modeling Strategies, with Applications to
  Linear Models, Survival Analysis and Logistic
  Regression},
  PUBLISHER = {Springer},
  YEAR = 2001,
  NOTE = {ISBN 0-387-95232-2},
  URL = {http://biostat.mc.vanderbilt.edu/twiki/bin/view/Main/RmS}
}


HTH,
Henric




 Thanks for hints

 Pietro Bulian

 Clinical and Experimental Hematology Research Unit
 Centro di Riferimento Oncologico, I.R.C.C.S.
 Via Pedemontana, 12
 I-33081 Aviano (PN) - Italy

 phone: +39 0434 659 412
 fax: +39 0434 659 409
 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
 and provide commented, minimal, self-contained, reproducible code.



__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] R in Industry

2007-02-08 Thread Albrecht, Dr. Stefan (AZ Private Equity Partner)
Dear all,
 
I was reading with great interest your comments about the use of R in
the industry. Personally, I use R as scripting language in the financial
industry, not so much for its statistical capabilities (which are
great), but more for programming. I once switched from S-Plus to R,
because I liked R more, it had a better and easier to use documentation
and it is faster (especially with loops).
 
Now some colleagues of mine are (finally) eager to join me in my
quantitative efforts, but they feel that they are more at ease with
Matlab. I can understand this. Matlab has a real IDE with symbolic
debugger, integrated editor and profiling, etc. The help files are
great, very comprehensive and coherent. It also could be easier to
learn.
 
And, I was very astonished to realise, Matlab is very, very much faster
with simple for loops, which would speed up simulations considerably.
So I have trouble to argue for a use of R (which I like) instead of
Matlab. The price of Matlab is high, but certainly not prohibitive. R is
great and free, but maybe less comfortable to use than Matlab.
 
Finally, after all, I have the impression that in many job offerings in
the financial industry R is much less often mentioned than Matlab.
 
I would very much appreciate any comments on my above remarks. I know
there has been some discussions of R vs. Matlab on R-help, but these
could be somewhat out-dated, since both languages are evolving quite
quickly.
 
With many thanks and best regards,
Stefan Albrecht
 
 

[[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
and provide commented, minimal, self-contained, reproducible code.


Re: [R] smartpred depends on fitted() in flexmix?

2007-02-08 Thread Bettina Gruen
Hi,

which packages do you have attached? Look for example at the output of 
sessionInfo().

For your code you need the function fitted and its S3 methods from 
package stats. So there is no reason why flexmix should be 
necessary. However, in flexmix S4 methods for fitted are provided 
and the S3 methods from stats are imported using the following in the 
NAMESPACE:

importFrom(stats, fitted)

I can only guess that the problem might occur because you have for 
example VGAM attached. I can run your code if VGAM is not attached. 
The code does not work after loading VGAM and works again after also 
loading flexmix:

  n = 20
  set.seed(86)
  x = sort(runif(n))
  y = sort(runif(n))
  library(splines)
  fit = lm(y ~ ns(x, df=5))
  plot(x, y)
  lines(x, fitted(fit))
  library(VGAM)
  lines(x, fitted(fit))
Error in function (classes, fdef, mtable)  :
 unable to find an inherited method for function fitted, for 
signature lm
  library(flexmix)
  lines(x, fitted(fit))

I think this should be possible to solve by also adding 
importFrom(stats, fitted) to the NAMESPACE of VGAM.

Best,
Bettina

Michael Kubovy wrote:
 Hi,
 
 I was going through the examples in smartpred. It seems there's an  
 unstated dependency on the fitted() function in package flexmix.
 
 n = 20
 set.seed(86)
 x = sort(runif(n))
 y = sort(runif(n))
 library(splines)
 fit = lm(y ~ ns(x, df=5))
 plot(x, y)
 lines(x, fitted(fit)) # won't work w/o prior loading of the flexmix  
 package.
 newx = seq(0, 1, len=n)
 points(newx, predict(fit, data.frame(x=newx)), type=b, col=2, err=-1)
 _
 Professor Michael Kubovy
 University of Virginia
 Department of Psychology
 USPS: P.O.Box 400400Charlottesville, VA 22904-4400
 Parcels:Room 102Gilmer Hall
  McCormick RoadCharlottesville, VA 22903
 Office:B011+1-434-982-4729
 Lab:B019+1-434-982-4751
 Fax:+1-434-982-4766
 WWW:http://www.people.virginia.edu/~mk9y/
 
 __
 R-help@stat.math.ethz.ch mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.
 


__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] (no subject)

2007-02-08 Thread Catherine Dempsey
Hi.

I hope you can help me...

 

I have fitted the following ARIMA model:
arima1-arima(bigspring$log.volume, order=c(0,1,2))

I need to predict 30 days ahead.  I used following code
predict(arima1,n.ahead=30,se=T)

 

However I get 30 predictions, but from predictions 2:30 I get the same
predictions.  Why is this?  What am I doing wrong

 

Thanks

Catherine



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


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

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Zeta and Zipf distribution

2007-02-08 Thread Mauro Rossi

Dear David,
thank you for your reply.
I tried to use the package VGAM, the function zipf and also the 
function zetaff, but these functions don't allow me to estimate 
parameters directly, I have to use a Gerneralized Linear Model or a 
Generalized Additive Model (vgam or vglm functions) and I don't want to 
use those. Don't you know a way to apply these tools to my data?
At the end my PMF has to be Y=f(X) where f(X) is a zeta or a zipf 
distribution, while using VGAM the PMF is Y = b0 + b1*f(X1)+ ... 
+bn*f(Xn). Do you know how I can write the script using the VGAM 
function for the PMF I need?


Thank you in advance,

Mauro Rossi


David Barron ha scritto:

Does the zipf function in the VGAM package do what you want?

On 08/02/07, *Mauro Rossi* [EMAIL PROTECTED] 
mailto:[EMAIL PROTECTED] wrote:


Dear R user,
I want to estimate the parameter of ZETA or/and ZIPF distributions
using R, given a series of integer values. Do you know a package
(similar to MASS) or a function (similar to fitdistr) I can use to
estimate the parameter of these distributions using MLE method?
Otherwise do you know a function (which use MLE method to estimate
distribution parameters) that allow me to specify a PDF or PMF?
Thanks,
Regards
Mauro Rossi

--
Mauro Rossi
Istituto di Ricerca per la Protezione Idrogeologica
Consiglio Nazionale delle Ricerche
Via della Madonna Alta, 126
06128 Perugia
Italia
Tel. +39 075 5014421
Fax +39 075 5014420

__
R-help@stat.math.ethz.ch mailto:R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide
http://www.R-project.org/posting-guide.html
http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.




--
=
David Barron
Said Business School
University of Oxford
Park End Street
Oxford OX1 1HP


--
Mauro Rossi

Istituto di Ricerca per la Protezione Idrogeologica

Consiglio Nazionale delle Ricerche

Via della Madonna Alta, 126

06128 Perugia

Italia

Tel. +39 075 5014421

Fax +39 075 5014420

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Newbie: Acf function

2007-02-08 Thread rolf
Martin Percossi wrote:

 Hi, I would like to use acf.plot on a correlogram that is computed 
 externally. In other words, I would like to fake out the acf object. 
 Is this possible?-- any help would be appreciated.

(a) Note that it's ``plot.acf'' NOT acf.plot.

(b) This is R --- ***ANYTHING*** is possible.

(c) Create an object, say ``y'' of class ``acf'',
having components with the right names.  You could
build a dummy acf object by

 dum - acf(rnorm(100),plot=FALSE)

and the examine ``dum'' to see what it should consist of.

(d) Something like:

y - list(acf=array(ecc,dim=c(length(ecc),1,1)),
  type=correlation,
  n.used=n.ecc,lag=array(0:(length(ecc)-1),
 dim=c(length(ecc),1,1)),
  series=ecc,snames=NULL)
class(y) - acf
plot(y)

where ``ecc'' is a vector comprising your ``externally
created correlogram'' and ``n.ecc'' is the length of the series
from which ecc was created.  Note that the first entry of ecc
should be 1; it corresponds to lag 0.

cheers,

Rolf Turner
[EMAIL PROTECTED]

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Measures of forecast ERROR seasonal ARIMA model -- general question

2007-02-08 Thread sj
Hello,

I have a general question, I am fitting and validating a seasonal arima
model on daily time series data, the data have an obvious (7 day weekly)
seasonal trend using an arima (1,0,1)x(0,1,1). I have a validation set of
thirteen weeks and I have computed one day ahead forecasts, i.e. I
incrementally add  one day  from the validation set to the test set
reestimate the model parameters and then make a forecast for the next day in
the validation set, I do the same thing for 7 days ahead, i.e. adding in
increments of 7 reestimating and then forecasting for the following 7 days,
and then for 30 days ahead and for the full 91 days ahead. When I computed
root mean squared error (rmse) for the forecasts at different horizons I was
surprised that the rmse's were lower for the 30 day horizons and 91 day
horizon than they were for both the 7-day horizon and the 1-day ahead
forecasts. I have tried to understand why this might be happening,but I
would appreciate any feed back if anyone has the time. Sorry for the general
question


best,

Spencer Jones

[[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
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Newbie: Acf function

2007-02-08 Thread Martin Percossi
Funny enough, but by accident I typed unclass(acf) (I had meant to 
unclass the *data* obtained as a result of applying this function), and 
I saw the source code! From there I managed to reproduce your steps 
below... In any case, many thanks to all for your help.

Martin

[EMAIL PROTECTED] wrote:

Martin Percossi wrote:

  

Hi, I would like to use acf.plot on a correlogram that is computed 
externally. In other words, I would like to fake out the acf object. 
Is this possible?-- any help would be appreciated.



(a) Note that it's ``plot.acf'' NOT acf.plot.

(b) This is R --- ***ANYTHING*** is possible.

(c) Create an object, say ``y'' of class ``acf'',
having components with the right names.  You could
build a dummy acf object by

 dum - acf(rnorm(100),plot=FALSE)

and the examine ``dum'' to see what it should consist of.

(d) Something like:

y - list(acf=array(ecc,dim=c(length(ecc),1,1)),
  type=correlation,
  n.used=n.ecc,lag=array(0:(length(ecc)-1),
 dim=c(length(ecc),1,1)),
  series=ecc,snames=NULL)
class(y) - acf
plot(y)

where ``ecc'' is a vector comprising your ``externally
created correlogram'' and ``n.ecc'' is the length of the series
from which ecc was created.  Note that the first entry of ecc
should be 1; it corresponds to lag 0.

cheers,

Rolf Turner
[EMAIL PROTECTED]
  


__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] R vs Matlab {Re: R in Industry}

2007-02-08 Thread Martin Maechler
 Albr == Albrecht, Dr Stefan (AZ Private Equity Partner) [EMAIL 
 PROTECTED]
 on Thu, 8 Feb 2007 16:38:18 +0100 writes:

Albr Dear all,
Albr I was reading with great interest your comments about the use of R in
Albr the industry. Personally, I use R as scripting language in the 
financial
Albr industry, not so much for its statistical capabilities (which are
Albr great), but more for programming. I once switched from S-Plus to R,
Albr because I liked R more, it had a better and easier to use 
documentation
Albr and it is faster (especially with loops).
 
Albr Now some colleagues of mine are (finally) eager to join me in my
Albr quantitative efforts, but they feel that they are more at ease with
Albr Matlab. I can understand this. Matlab has a real IDE with symbolic
Albr debugger, integrated editor and profiling, etc. The help files are
Albr great, very comprehensive and coherent. It also could be easier to
Albr learn.
 
Albr And, I was very astonished to realise, Matlab is very, very much 
faster
Albr with simple for loops, which would speed up simulations 
considerably.
Can you give some evidence for this statement, please?

At the moment, I'd bet that you use forgot to pre-allocate a
result array in R and do something like the notorious horrible (:-)
1-dimensional

  r - NULL
  for(i in 1:1) {
r[i] - verycomplicatedsimulation(i)
  }

instead of the correct

  r - numeric(1)
  for(i in 1:1) {
r[i] - verycomplicatedsimulation(i)
  }

If r is a matrix or even higher array, and you are using rbind()
or cbind() inside the loop to build up the result,
the problem will become even worse.

Albr So I have trouble to argue for a use of R (which I like) instead of
Albr Matlab. The price of Matlab is high, but certainly not prohibitive. R 
is
Albr great and free, but maybe less comfortable to use than Matlab.
 
Albr Finally, after all, I have the impression that in many job offerings 
in
Albr the financial industry R is much less often mentioned than Matlab.
 
Albr I would very much appreciate any comments on my above remarks. I know
Albr there has been some discussions of R vs. Matlab on R-help, but these
Albr could be somewhat out-dated, since both languages are evolving quite
Albr quickly.
 
Albr With many thanks and best regards,
Albr Stefan Albrecht

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] (no subject)

2007-02-08 Thread Leeds, Mark \(IED\)
You're not doing anything wrong. You fit an arima(0,1,2) so it doesn't
know the epsilon terms going
forward are after the first step so it assumes them to be zero so you
get the same forecast every day.  I think you would have to 
re-estimate each day if you want different forecasts every day.


-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Catherine Dempsey
Sent: Thursday, February 08, 2007 9:59 AM
To: '[EMAIL PROTECTED]'
Subject: [R] (no subject)

Hi.

I hope you can help me...

 

I have fitted the following ARIMA model:
arima1-arima(bigspring$log.volume, order=c(0,1,2))

I need to predict 30 days ahead.  I used following code
predict(arima1,n.ahead=30,se=T)

 

However I get 30 predictions, but from predictions 2:30 I get the same
predictions.  Why is this?  What am I doing wrong

 

Thanks

Catherine



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


The information in this Internet email is confidential and\ ...{{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
and provide commented, minimal, self-contained, reproducible code.


[R] manipulate group data using column name

2007-02-08 Thread sun
Hi,

 Maybe this is a trivial question but I can not figure out a good solution.

I have a data frame fa and want to add a new column sum with the sum value 
of fa$X1 grouped by fa$X3.

 fa
   X1 X2 X3
1   1 11  1
2   2 12  1
3   3 13  1
4   4 14  2
5   5 15  2
6   6 16  2
7   7 17  3
8   8 18  3
9   9 19  3
10 10 20  3

fa$X3 is the index of group

i can

aggregate(fa[,X1],list(fa$X3),sum)
  Group.1  x
1   1  6
2   2 15
3   3 34

then I want to add a new column sum in fa and assign the aggregated result 
to the new column. Is there a solution without using loops?
or maybe there is some way can even avoid aggregate operation?

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
and provide commented, minimal, self-contained, reproducible code.


Re: [R] manipulate group data using column name

2007-02-08 Thread Gabor Grothendieck
Try this:

fa$sum - ave(fa$X1, fa$X3, FUN = sum)


On 2/8/07, sun [EMAIL PROTECTED] wrote:
 Hi,

  Maybe this is a trivial question but I can not figure out a good solution.

 I have a data frame fa and want to add a new column sum with the sum value
 of fa$X1 grouped by fa$X3.

  fa
   X1 X2 X3
 1   1 11  1
 2   2 12  1
 3   3 13  1
 4   4 14  2
 5   5 15  2
 6   6 16  2
 7   7 17  3
 8   8 18  3
 9   9 19  3
 10 10 20  3

 fa$X3 is the index of group

 i can

 aggregate(fa[,X1],list(fa$X3),sum)
  Group.1  x
 1   1  6
 2   2 15
 3   3 34

 then I want to add a new column sum in fa and assign the aggregated result
 to the new column. Is there a solution without using loops?
 or maybe there is some way can even avoid aggregate operation?

 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
 and provide commented, minimal, self-contained, reproducible code.


__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] NEWBIE: @BOOK help?

2007-02-08 Thread Zembower, Kevin
In Henric's recent post, he included this output:

@BOOK{R:Harrell:2001,
  AUTHOR = {Frank E. Harrell},
  TITLE = {Regression Modeling Strategies, with Applications to
  Linear Models, Survival Analysis and Logistic
  Regression},
  PUBLISHER = {Springer},
  YEAR = 2001,
  NOTE = {ISBN 0-387-95232-2},
  URL = {http://biostat.mc.vanderbilt.edu/twiki/bin/view/Main/RmS}
}

Can someone tell me how this is generated? I've noticed this in a few
recent posts. I attempted:

RSiteSearch(@BOOK)
?BOOK
?book

but it didn't return anything useful.

Thanks.

-Kevin

Kevin Zembower
Internet Services Group manager
Center for Communication Programs
Bloomberg School of Public Health
Johns Hopkins University
111 Market Place, Suite 310
Baltimore, Maryland  21202
410-659-6139

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] DRMRGL

2007-02-08 Thread Joe Byers
I have tried to install the drmrgl package and receive the following error:

  library(djmrgl)
Error in dyn.load(x, as.logical(local), as.logical(now)) :
 unable to load shared library 
'D:/PROGRA~1/R/library/djmrgl/libs/djmrgl.
dll':
   LoadLibrary failure:  The specified procedure could not be found.
Error in library(djmrgl) : .First.lib failed for 'djmrgl'

When I try and load the library from an rterm windows I get a pop up 
error that the procedure entry point ismdi could not be located in the 
dynamic link library R.dll

Has anyone seen this problem before? and if so, can you help me?

Thank you
Joe

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Dendrogram plot without y-axis

2007-02-08 Thread wvanwie
Hi,

I wish to plot a dendrogram, but without the y-axis. Simply setting yaxt=n
does not work. Does anyone know what would work?

Kind regards,

Wessel van Wieringen

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Impossible to get jpeg or png output

2007-02-08 Thread Mahieux Dimitri
Hi,

When I want to output a png file, I have the following error message :

Error dans X11(paste(jpeg::, quality, :, filename, sep = ), width,  :
inpossible de démarrer le périphérique JPEG
De plus : Warning message:
impossible d'ouvrir le fichier JPEG 'Test.jpeg'

or in english

Error in X11(paste(jpeg::, quality, :, filename, sep = ), width,  :
inpossible to start the JPEG peripheral
Warning message:
impossible to open the file JPEG 'Test.jpeg'

I've checked the capabilities which give :

  capabilities()
jpeg  pngtcltk  X11 http/ftp  sockets   libxml fifo
TRUE TRUEFALSE TRUE TRUE TRUE TRUE TRUE
  clediticonv  NLS
TRUE TRUE TRUE

So I don't understand why I can't have a jpeg file ( or png file because 
I've the same problem to)

Any Idea ?

Thx 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
and provide commented, minimal, self-contained, reproducible code.


[R] Strange behavior of abc.ci() in boot

2007-02-08 Thread Michael Kubovy
require(boot)
# [1] TRUE
set.seed(1)
summary(rn - rnorm(30))
# Min.  1st Qu.   Median Mean  3rd Qu. Max.
# -2.21500 -0.43500  0.25660  0.08246  0.70870  1.59500
abc.ci(rnorm(30), mean)
# [1] 0.9500 0.08245817 0.08245817

*
sessionInfo()
R version 2.4.1 (2006-12-18)
i386-apple-darwin8.8.1

locale:
C

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

other attached packages:
 boot   xtable latticeExtra  lattice  
gridBase MASS  JGR   iplots   JavaGD
 1.2-27  1.4-3  0.1-40.14-16  0.4-3  
7.2-31 1.4-15  1.0-5  0.3-5
rJava
 0.4-13

_
Professor Michael Kubovy
University of Virginia
Department of Psychology
USPS: P.O.Box 400400Charlottesville, VA 22904-4400
Parcels:Room 102Gilmer Hall
 McCormick RoadCharlottesville, VA 22903
Office:B011+1-434-982-4729
Lab:B019+1-434-982-4751
Fax:+1-434-982-4766
WWW:http://www.people.virginia.edu/~mk9y/

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] R in Industry

2007-02-08 Thread Patrick Burns
 From what I know Matlab is much more popular in
fixed income than R, but R is vastly more popular in
equities.  R seems to be making quite a lot of headway
in finance, even in fixed income to some degree.

At least to some extent, this is probably logical behavior --
fixed income is more mathematical, and equities is more
statistical.

Matlab is easier to learn mainly because it has much simpler
data structures.  However, once you are doing something
where a complex data structure is natural, then R is going to
be easier to use and you are likely to have a more complete
implementation of what you want.

If speed becomes a limiting factor, then moving the heavy
computing to C is a natural thing to do, and very easy with R.

Patrick Burns
[EMAIL PROTECTED]
+44 (0)20 8525 0696
http://www.burns-stat.com
(home of S Poetry and A Guide for the Unwilling S User)

Albrecht, Dr. Stefan (AZ Private Equity Partner) wrote:

Dear all,
 
I was reading with great interest your comments about the use of R in
the industry. Personally, I use R as scripting language in the financial
industry, not so much for its statistical capabilities (which are
great), but more for programming. I once switched from S-Plus to R,
because I liked R more, it had a better and easier to use documentation
and it is faster (especially with loops).
 
Now some colleagues of mine are (finally) eager to join me in my
quantitative efforts, but they feel that they are more at ease with
Matlab. I can understand this. Matlab has a real IDE with symbolic
debugger, integrated editor and profiling, etc. The help files are
great, very comprehensive and coherent. It also could be easier to
learn.
 
And, I was very astonished to realise, Matlab is very, very much faster
with simple for loops, which would speed up simulations considerably.
So I have trouble to argue for a use of R (which I like) instead of
Matlab. The price of Matlab is high, but certainly not prohibitive. R is
great and free, but maybe less comfortable to use than Matlab.
 
Finally, after all, I have the impression that in many job offerings in
the financial industry R is much less often mentioned than Matlab.
 
I would very much appreciate any comments on my above remarks. I know
there has been some discussions of R vs. Matlab on R-help, but these
could be somewhat out-dated, since both languages are evolving quite
quickly.
 
With many thanks and best regards,
Stefan Albrecht
 
 

   [[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
and provide commented, minimal, self-contained, reproducible code.


  


__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Zeta and Zipf distribution

2007-02-08 Thread David Barron
I don't claim to be a huge expert on this, but I think you are mistaken
about what you are getting when you use the zipf family with the vglm
function.  From what I can tell from the documentation, this does indeed
give you an estimate of the parameter of the zipf distribution.  I've tried
to test this using some random numbers (probably not strictly correct
procedure, but I think it's a reasonable approximation):

set.seed(1234)
 N - 5
  y - (1:N)
  alpha - 2.5  # this is the parameter of the zipf distribution
  p - 1/(y^alpha) ; p - p/sum(p)
  n - 10
  x - sample (y, n, replace=TRUE, prob=p)
w - as.vector(table(x))
fit = vglm  (y ~ 1, zipf(link=identity, init=2), tra=TRUE, weight=w)
 Coef(fit)

   s
2.501086

Is this not what you need?

On 08/02/07, Mauro Rossi [EMAIL PROTECTED] wrote:

 Dear David,
 thank you for your reply.
 I tried to use the package VGAM, the function zipf and also the
 function zetaff, but these functions don't allow me to estimate
 parameters directly, I have to use a Gerneralized Linear Model or a
 Generalized Additive Model (vgam or vglm functions) and I don't want to
 use those. Don't you know a way to apply these tools to my data?
 At the end my PMF has to be Y=f(X) where f(X) is a zeta or a zipf
 distribution, while using VGAM the PMF is Y = b0 + b1*f(X1)+ ...
 +bn*f(Xn). Do you know how I can write the script using the VGAM
 function for the PMF I need?

 Thank you in advance,

 Mauro Rossi


 David Barron ha scritto:
  Does the zipf function in the VGAM package do what you want?
 
  On 08/02/07, *Mauro Rossi* [EMAIL PROTECTED]
  mailto:[EMAIL PROTECTED] wrote:
 
  Dear R user,
  I want to estimate the parameter of ZETA or/and ZIPF distributions
  using R, given a series of integer values. Do you know a package
  (similar to MASS) or a function (similar to fitdistr) I can use to
  estimate the parameter of these distributions using MLE method?
  Otherwise do you know a function (which use MLE method to estimate
  distribution parameters) that allow me to specify a PDF or PMF?
  Thanks,
  Regards
  Mauro Rossi
 
  --
  Mauro Rossi
  Istituto di Ricerca per la Protezione Idrogeologica
  Consiglio Nazionale delle Ricerche
  Via della Madonna Alta, 126
  06128 Perugia
  Italia
  Tel. +39 075 5014421
  Fax +39 075 5014420
 
  __
  R-help@stat.math.ethz.ch mailto:R-help@stat.math.ethz.ch mailing
 list
  https://stat.ethz.ch/mailman/listinfo/r-help
  PLEASE do read the posting guide
  http://www.R-project.org/posting-guide.html
  http://www.R-project.org/posting-guide.html
  and provide commented, minimal, self-contained, reproducible code.
 
 
 
 
  --
  =
  David Barron
  Said Business School
  University of Oxford
  Park End Street
  Oxford OX1 1HP

 --
 Mauro Rossi

 Istituto di Ricerca per la Protezione Idrogeologica

 Consiglio Nazionale delle Ricerche

 Via della Madonna Alta, 126

 06128 Perugia

 Italia

 Tel. +39 075 5014421

 Fax +39 075 5014420





-- 
=
David Barron
Said Business School
University of Oxford
Park End Street
Oxford OX1 1HP

[[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
and provide commented, minimal, self-contained, reproducible code.


Re: [R] NEWBIE: @BOOK help?

2007-02-08 Thread Abhijit Dasgupta
This is a BibTeX entry for Frank Harrell's book, which can be generated 
using a variety of software (I use JabRef or emacs/RefTeX or WinEdt, as 
needed). It is not generated from R, I believe. BibTeX is the 
bibliography management and citation system that is used within the 
TeX/LaTeX framework of producing documents, which is commonly used in 
the sciences, engineering and statistics. Many of us have BibTeX files 
which hold all the citations we wish to cite, and the BibTeX program 
extracts ones referred to in an article we write, formats it and inserts 
it in the text and References of the article.

For more information, google BibTeX or LaTeX bibliography

Abhijit

Zembower, Kevin wrote:
 In Henric's recent post, he included this output:

 @BOOK{R:Harrell:2001,
   AUTHOR = {Frank E. Harrell},
   TITLE = {Regression Modeling Strategies, with Applications to
   Linear Models, Survival Analysis and Logistic
   Regression},
   PUBLISHER = {Springer},
   YEAR = 2001,
   NOTE = {ISBN 0-387-95232-2},
   URL = {http://biostat.mc.vanderbilt.edu/twiki/bin/view/Main/RmS}
 }

 Can someone tell me how this is generated? I've noticed this in a few
 recent posts. I attempted:

 RSiteSearch(@BOOK)
 ?BOOK
 ?book

 but it didn't return anything useful.

 Thanks.

 -Kevin

 Kevin Zembower
 Internet Services Group manager
 Center for Communication Programs
 Bloomberg School of Public Health
 Johns Hopkins University
 111 Market Place, Suite 310
 Baltimore, Maryland  21202
 410-659-6139

 __
 R-help@stat.math.ethz.ch mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.


__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] NEWBIE: @BOOK help?

2007-02-08 Thread Andrew Perrin
It's BibTeX source -- used for the BibTeX bibliography management system 
that integrates with LaTeX.

http://www.ecst.csuchico.edu/~jacobsd/bib/formats/bibtex.html
http://www.ctan.org

--
Andrew J Perrin - andrew_perrin (at) unc.edu - http://perrin.socsci.unc.edu
Assistant Professor of Sociology; Book Review Editor, _Social Forces_
University of North Carolina - CB#3210, Chapel Hill, NC 27599-3210 USA
New Book: http://www.press.uchicago.edu/cgi-bin/hfs.cgi/00/178592.ctl



On Thu, 8 Feb 2007, Zembower, Kevin wrote:

 In Henric's recent post, he included this output:

 @BOOK{R:Harrell:2001,
  AUTHOR = {Frank E. Harrell},
  TITLE = {Regression Modeling Strategies, with Applications to
  Linear Models, Survival Analysis and Logistic
  Regression},
  PUBLISHER = {Springer},
  YEAR = 2001,
  NOTE = {ISBN 0-387-95232-2},
  URL = {http://biostat.mc.vanderbilt.edu/twiki/bin/view/Main/RmS}
 }

 Can someone tell me how this is generated? I've noticed this in a few
 recent posts. I attempted:

 RSiteSearch(@BOOK)
 ?BOOK
 ?book

 but it didn't return anything useful.

 Thanks.

 -Kevin

 Kevin Zembower
 Internet Services Group manager
 Center for Communication Programs
 Bloomberg School of Public Health
 Johns Hopkins University
 111 Market Place, Suite 310
 Baltimore, Maryland  21202
 410-659-6139

 __
 R-help@stat.math.ethz.ch mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.


__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] abbreviate dataframe for Sweave output

2007-02-08 Thread stubben
Thanks Charles and Max, both functions work great.  I also used a hack 
to replace row names with '.', '. ', '.  ', etc.

Chris

dot.df - function(x, head = 3, tail=1, dotrows=2)
{
x - format(rbind(head(x,head + dotrows), tail(x,tail)))
if(dotrows0)
{
   x[(head + 1):(head + dotrows),] - .
   for(i in 1:dotrows){ rownames(x)[head+i]-paste(., substring(  
 , 1, i-1))}
}
x
}

dot.df(crabs)
 sp sex index   FL   RW   CL   CW   BD
1B   M 1  8.1  6.7 16.1 19.0  7.0
2B   M 2  8.8  7.7 18.1 20.8  7.4
3B   M 3  9.2  7.8 19.0 22.4  7.7
..   . ......
..   . ......
200  O   F50 23.1 20.2 46.2 52.5 21.1



## or dot.matrix (replacing latex commands for display here)

dot.matrix( crabs)
 sp sex ...   CW   BD
1B   M ...   197
2B   M ... 20.8  7.4
..   .  . ..
199  O   F ... 48.7 19.8
200  O   F ... 52.5 21.1


 foo(crabs)
 sp  sex index FL RW CL CW BD
 1   B M  1   8.1  6.7 16.1 19.0  7.0
 2   B M  2   8.8  7.7 18.1 20.8  7.4
 3   B M  3   9.2  7.8 19.0 22.4  7.7
 .   . . .   .....
 .   . . .   .....
 200 O F 50  23.1 20.2 46.2 52.5 21.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
and provide commented, minimal, self-contained, reproducible code.


Re: [R] R vs Matlab {Re: R in Industry}

2007-02-08 Thread Manuel Morales
On Thu, 2007-02-08 at 16:53 +0100, Martin Maechler wrote:
  Albr == Albrecht, Dr Stefan (AZ Private Equity Partner) [EMAIL 
  PROTECTED]
  on Thu, 8 Feb 2007 16:38:18 +0100 writes:
snip 
 Albr And, I was very astonished to realise, Matlab is very, very much 
 faster
 Albr with simple for loops, which would speed up simulations 
 considerably.
 Can you give some evidence for this statement, please?
 
 At the moment, I'd bet that you use forgot to pre-allocate a
 result array in R and do something like the notorious horrible (:-)
 1-dimensional
 
   r - NULL
   for(i in 1:1) {
   r[i] - verycomplicatedsimulation(i)
   }
 
 instead of the correct
 
   r - numeric(1)
   for(i in 1:1) {
   r[i] - verycomplicatedsimulation(i)
   }

Would a similar speed issue arise for the construction:
r - vector()
...

-- 
Manuel A. Morales
http://mutualism.williams.edu
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Defining functions in separate file...

2007-02-08 Thread Martin Percossi
Hello, is it possible to define functions in a file, say, myfunctions.R, 
and import them into R -- into the top-level namespace? I've seen in the 
documentation that you can create packages, but this seems very 
heavy-duty, as it requires me to createa subdirectory, and various other 
files.

TIA
Martin

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] remove component from list or data frame

2007-02-08 Thread Jason Horn
Sorry to ask such a simple question, but I can't find the answer after 
extensive searching the docs and the web.

How do you remove a component from a list?  For example say you have:

lst-c(5,6,7,8,9)

How do you remove, for example, the third component in the list?

lst[[3]]]-NULL generates an error:  Error: more elements supplied 
than there are to replace



Also, how do you remove a row from a data frame?  For example, say you 
have:

lst1-c(1,2,3,4,5)
lst2-c(6,7,8,9,10)
frame-data.frame(lst1,lst2)

How do you remove, for example, the second row of frame?

Thanks,

- Jason

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] R in Industry

2007-02-08 Thread Stefan Grosse
I just ran on my Windows PC the benchmark from
http://www.sciviews.org/benchmark/index.html which is pretty old now.
Thats probably the reason for the errors which I did not correct. As
you see R has some advantages but Matlab has also some advantages.
However the differences are not to big. There is only one big
difference which indeed includes loops (Creation of a 220x220 Toeplitz
matrix) where Matlab is much faster. But maybe a simple change in the
programmation can change that...

Has someone in the list an updated script?

Stefan Grosse

The benchmarks:

R 2.4.1
   R Benchmark 2.3
   ===

   I. Matrix calculation

   -
Creation, transp., deformation of a 1500x1500 matrix (sec):
0.865
800x800 normal distributed random matrix ^1000__ (sec):
0.136
Sorting of 2,000,000 random values__ (sec):
0.615
700x700 cross-product matrix (b = a' * a)___ (sec):
0.557
Linear regression over a 600x600 matrix (c = a \ b') (sec):  0 #ERROR


   II. Matrix functions
   
FFT over 800,000 random values__ (sec):
0.557
Eigenvalues of a 320x320 random matrix__ (sec):
0.495
Determinant of a 650x650 random matrix__ (sec):
0.276
Cholesky decomposition of a 900x900 matrix__ (sec):  0 #ERROR
Inverse of a 400x400 random matrix__ (sec):  0 #ERROR

   III. Programmation
   --
750,000 Fibonacci numbers calculation (vector calc)_ (sec):
0.469
Creation of a 2250x2250 Hilbert matrix (matrix calc) (sec):
1.016667
Grand common divisors of 70,000 pairs (recursion)___ (sec):
0.3966671
Creation of a 220x220 Toeplitz matrix (loops)___ (sec):
0.552
Escoufier's method on a 37x37 matrix (mixed) (sec):
2.66

  --- End of test ---

Matlab 7.0.4

  Matlab Benchmark 2
   ==
Number of times each test is run__: 3
 
   I. Matrix calculation
   -
Creation, transp., deformation of a 1500x1500 matrix (sec): 0.29047
800x800 normal distributed random matrix ^1000__ (sec): 0.42967
Sorting of 2,000,000 random values__ (sec): 0.71432
700x700 cross-product matrix (b = a' * a)___ (sec): 0.14748
Linear regression over a 600x600 matrix (c = a \ b') (sec): 0.12831
  --
Trimmed geom. mean (2 extremes eliminated): 0.26403
 
   II. Matrix functions
   
FFT over 800,000 random values__ (sec): 0.24591
Eigenvalues of a 320x320 random matrix__ (sec): 0.38507
Determinant of a 650x650 random matrix__ (sec): 0.091612
Cholesky decomposition of a 900x900 matrix__ (sec): 0.11059
Inverse of a 400x400 random matrix__ (sec): 0.069414
  --
Trimmed geom. mean (2 extremes eliminated): 0.13556
 
   III. Programmation
   --
750,000 Fibonacci numbers calculation (vector calc)_ (sec): 1.2386
Creation of a 2250x2250 Hilbert matrix (matrix calc) (sec): 3.0541
Grand common divisors of 70,000 pairs (recursion)___ (sec): 1.7637
Creation of a 220x220 Toeplitz matrix (loops)___ (sec): 0.0045972
Escoufier's method on a 37x37 matrix (mixed) (sec): 0.50481
  --
Trimmed geom. mean (2 extremes eliminated): 1.0331
 
 
Total time for all 15 tests_ (sec): 9.1786
Overall mean (sum of I, II and III trimmed means/3)_ (sec): 0.33316
  --- End of test ---

-- 
---
lic. oec. Stefan Grosse

University of Erfurt
Microeconomics
Nordhäuser Str. 63
99089 Erfurt
Germany

phone  +49-361 - 737 45 23
fax+49-361 - 737 45 29
mobile +49-1609- 760 33 01

web http://www.uni-erfurt.de/mikrooekonomie
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
and provide commented, minimal, self-contained, reproducible code.


Re: [R] NEWBIE: @BOOK help?

2007-02-08 Thread Douglas Bates
On 2/8/07, Zembower, Kevin [EMAIL PROTECTED] wrote:
 In Henric's recent post, he included this output:

 @BOOK{R:Harrell:2001,
   AUTHOR = {Frank E. Harrell},
   TITLE = {Regression Modeling Strategies, with Applications to
   Linear Models, Survival Analysis and Logistic
   Regression},
   PUBLISHER = {Springer},
   YEAR = 2001,
   NOTE = {ISBN 0-387-95232-2},
   URL = {http://biostat.mc.vanderbilt.edu/twiki/bin/view/Main/RmS}
 }

 Can someone tell me how this is generated? I've noticed this in a few
 recent posts. I attempted:

I'm not sure what you mean by how this is generated.  The format is
for a bibliographic reference system called BibTeX associated with the
LaTeX text processing language.

Most BibTeX users have built up a reference database by adding the
entries by hand.  Editors like emacs have special modes to facilitate
entering this information.

Searching on the CTAN.org (Comprehensive TeX Archive Network) web site
may give some links to systems that can generate BibTeX reference
databases automatically.  On Linux the tellico bibliographic database
manager can search commercial sites like amazon.com and download
information about specific books from there, then export it in BibTeX
format.  I haven't tried it myself for books so I can't say how well
it works.  I have used it for extracting information on movies from
imdb.com and it does a good job on that.

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] [R-pkgs] new contributed package 'stream.net'

2007-02-08 Thread Denis White
New contributed package 'stream.net' is available on CRAN.

Description:   Functions with example data for creating, importing,
   attributing, analyzing, and displaying stream networks
   represented as binary trees.  Capabilities include
   importing network topology and attributes from GIS data,
   upstream and downstream distance matrices, stochastic
   network generation, segmentation of network into
   reaches, adding attributes to reaches with specified
   statistical distributions, interpolating reach
   attributes from sparse data, analyzing autocorrelation
   of reach attributes, and creating maps with legends of
   attribute data.  Target applications include dynamic
   fish modeling.

Denis White
US EPA
Corvallis, Oregon, USA

___
R-packages mailing list
R-packages@stat.math.ethz.ch
https://stat.ethz.ch/mailman/listinfo/r-packages

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] NEWBIE: @BOOK help?

2007-02-08 Thread Charilaos Skiadas
On Feb 8, 2007, at 11:07 AM, Zembower, Kevin wrote:

 In Henric's recent post, he included this output:

 @BOOK{R:Harrell:2001,
   AUTHOR = {Frank E. Harrell},
   TITLE = {Regression Modeling Strategies, with Applications to
   Linear Models, Survival Analysis and Logistic
   Regression},
   PUBLISHER = {Springer},
   YEAR = 2001,
   NOTE = {ISBN 0-387-95232-2},
   URL = {http://biostat.mc.vanderbilt.edu/twiki/bin/view/Main/RmS}
 }

 Can someone tell me how this is generated? I've noticed this in a few
 recent posts. I attempted:

It is BibTeX:

http://www.bibtex.org/
http://en.wikipedia.org/wiki/BibTeX

Haris

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] R in Industry

2007-02-08 Thread Roland Rau
Hi,

On 2/8/07, Albrecht, Dr. Stefan (AZ Private Equity Partner) 
[EMAIL PROTECTED] wrote:


 I would very much appreciate any comments on my above remarks. I know
 there has been some discussions of R vs. Matlab on R-help, but these
 could be somewhat out-dated, since both languages are evolving quite
 quickly.


If there are many people interested in working with R at your company, I
thought it might be a possibility for you to employ a programmer at your
company who is implementing what you would like to have done (maybe a nice
GUI; awhile ago, I remember there was a master's project at Rice university
to write a compiler for R, ...).
I can see many advantages of such a thing:
- Your company might save money (at least in the mid- and long run, just
have a look at the price of software licences)
- You create a (probably time-limited) job
- The whole community could benefit from those efforts (And it would be
nothing new: I think I read once an interview with Richard Hipp, the creator
of SQLite, who was paid by AOL for a while. Nevertheless, his program is in
the public domain).

Just some ideas I had when I read your email (and heard and read in the past
about licencing issues of other software in the area of statistics).

Best,
Roland

P.S. No, I am neither looking for such a job myself nor do I want to find a
job for someone I know. :-)

[[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
and provide commented, minimal, self-contained, reproducible code.


Re: [R] R in Industry

2007-02-08 Thread Ben Fairbank
To those following this thRead:

There was a thread on this topic a year or so ago on this list, in which
contributors mentioned reasons that corporate powers-that-be were
reluctant to commit to R as a corporate statistical platform.  (My
favorite was There is no one to sue if something goes wrong.)

One reason that I do not think was discussed then, nor have I seen
discussed since, is the issue of the continuity of support.  If one
person has contributed disproportionately heavily to the development and
maintenance of a package, and then retires or follows other interests,
and the package needs maintenance (perhaps as a consequence of new
operating systems or a new version of R), is there any assurance that it
will be available?  With a commercial package such as, say, SPSS, the
corporate memory and continuance makes such continued maintenance
likely, but is there such a commitment with R packages?  If my company
came to depend heavily on a fairly obscure R package (as we are
contemplating doing), what guarantee is there that it will be available
next month/year/decade?  I know of none, nor would I expect one.

As R says when it starts up, R is free software and comes with
ABSOLUTELY NO WARRANTY.

Ben Fairbank


-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Patrick Burns
Sent: Thursday, February 08, 2007 10:24 AM
To: Albrecht,Dr. Stefan (AZ Private Equity Partner)
Cc: r-help@stat.math.ethz.ch
Subject: Re: [R] R in Industry

 From what I know Matlab is much more popular in
fixed income than R, but R is vastly more popular in
equities.  R seems to be making quite a lot of headway
in finance, even in fixed income to some degree.

At least to some extent, this is probably logical behavior --
fixed income is more mathematical, and equities is more
statistical.

Matlab is easier to learn mainly because it has much simpler
data structures.  However, once you are doing something
where a complex data structure is natural, then R is going to
be easier to use and you are likely to have a more complete
implementation of what you want.

If speed becomes a limiting factor, then moving the heavy
computing to C is a natural thing to do, and very easy with R.

Patrick Burns
[EMAIL PROTECTED]
+44 (0)20 8525 0696
http://www.burns-stat.com
(home of S Poetry and A Guide for the Unwilling S User)

Albrecht, Dr. Stefan (AZ Private Equity Partner) wrote:

Dear all,
 
I was reading with great interest your comments about the use of R in
the industry. Personally, I use R as scripting language in the
financial
industry, not so much for its statistical capabilities (which are
great), but more for programming. I once switched from S-Plus to R,
because I liked R more, it had a better and easier to use documentation
and it is faster (especially with loops).
 
Now some colleagues of mine are (finally) eager to join me in my
quantitative efforts, but they feel that they are more at ease with
Matlab. I can understand this. Matlab has a real IDE with symbolic
debugger, integrated editor and profiling, etc. The help files are
great, very comprehensive and coherent. It also could be easier to
learn.
 
And, I was very astonished to realise, Matlab is very, very much faster
with simple for loops, which would speed up simulations considerably.
So I have trouble to argue for a use of R (which I like) instead of
Matlab. The price of Matlab is high, but certainly not prohibitive. R
is
great and free, but maybe less comfortable to use than Matlab.
 
Finally, after all, I have the impression that in many job offerings in
the financial industry R is much less often mentioned than Matlab.
 
I would very much appreciate any comments on my above remarks. I know
there has been some discussions of R vs. Matlab on R-help, but these
could be somewhat out-dated, since both languages are evolving quite
quickly.
 
With many thanks and best regards,
Stefan Albrecht
 
 

   [[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
and provide commented, minimal, self-contained, reproducible code.


  


__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide
http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] R vs Matlab {Re: R in Industry}

2007-02-08 Thread Douglas Bates
On 2/8/07, Manuel Morales [EMAIL PROTECTED] wrote:
 On Thu, 2007-02-08 at 16:53 +0100, Martin Maechler wrote:
   Albr == Albrecht, Dr Stefan (AZ Private Equity Partner) [EMAIL 
   PROTECTED]
   on Thu, 8 Feb 2007 16:38:18 +0100 writes:
 snip
  Albr And, I was very astonished to realise, Matlab is very, very much 
  faster
  Albr with simple for loops, which would speed up simulations 
  considerably.
  Can you give some evidence for this statement, please?
 
  At the moment, I'd bet that you use forgot to pre-allocate a
  result array in R and do something like the notorious horrible (:-)
  1-dimensional
 
r - NULL
for(i in 1:1) {
r[i] - verycomplicatedsimulation(i)
}
 
  instead of the correct
 
r - numeric(1)
for(i in 1:1) {
r[i] - verycomplicatedsimulation(i)
}

 Would a similar speed issue arise for the construction:
 r - vector()
 ...

Why not try it and find out?

(The answer is yes.  As Martin indicated the issue is whether the
space for the entire result is allocated before inserting individual
elements of the result.  It is possible to extend a vector beyond its
current length but doing so involves allocating space for the new
vector, copying the current contents and then inserting the new
values.  Doing that tens of thousands of times is slow and wasteful.)

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Data.frame columns in R console

2007-02-08 Thread Lauri Nikkinen
Hi R-users,



A newbie question: assume that I have for example 30 columns in my
data.frame named DF. When I print DF in R console I get columns that don't
fit on the same row underneath each other. So how do I change the R console
preferences so that the console does not wrap my data.frame columns? I want
the columns to be printed next to each other, as in a normal table.



Cheers,

Lauri

[[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
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Defining functions in separate file...

2007-02-08 Thread Csardi Gabor
See ?source and also the list archive, this is a quite frequently asked 
question.

Gabor

On Thu, Feb 08, 2007 at 05:00:55PM +, Martin Percossi wrote:
 Hello, is it possible to define functions in a file, say, myfunctions.R, 
 and import them into R -- into the top-level namespace? I've seen in the 
 documentation that you can create packages, but this seems very 
 heavy-duty, as it requires me to createa subdirectory, and various other 
 files.
 
 TIA
 Martin
 
 __
 R-help@stat.math.ethz.ch mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.

-- 
Csardi Gabor [EMAIL PROTECTED]MTA RMKI, ELTE TTK

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] remove component from list or data frame

2007-02-08 Thread David Barron
 The first example you provide is a vector, not a list.  You can
remove the third element with:

  lst[-3]
 [1] 5 6 8 9

 The same thing works for rows of data frames:
  frame[-3,]
   lst1 lst2
 116
 227
 449
 55   10




 On 08/02/07, Jason Horn [EMAIL PROTECTED] wrote:
   Sorry to ask such a simple question, but I can't find the answer after
  extensive searching the docs and the web.
 
  How do you remove a component from a list?  For example say you have:
 
  lst-c(5,6,7,8,9)
 
  How do you remove, for example, the third component in the list?
 
  lst[[3]]]-NULL generates an error:  Error: more elements supplied
  than there are to replace
 
 
 
  Also, how do you remove a row from a data frame?  For example, say you
  have:
 
  lst1-c(1,2,3,4,5)
  lst2-c(6,7,8,9,10)
  frame-data.frame(lst1,lst2)
 
  How do you remove, for example, the second row of frame?
 
  Thanks,
 
  - Jason
 
  __
  R-help@stat.math.ethz.ch mailing list
  https://stat.ethz.ch/mailman/listinfo/r-help
  PLEASE do read the posting guide  
  http://www.R-project.org/posting-guide.html
  and provide commented, minimal, self-contained, reproducible code.
 



 --
 =
 David Barron
 Said Business School
 University of Oxford
 Park End Street
 Oxford OX1 1HP



-- 
=
David Barron
Said Business School
University of Oxford
Park End Street
Oxford OX1 1HP

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] NEWBIE: @BOOK help?

2007-02-08 Thread Abhijit Dasgupta
As an addition, JabRef (which is a Java application) can automatically 
download citation information from CiteSeer and PubMed and store it in 
BibTeX format, albeit once you know the appropriate reference number

Douglas Bates wrote:
 On 2/8/07, Zembower, Kevin [EMAIL PROTECTED] wrote:
   
 In Henric's recent post, he included this output:

 @BOOK{R:Harrell:2001,
   AUTHOR = {Frank E. Harrell},
   TITLE = {Regression Modeling Strategies, with Applications to
   Linear Models, Survival Analysis and Logistic
   Regression},
   PUBLISHER = {Springer},
   YEAR = 2001,
   NOTE = {ISBN 0-387-95232-2},
   URL = {http://biostat.mc.vanderbilt.edu/twiki/bin/view/Main/RmS}
 }

 Can someone tell me how this is generated? I've noticed this in a few
 recent posts. I attempted:
 

 I'm not sure what you mean by how this is generated.  The format is
 for a bibliographic reference system called BibTeX associated with the
 LaTeX text processing language.

 Most BibTeX users have built up a reference database by adding the
 entries by hand.  Editors like emacs have special modes to facilitate
 entering this information.

 Searching on the CTAN.org (Comprehensive TeX Archive Network) web site
 may give some links to systems that can generate BibTeX reference
 databases automatically.  On Linux the tellico bibliographic database
 manager can search commercial sites like amazon.com and download
 information about specific books from there, then export it in BibTeX
 format.  I haven't tried it myself for books so I can't say how well
 it works.  I have used it for extracting information on movies from
 imdb.com and it does a good job on that.

 __
 R-help@stat.math.ethz.ch mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.


__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] remove component from list or data frame

2007-02-08 Thread Sarah Goslee
Hi Jason,

On 2/8/07, Jason Horn [EMAIL PROTECTED] wrote:
 Sorry to ask such a simple question, but I can't find the answer after
 extensive searching the docs and the web.

 How do you remove a component from a list?  For example say you have:


You use the - operator for both your vector and data frame
examples.

 lst - c(5,6,7,8,9)
# which by the way isn't a list
 is.list(lst)
[1] FALSE
 lst
[1] 5 6 7 8 9
 lst - lst[-3]
 lst
[1] 5 6 8 9

 lst1-c(1,2,3,4,5)
 lst2-c(6,7,8,9,10)
 frame-data.frame(lst1,lst2)
 frame
  lst1 lst2
116
227
338
449
55   10
 frame[-2,]
  lst1 lst2
116
338
449
55   10


-- 
Sarah Goslee
http://www.functionaldiversity.org

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] remove component from list or data frame

2007-02-08 Thread Henrique Dallazuanna
First:
lst - lst[-3]

Second:
frame- frame[-2,]

On 08/02/07, Jason Horn [EMAIL PROTECTED] wrote:

 Sorry to ask such a simple question, but I can't find the answer after
 extensive searching the docs and the web.

 How do you remove a component from a list?  For example say you have:

 lst-c(5,6,7,8,9)

 How do you remove, for example, the third component in the list?

 lst[[3]]]-NULL generates an error:  Error: more elements supplied
 than there are to replace



 Also, how do you remove a row from a data frame?  For example, say you
 have:

 lst1-c(1,2,3,4,5)
 lst2-c(6,7,8,9,10)
 frame-data.frame(lst1,lst2)

 How do you remove, for example, the second row of frame?

 Thanks,

 - Jason

 __
 R-help@stat.math.ethz.ch mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide
 http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.




-- 
Henrique Dallazuanna
Curitiba-Paraná
Brasil

[[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
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Defining functions in separate file...

2007-02-08 Thread Abhijit Dasgupta
Look at

help(.First)

Martin Percossi wrote:
 Hello, is it possible to define functions in a file, say, myfunctions.R, 
 and import them into R -- into the top-level namespace? I've seen in the 
 documentation that you can create packages, but this seems very 
 heavy-duty, as it requires me to createa subdirectory, and various other 
 files.

 TIA
 Martin

 __
 R-help@stat.math.ethz.ch mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.


__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] remove component from list or data frame

2007-02-08 Thread Duncan Murdoch
On 2/8/2007 12:30 PM, Jason Horn wrote:
 Sorry to ask such a simple question, but I can't find the answer after 
 extensive searching the docs and the web.
 
 How do you remove a component from a list?  For example say you have:
 
 lst-c(5,6,7,8,9)

In R jargon, that's a vector, not a list.
 
 How do you remove, for example, the third component in the list?

lst[-3] will do it.

 
 lst[[3]]]-NULL generates an error:  Error: more elements supplied 
 than there are to replace

The [[ index ]] syntax only works on true lists.
 
 
 
 Also, how do you remove a row from a data frame?  For example, say you 
 have:
 
 lst1-c(1,2,3,4,5)
 lst2-c(6,7,8,9,10)
 frame-data.frame(lst1,lst2)
 
 How do you remove, for example, the second row of frame?

Same idea:

frame - frame[-2, ]

Duncan Murdoch
 
 Thanks,
 
 - Jason
 
 __
 R-help@stat.math.ethz.ch mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] remove component from list or data frame

2007-02-08 Thread Erik Iverson


Jason Horn wrote:
 Sorry to ask such a simple question, but I can't find the answer after 
 extensive searching the docs and the web.
 
 How do you remove a component from a list?  For example say you have:
 
 lst-c(5,6,7,8,9)
 
 How do you remove, for example, the third component in the list?

Is the object lst really a list?  Try is.list(lst) to check.
To remove an element from a vector, use for example, lst[-3]

 
 lst[[3]]]-NULL generates an error:  Error: more elements supplied 
 than there are to replace
 
 

If lst were actually a list, that command would work with the obvious 
syntax fix.  So would lst[-3] though.

 
 Also, how do you remove a row from a data frame?  For example, say you 
 have:
 
 lst1-c(1,2,3,4,5)
 lst2-c(6,7,8,9,10)
 frame-data.frame(lst1,lst2)
 
 How do you remove, for example, the second row of frame?

You use

frame[-2, ] #remove second row, keep all columns.

 
 Thanks,
 
 - Jason
 
 __
 R-help@stat.math.ethz.ch mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] multinomial logistic regression with equality constraints?

2007-02-08 Thread Roger Levy
Walter Mebane wrote:
 Roger,
 
   Error in if (logliklambda  loglik) bvec - blambda :
  missing value where TRUE/FALSE needed
   In addition: Warning message:
   NaNs produced in: sqrt(sigma2GN)
 
 That message comes from the Newton algorithm (defined in source file
 multinomMLE.R).  It would be better if we bullet-proofed it a bit
 more.  The first thing is to check the data.  I don't have the
 multinomLogis() function, so I can't run your code.  

Whoops, sorry about that -- I'm putting revised code at the end of the 
message.

 But do you really
 mean
 
   for(i in 1:length(choice)) {
 and
   dim(counts) - c(length(choice),length(choice))
 
 Should that be
 
   for(i in 1:n) {
 and
   dim(counts) - c(n, length(choice))
 
 or instead of n, some number m  length(choice).  As it is it seems to
 me you have three observations for three categories, which isn't going
 to work (there are five coefficient parameters, plus sigma for the
 dispersion).

I really did mean for(i in 1:length(choice)) -- once again, the proper 
code is at the end of this message.

Also, I notice that I get the same error with another kind of data, 
which works for multinom from nnet:


library(nnet)
library(multinomRob)
dtf - data.frame(y1=c(1,1),y2=c(2,1),y3=c(1,2),x=c(0,1))
summary(multinom(as.matrix(dtf[,1:3]) ~ x, data=dtf))
summary(multinomRob(list(y1 ~ 0, y2 ~ x, y3 ~ x), data=dtf,print.level=128))


The call to multinom fits the following coefficients:

Coefficients:
 (Intercept)  x
y2 0.6933809622 -0.6936052
y3 0.0001928603  0.6928327

but the call to multinomRob gives me the following error:

multinomRob(): Grouped MNL Estimation
[1] multinomMLE: -loglik initial: 9.48247391895106
Error in if (logliklambda  loglik) bvec - blambda :
missing value where TRUE/FALSE needed
In addition: Warning message:
NaNs produced in: sqrt(sigma2GN)


Does this shed any light on things?


Thanks again,

Roger





***

set.seed(10)
library(multinomRob)
multinomLogis - function(vector) {
   x - exp(vector)
   z - sum(x)
   x/z
}

n - 20
choice - c(A,B,C)
intercepts - c(0.5,0.3,0.2)
prime.strength - rep(0.4,length(intercepts))
counts - c()
for(i in 1:length(choice)) {
   u - intercepts[1:length(choice)]
   u[i] - u[i] + prime.strength[i]
   counts - c(counts,rmultinomial(n = n, pr = multinomLogis(u)))
}
dim(counts) - c(length(choice),length(choice))
counts - t(counts)
row.names(counts) - choice
colnames(counts) - choice
data - data.frame(Prev.Choice=choice,counts)

for(i in 1:length(choice)) {
   data[[paste(last,choice[i],sep=.)]] - 
ifelse(data$Prev.Choice==choice[i],1,0)
}

multinomRob(list(A ~ last.A ,
  B ~ last.B ,
  C ~ last.C - 1 ,
  ),
 data=data,
 print.level=128)



I obtained this output:


Your Model (xvec):
A B C
(Intercept)/(Intercept)/last.C 1 1 1
last.A/last.B/NA   1 1 0

[1] multinomRob:  WARNING.  Limited regressor variation...
[1] WARNING.  ... A regressor has a distinct value for only one 
observation.
[1] WARNING.  ... I'm using a modified estimation algorithm (i.e., 
preventing LQD
[1] WARNING.  ... from modifying starting values for the affected 
parameters).
[1] WARNING.  ... Affected parameters are TRUE in the following table.

A B C
(Intercept)/(Intercept)/last.C FALSE FALSE  TRUE
last.A/last.B/NATRUE  TRUE FALSE



multinomRob(): Grouped MNL Estimation
[1] multinomMLE: -loglik initial: 70.2764843511374
Error in if (logliklambda  loglik) bvec - blambda :
missing value where TRUE/FALSE needed
In addition: Warning message:
NaNs produced in: sqrt(sigma2GN)

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] R in Industry

2007-02-08 Thread Duncan Murdoch
On 2/8/2007 12:48 PM, Ben Fairbank wrote:
 To those following this thRead:
 
 There was a thread on this topic a year or so ago on this list, in which
 contributors mentioned reasons that corporate powers-that-be were
 reluctant to commit to R as a corporate statistical platform.  (My
 favorite was There is no one to sue if something goes wrong.)
 
 One reason that I do not think was discussed then, nor have I seen
 discussed since, is the issue of the continuity of support.  If one
 person has contributed disproportionately heavily to the development and
 maintenance of a package, and then retires or follows other interests,
 and the package needs maintenance (perhaps as a consequence of new
 operating systems or a new version of R), is there any assurance that it
 will be available?  With a commercial package such as, say, SPSS, the
 corporate memory and continuance makes such continued maintenance
 likely, but is there such a commitment with R packages?  If my company
 came to depend heavily on a fairly obscure R package (as we are
 contemplating doing), what guarantee is there that it will be available
 next month/year/decade?  I know of none, nor would I expect one.

There's no guarantee of support, but the majority of R packages are 
licensed under the GPL, so there is a guarantee of availability of the 
source code, which means that contracting with someone expert in the 
field to provide you with support will be a possibility.  If it's an 
obscure package as you say, your company may represent a majority of 
users, and it may well be that the expert you need is already someone in 
your company, who contributed patches to the package while the original 
maintainer was still active.

If a commercial vendor were to withdraw support for a package there is 
really no hope of putting together your own support service.  You would 
have to live with the bugs and without updates, or start from scratch to 
replace it yourself.  For example, this happened to me about 10 years 
ago when Intel withdrew support for 3DR.  As it happens OpenGL is a 
better replacement, but I wasn't too happy at the time.

Duncan Murdoch

 
 As R says when it starts up, R is free software and comes with
 ABSOLUTELY NO WARRANTY.
 
 Ben Fairbank
 
 
 -Original Message-
 From: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED] On Behalf Of Patrick Burns
 Sent: Thursday, February 08, 2007 10:24 AM
 To: Albrecht,Dr. Stefan (AZ Private Equity Partner)
 Cc: r-help@stat.math.ethz.ch
 Subject: Re: [R] R in Industry
 
  From what I know Matlab is much more popular in
 fixed income than R, but R is vastly more popular in
 equities.  R seems to be making quite a lot of headway
 in finance, even in fixed income to some degree.
 
 At least to some extent, this is probably logical behavior --
 fixed income is more mathematical, and equities is more
 statistical.
 
 Matlab is easier to learn mainly because it has much simpler
 data structures.  However, once you are doing something
 where a complex data structure is natural, then R is going to
 be easier to use and you are likely to have a more complete
 implementation of what you want.
 
 If speed becomes a limiting factor, then moving the heavy
 computing to C is a natural thing to do, and very easy with R.
 
 Patrick Burns
 [EMAIL PROTECTED]
 +44 (0)20 8525 0696
 http://www.burns-stat.com
 (home of S Poetry and A Guide for the Unwilling S User)
 
 Albrecht, Dr. Stefan (AZ Private Equity Partner) wrote:
 
Dear all,
 
I was reading with great interest your comments about the use of R in
the industry. Personally, I use R as scripting language in the
 financial
industry, not so much for its statistical capabilities (which are
great), but more for programming. I once switched from S-Plus to R,
because I liked R more, it had a better and easier to use documentation
and it is faster (especially with loops).
 
Now some colleagues of mine are (finally) eager to join me in my
quantitative efforts, but they feel that they are more at ease with
Matlab. I can understand this. Matlab has a real IDE with symbolic
debugger, integrated editor and profiling, etc. The help files are
great, very comprehensive and coherent. It also could be easier to
learn.
 
And, I was very astonished to realise, Matlab is very, very much faster
with simple for loops, which would speed up simulations considerably.
So I have trouble to argue for a use of R (which I like) instead of
Matlab. The price of Matlab is high, but certainly not prohibitive. R
 is
great and free, but maybe less comfortable to use than Matlab.
 
Finally, after all, I have the impression that in many job offerings in
the financial industry R is much less often mentioned than Matlab.
 
I would very much appreciate any comments on my above remarks. I know
there has been some discussions of R vs. Matlab on R-help, but these
could be somewhat out-dated, since both languages are evolving quite
quickly.
 
With many thanks and best regards,
Stefan Albrecht
 
 

   

Re: [R] R in Industry - new SIG

2007-02-08 Thread Kuhn, Max
Martin Maechler called my bluff on this suggestion. I'm now the admin
for the new special interest group for R related job postings:

   https://stat.ethz.ch/mailman/listinfo/r-sig-jobs 

Please send appropriate emails to this list. There are some simple rules
for postings (e.g. no attachments etc).

Max

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Kuhn, Max
Sent: Tuesday, February 06, 2007 5:10 PM
To: Doran, Harold; R-help@stat.math.ethz.ch
Subject: Re: [R] R in Industry

As someone who has (reluctantly) sent job postings to R Help, I think
that a SIG would be a good idea.

Max 

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Doran, Harold
Sent: Tuesday, February 06, 2007 2:08 PM
To: R-help@stat.math.ethz.ch
Subject: [R] R in Industry

The other day, CNN had a story on working at Google. Out of curiosity, I
went to the Google employment web site (I'm not looking, but just
curious). In perusing their job posts for statisticians, preference is
given to those who use R and python. Other languages, S-Plus and
something called SAS were listed as lower priorities.

When I started using Python, I noted they have a portion of the web site
with job postings. CRAN does not have something similar, but think it
might be useful. I think R is becoming more widely used in industry and
I wonder if helping it move along a bit, the maintainer of CRAN could
create a section of the web site devoted to jobs where R is a
requirement.

Hence, we could have our own little monster.com kind of thing going
on. Of the multitude of ways the gospel can be spread, this is small.
But, I think every small step forward is good.

Anyone think this is useful? 

Harold


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

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Point estimate from loess contour plot

2007-02-08 Thread Laura Quinn
Hi,

I was wondering if anyone knows of a way by which one can estimate values
from a contour plot created by using the loess function? I am hoping to
use the loess contour plot as a means of interpolation to identify
the loess created values at points at pre-defined (x,y) locations.

Could anyone point me in the right direction please?

Thanks.

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
and provide commented, minimal, self-contained, reproducible code.


Re: [R] R in Industry

2007-02-08 Thread Charilaos Skiadas
On Feb 8, 2007, at 12:48 PM, Ben Fairbank wrote:
  If my company
 came to depend heavily on a fairly obscure R package (as we are
 contemplating doing), what guarantee is there that it will be  
 available
 next month/year/decade?  I know of none, nor would I expect one.

I would imagine that if there was a package that really needed  
updating, then your company could hire an R programmer for a short  
time to fix whatever needs fixing, and that would be a much smaller  
expense than licensing an expensive package like those other ones out  
there.

But perhaps I am completely wrong in this, I am relatively far from  
the industry world.

Haris

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] R in Industry

2007-02-08 Thread Joe Byers
Ben Fairbank wrote:
 To those following this thRead:
 
 There was a thread on this topic a year or so ago on this list, in which
 contributors mentioned reasons that corporate powers-that-be were
 reluctant to commit to R as a corporate statistical platform.  (My
 favorite was There is no one to sue if something goes wrong.)
 
 One reason that I do not think was discussed then, nor have I seen
 discussed since, is the issue of the continuity of support.  If one
 person has contributed disproportionately heavily to the development and
 maintenance of a package, and then retires or follows other interests,
 and the package needs maintenance (perhaps as a consequence of new
 operating systems or a new version of R), is there any assurance that it
 will be available?  With a commercial package such as, say, SPSS, the
 corporate memory and continuance makes such continued maintenance
 likely, but is there such a commitment with R packages?  If my company
 came to depend heavily on a fairly obscure R package (as we are
 contemplating doing), what guarantee is there that it will be available
 next month/year/decade?  I know of none, nor would I expect one.
 
I would add that if you find a package that performs for your company, 
you have done a couple of things.  One reviewed and benchmarked the 
packages results against others or at least makes sure it passes a 
reasonable economic test.  If this is not done, one is assuming the 
BLACK BOX is always correct.  A sin for many quants.

Over time the requirements of the company will change so some 
modifications will be requested from the lead developer or performed in 
house.  This will lead to a level of expertise in the package that new 
developers or maintainers can keep the continuity of the package going 
long after the lead developer retires.  Especially if the company is 
willing to allocate some resources to this endeavor in leiu of license fees.

For example, recently several of us needed the package RMYsql recompiled 
for windows xp.  We went through the mailing list items related to 
RmySQL for windows, built the binary zip file, and have posted it in 
several places.  We needed the package functionality and took care of 
the problem.  Total time was about 1 day for initial discovery and 
research and now about 30 minutes for upgrading the RmySQL for windows 
after a new version for linux is released.

 As R says when it starts up, R is free software and comes with
 ABSOLUTELY NO WARRANTY.
 
 Ben Fairbank
 
 
 -Original Message-
 From: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED] On Behalf Of Patrick Burns
 Sent: Thursday, February 08, 2007 10:24 AM
 To: Albrecht,Dr. Stefan (AZ Private Equity Partner)
 Cc: r-help@stat.math.ethz.ch
 Subject: Re: [R] R in Industry
 
  From what I know Matlab is much more popular in
 fixed income than R, but R is vastly more popular in
 equities.  R seems to be making quite a lot of headway
 in finance, even in fixed income to some degree.
 
 At least to some extent, this is probably logical behavior --
 fixed income is more mathematical, and equities is more
 statistical.
 
 Matlab is easier to learn mainly because it has much simpler
 data structures.  However, once you are doing something
 where a complex data structure is natural, then R is going to
 be easier to use and you are likely to have a more complete
 implementation of what you want.
 
 If speed becomes a limiting factor, then moving the heavy
 computing to C is a natural thing to do, and very easy with R.
 
 Patrick Burns
 [EMAIL PROTECTED]
 +44 (0)20 8525 0696
 http://www.burns-stat.com
 (home of S Poetry and A Guide for the Unwilling S User)
 
 Albrecht, Dr. Stefan (AZ Private Equity Partner) wrote:
 
 Dear all,

 I was reading with great interest your comments about the use of R in
 the industry. Personally, I use R as scripting language in the
 financial
 industry, not so much for its statistical capabilities (which are
 great), but more for programming. I once switched from S-Plus to R,
 because I liked R more, it had a better and easier to use documentation
 and it is faster (especially with loops).

 Now some colleagues of mine are (finally) eager to join me in my
 quantitative efforts, but they feel that they are more at ease with
 Matlab. I can understand this. Matlab has a real IDE with symbolic
 debugger, integrated editor and profiling, etc. The help files are
 great, very comprehensive and coherent. It also could be easier to
 learn.

 And, I was very astonished to realise, Matlab is very, very much faster
 with simple for loops, which would speed up simulations considerably.
 So I have trouble to argue for a use of R (which I like) instead of
 Matlab. The price of Matlab is high, but certainly not prohibitive. R
 is
 great and free, but maybe less comfortable to use than Matlab.

 Finally, after all, I have the impression that in many job offerings in
 the financial industry R is much less often mentioned than Matlab.

 I would very much 

Re: [R] R in Industry

2007-02-08 Thread Erik Iverson
Ben -

Ben Fairbank wrote:
 To those following this thRead:
 
 There was a thread on this topic a year or so ago on this list, in which
 contributors mentioned reasons that corporate powers-that-be were
 reluctant to commit to R as a corporate statistical platform.  (My
 favorite was There is no one to sue if something goes wrong.)
 
 One reason that I do not think was discussed then, nor have I seen
 discussed since, is the issue of the continuity of support.  If one
 person has contributed disproportionately heavily to the development and
 maintenance of a package, and then retires or follows other interests,
 and the package needs maintenance (perhaps as a consequence of new
 operating systems or a new version of R), is there any assurance that it
 will be available?  With a commercial package such as, say, SPSS, the
 corporate memory and continuance makes such continued maintenance
 likely, but is there such a commitment with R packages?  If my company
 came to depend heavily on a fairly obscure R package (as we are
 contemplating doing), what guarantee is there that it will be available
 next month/year/decade?  I know of none, nor would I expect one.

But you would have the source code, so as long as someone knew R, you 
could maintain it, expand it, customize it, patch it yourselves, even if 
the original maintainer left the project.  You can't say the same with a 
commercial package likely.


 
 As R says when it starts up, R is free software and comes with
 ABSOLUTELY NO WARRANTY.
 
 Ben Fairbank
 
 
 -Original Message-
 From: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED] On Behalf Of Patrick Burns
 Sent: Thursday, February 08, 2007 10:24 AM
 To: Albrecht,Dr. Stefan (AZ Private Equity Partner)
 Cc: r-help@stat.math.ethz.ch
 Subject: Re: [R] R in Industry
 
  From what I know Matlab is much more popular in
 fixed income than R, but R is vastly more popular in
 equities.  R seems to be making quite a lot of headway
 in finance, even in fixed income to some degree.
 
 At least to some extent, this is probably logical behavior --
 fixed income is more mathematical, and equities is more
 statistical.
 
 Matlab is easier to learn mainly because it has much simpler
 data structures.  However, once you are doing something
 where a complex data structure is natural, then R is going to
 be easier to use and you are likely to have a more complete
 implementation of what you want.
 
 If speed becomes a limiting factor, then moving the heavy
 computing to C is a natural thing to do, and very easy with R.
 
 Patrick Burns
 [EMAIL PROTECTED]
 +44 (0)20 8525 0696
 http://www.burns-stat.com
 (home of S Poetry and A Guide for the Unwilling S User)
 
 Albrecht, Dr. Stefan (AZ Private Equity Partner) wrote:
 
 
Dear all,

I was reading with great interest your comments about the use of R in
the industry. Personally, I use R as scripting language in the
 
 financial
 
industry, not so much for its statistical capabilities (which are
great), but more for programming. I once switched from S-Plus to R,
because I liked R more, it had a better and easier to use documentation
and it is faster (especially with loops).

Now some colleagues of mine are (finally) eager to join me in my
quantitative efforts, but they feel that they are more at ease with
Matlab. I can understand this. Matlab has a real IDE with symbolic
debugger, integrated editor and profiling, etc. The help files are
great, very comprehensive and coherent. It also could be easier to
learn.

And, I was very astonished to realise, Matlab is very, very much faster
with simple for loops, which would speed up simulations considerably.
So I have trouble to argue for a use of R (which I like) instead of
Matlab. The price of Matlab is high, but certainly not prohibitive. R
 
 is
 
great and free, but maybe less comfortable to use than Matlab.

Finally, after all, I have the impression that in many job offerings in
the financial industry R is much less often mentioned than Matlab.

I would very much appreciate any comments on my above remarks. I know
there has been some discussions of R vs. Matlab on R-help, but these
could be somewhat out-dated, since both languages are evolving quite
quickly.

With many thanks and best regards,
Stefan Albrecht



  [[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
 
and provide commented, minimal, self-contained, reproducible code.


 

 
 
 __
 R-help@stat.math.ethz.ch mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide
 http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.
 
 __
 R-help@stat.math.ethz.ch mailing list
 

Re: [R] remove component from list or data frame

2007-02-08 Thread Duncan Murdoch
On 2/8/2007 1:09 PM, Duncan Murdoch wrote:
 On 2/8/2007 12:30 PM, Jason Horn wrote:
 Sorry to ask such a simple question, but I can't find the answer after 
 extensive searching the docs and the web.
 
 How do you remove a component from a list?  For example say you have:
 
 lst-c(5,6,7,8,9)
 
 In R jargon, that's a vector, not a list.
 
 How do you remove, for example, the third component in the list?
 
 lst[-3] will do it.
 
 
 lst[[3]]]-NULL generates an error:  Error: more elements supplied 
 than there are to replace
 
 The [[ index ]] syntax only works on true lists.

Sigh.  This is just my wishful thinking.  It works on numeric vectors 
too, sometimes.  Just not here.

Duncan Murdoch

 
 
 
 Also, how do you remove a row from a data frame?  For example, say you 
 have:
 
 lst1-c(1,2,3,4,5)
 lst2-c(6,7,8,9,10)
 frame-data.frame(lst1,lst2)
 
 How do you remove, for example, the second row of frame?
 
 Same idea:
 
 frame - frame[-2, ]
 
 Duncan Murdoch
 
 Thanks,
 
 - Jason
 
 __
 R-help@stat.math.ethz.ch mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.
 
 __
 R-help@stat.math.ethz.ch mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] R in Industry

2007-02-08 Thread Joe Byers
Ben Fairbank wrote:
 To those following this thRead:
 
 There was a thread on this topic a year or so ago on this list, in which
 contributors mentioned reasons that corporate powers-that-be were
 reluctant to commit to R as a corporate statistical platform.  (My
 favorite was There is no one to sue if something goes wrong.)
 
 One reason that I do not think was discussed then, nor have I seen
 discussed since, is the issue of the continuity of support.  If one
 person has contributed disproportionately heavily to the development and
 maintenance of a package, and then retires or follows other interests,
 and the package needs maintenance (perhaps as a consequence of new
 operating systems or a new version of R), is there any assurance that it
 will be available?  With a commercial package such as, say, SPSS, the
 corporate memory and continuance makes such continued maintenance
 likely, but is there such a commitment with R packages?  If my company
 came to depend heavily on a fairly obscure R package (as we are
 contemplating doing), what guarantee is there that it will be available
 next month/year/decade?  I know of none, nor would I expect one.
 
I would add that if you find a package that performs for your company, 
you have done a couple of things.  One reviewed and benchmarked the 
packages results against others or at least makes sure it passes a 
reasonable economic test.  If this is not done, one is assuming the 
BLACK BOX is always correct.  A sin for many quants.

Over time the requirements of the company will change so some 
modifications will be requested from the lead developer or performed in 
house.  This will lead to a level of expertise in the package that new 
developers or maintainers can keep the continuity of the package going 
long after the lead developer retires.  Especially if the company is 
willing to allocate some resources to this endeavor in leiu of license fees.

For example, recently several of us needed the package RMYsql recompiled 
for windows xp.  We went through the mailing list items related to 
RmySQL for windows, built the binary zip file, and have posted it in 
several places.  We needed the package functionality and took care of 
the problem.  Total time was about 1 day for initial discovery and 
research and now about 30 minutes for upgrading the RmySQL for windows 
after a new version for linux is released.

 As R says when it starts up, R is free software and comes with
 ABSOLUTELY NO WARRANTY.
 
 Ben Fairbank
 
 
 -Original Message-
 From: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED] On Behalf Of Patrick Burns
 Sent: Thursday, February 08, 2007 10:24 AM
 To: Albrecht,Dr. Stefan (AZ Private Equity Partner)
 Cc: r-help@stat.math.ethz.ch
 Subject: Re: [R] R in Industry
 
  From what I know Matlab is much more popular in
 fixed income than R, but R is vastly more popular in
 equities.  R seems to be making quite a lot of headway
 in finance, even in fixed income to some degree.
 
 At least to some extent, this is probably logical behavior --
 fixed income is more mathematical, and equities is more
 statistical.
 
 Matlab is easier to learn mainly because it has much simpler
 data structures.  However, once you are doing something
 where a complex data structure is natural, then R is going to
 be easier to use and you are likely to have a more complete
 implementation of what you want.
 
 If speed becomes a limiting factor, then moving the heavy
 computing to C is a natural thing to do, and very easy with R.
 
 Patrick Burns
 [EMAIL PROTECTED]
 +44 (0)20 8525 0696
 http://www.burns-stat.com
 (home of S Poetry and A Guide for the Unwilling S User)
 
 Albrecht, Dr. Stefan (AZ Private Equity Partner) wrote:
 
 Dear all,

 I was reading with great interest your comments about the use of R in
 the industry. Personally, I use R as scripting language in the
 financial
 industry, not so much for its statistical capabilities (which are
 great), but more for programming. I once switched from S-Plus to R,
 because I liked R more, it had a better and easier to use documentation
 and it is faster (especially with loops).

 Now some colleagues of mine are (finally) eager to join me in my
 quantitative efforts, but they feel that they are more at ease with
 Matlab. I can understand this. Matlab has a real IDE with symbolic
 debugger, integrated editor and profiling, etc. The help files are
 great, very comprehensive and coherent. It also could be easier to
 learn.

 And, I was very astonished to realise, Matlab is very, very much faster
 with simple for loops, which would speed up simulations considerably.
 So I have trouble to argue for a use of R (which I like) instead of
 Matlab. The price of Matlab is high, but certainly not prohibitive. R
 is
 great and free, but maybe less comfortable to use than Matlab.

 Finally, after all, I have the impression that in many job offerings in
 the financial industry R is much less often mentioned than Matlab.

 I would very much 

Re: [R] R in Industry

2007-02-08 Thread Ravi Varadhan
Here is a function to create a Toeplitz matrix of any size, and an example
of a 220 x 220 toeplitz matrix, which was created in almost no time:


# Given a vector x, forms a Toeplitz matrix
#
toeplitz - function (x, sym=T) {
   if (!is.vector(x)) 
   stop(x is not a vector)
   n - length(x)
   if (!sym) { 
   if (!n%%2) stop(length of vector must be odd)
   n2 - (n+1)/2
   A - matrix(NA, n2, n2)
   mat - matrix(x[col(A) - row(A) + n2], n2, n2)
   }
   else {
   A - matrix(NA, n, n)
   mat - matrix(x[abs(col(A) - row(A)) + 1], n, n)
   }
   mat
}
###

 system.time(top.mat - toeplitz(runif(220)))
[1] 0.00 0.01 0.02   NA   NA

Hope this is fast enough!

Best,
Ravi.


---

Ravi Varadhan, Ph.D.

Assistant Professor, The Center on Aging and Health

Division of Geriatric Medicine and Gerontology 

Johns Hopkins University

Ph: (410) 502-2619

Fax: (410) 614-9625

Email: [EMAIL PROTECTED]

Webpage:  http://www.jhsph.edu/agingandhealth/People/Faculty/Varadhan.html

 




-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Stefan Grosse
Sent: Thursday, February 08, 2007 12:09 PM
To: Albrecht, Dr. Stefan (AZ Private Equity Partner)
Cc: r-help@stat.math.ethz.ch
Subject: Re: [R] R in Industry

I just ran on my Windows PC the benchmark from
http://www.sciviews.org/benchmark/index.html which is pretty old now.
Thats probably the reason for the errors which I did not correct. As
you see R has some advantages but Matlab has also some advantages.
However the differences are not to big. There is only one big
difference which indeed includes loops (Creation of a 220x220 Toeplitz
matrix) where Matlab is much faster. But maybe a simple change in the
programmation can change that...

Has someone in the list an updated script?

Stefan Grosse

The benchmarks:

R 2.4.1
   R Benchmark 2.3
   ===

   I. Matrix calculation

   -
Creation, transp., deformation of a 1500x1500 matrix (sec):
0.865
800x800 normal distributed random matrix ^1000__ (sec):
0.136
Sorting of 2,000,000 random values__ (sec):
0.615
700x700 cross-product matrix (b = a' * a)___ (sec):
0.557
Linear regression over a 600x600 matrix (c = a \ b') (sec):  0 #ERROR


   II. Matrix functions
   
FFT over 800,000 random values__ (sec):
0.557
Eigenvalues of a 320x320 random matrix__ (sec):
0.495
Determinant of a 650x650 random matrix__ (sec):
0.276
Cholesky decomposition of a 900x900 matrix__ (sec):  0 #ERROR
Inverse of a 400x400 random matrix__ (sec):  0 #ERROR

   III. Programmation
   --
750,000 Fibonacci numbers calculation (vector calc)_ (sec):
0.469
Creation of a 2250x2250 Hilbert matrix (matrix calc) (sec):
1.016667
Grand common divisors of 70,000 pairs (recursion)___ (sec):
0.3966671
Creation of a 220x220 Toeplitz matrix (loops)___ (sec):
0.552
Escoufier's method on a 37x37 matrix (mixed) (sec):
2.66

  --- End of test ---

Matlab 7.0.4

  Matlab Benchmark 2
   ==
Number of times each test is run__: 3
 
   I. Matrix calculation
   -
Creation, transp., deformation of a 1500x1500 matrix (sec): 0.29047
800x800 normal distributed random matrix ^1000__ (sec): 0.42967
Sorting of 2,000,000 random values__ (sec): 0.71432
700x700 cross-product matrix (b = a' * a)___ (sec): 0.14748
Linear regression over a 600x600 matrix (c = a \ b') (sec): 0.12831
  --
Trimmed geom. mean (2 extremes eliminated): 0.26403
 
   II. Matrix functions
   
FFT over 800,000 random values__ (sec): 0.24591
Eigenvalues of a 320x320 random matrix__ (sec): 0.38507
Determinant of a 650x650 random matrix__ (sec): 0.091612
Cholesky decomposition of a 900x900 matrix__ (sec): 0.11059
Inverse of a 400x400 random matrix__ (sec): 0.069414
  --
Trimmed geom. mean (2 extremes eliminated): 0.13556
 
   III. Programmation
   --
750,000 Fibonacci numbers calculation (vector calc)_ (sec): 1.2386
Creation of a 2250x2250 Hilbert matrix (matrix calc) (sec): 3.0541
Grand common divisors of 70,000 pairs (recursion)___ (sec): 1.7637
Creation of a 220x220 Toeplitz matrix (loops)___ (sec): 0.0045972
Escoufier's method on a 37x37 matrix 

Re: [R] R in Industry - new SIG

2007-02-08 Thread Jim Porzak
Thanks Max ( Martin)!

I was about to encourage this. Once the head hunters get wind of this,
I expect a lot of activity - hopefully most will be relevant.

Max, I'd be willing to chip in if you need admin help.

-- 
Best,
Jim Porzak
Loyalty Matrix Inc.
San Francisco, CA
http://www.linkedin.com/in/jimporzak


On 2/8/07, Kuhn, Max [EMAIL PROTECTED] wrote:
 Martin Maechler called my bluff on this suggestion. I'm now the admin
 for the new special interest group for R related job postings:

https://stat.ethz.ch/mailman/listinfo/r-sig-jobs

 Please send appropriate emails to this list. There are some simple rules
 for postings (e.g. no attachments etc).

 Max

 -Original Message-
 From: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED] On Behalf Of Kuhn, Max
 Sent: Tuesday, February 06, 2007 5:10 PM
 To: Doran, Harold; R-help@stat.math.ethz.ch
 Subject: Re: [R] R in Industry

 As someone who has (reluctantly) sent job postings to R Help, I think
 that a SIG would be a good idea.

 Max

 -Original Message-
 From: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED] On Behalf Of Doran, Harold
 Sent: Tuesday, February 06, 2007 2:08 PM
 To: R-help@stat.math.ethz.ch
 Subject: [R] R in Industry

 The other day, CNN had a story on working at Google. Out of curiosity, I
 went to the Google employment web site (I'm not looking, but just
 curious). In perusing their job posts for statisticians, preference is
 given to those who use R and python. Other languages, S-Plus and
 something called SAS were listed as lower priorities.

 When I started using Python, I noted they have a portion of the web site
 with job postings. CRAN does not have something similar, but think it
 might be useful. I think R is becoming more widely used in industry and
 I wonder if helping it move along a bit, the maintainer of CRAN could
 create a section of the web site devoted to jobs where R is a
 requirement.

 Hence, we could have our own little monster.com kind of thing going
 on. Of the multitude of ways the gospel can be spread, this is small.
 But, I think every small step forward is good.

 Anyone think this is useful?

 Harold


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

 __
 R-help@stat.math.ethz.ch mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.


__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Impossible to get jpeg or png output

2007-02-08 Thread Prof Brian Ripley
Probably you have no write permission in the current directory.  That 
message means (as it says) that the process cannot open the file for 
writing, and that is not an R issue.


On Thu, 8 Feb 2007, Mahieux Dimitri wrote:


Hi,

When I want to output a png file, I have the following error message :

Error dans X11(paste(jpeg::, quality, :, filename, sep = ), width,  :
   inpossible de démarrer le périphérique JPEG
De plus : Warning message:
impossible d'ouvrir le fichier JPEG 'Test.jpeg'

or in english

Error in X11(paste(jpeg::, quality, :, filename, sep = ), width,  :
   inpossible to start the JPEG peripheral
Warning message:
impossible to open the file JPEG 'Test.jpeg'

I've checked the capabilities which give :

 capabilities()
   jpeg  pngtcltk  X11 http/ftp  sockets   libxml fifo
   TRUE TRUEFALSE TRUE TRUE TRUE TRUE TRUE
 clediticonv  NLS
   TRUE TRUE TRUE

So I don't understand why I can't have a jpeg file ( or png file because
I've the same problem to)

Any Idea ?

Thx 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
and provide commented, minimal, self-contained, reproducible code.



--
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
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Data.frame columns in R console

2007-02-08 Thread Prof Brian Ripley
?options, look for 'width'.

I don't know what OS this in: the Windows Rgui has an option to set the
width to the width of the console, but you can override it.

On Thu, 8 Feb 2007, Lauri Nikkinen wrote:

 Hi R-users,



 A newbie question: assume that I have for example 30 columns in my
 data.frame named DF. When I print DF in R console I get columns that don't
 fit on the same row underneath each other. So how do I change the R console
 preferences so that the console does not wrap my data.frame columns? I want
 the columns to be printed next to each other, as in a normal table.



 Cheers,

 Lauri

   [[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
 and provide commented, minimal, self-contained, reproducible code.


-- 
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
and provide commented, minimal, self-contained, reproducible code.


Re: [R] R in Industry

2007-02-08 Thread Spencer Graves
  As Duncan indicated, I think R wins overwhelmingly  on this point: 

  What should you do if a key software vendor decides to increase 
their license fees beyond reason or obsolete a key product that burdens 
you with excessive transition costs?  Similarly, what do you do if you 
want to migrate a special application from some obscure operating system 
onto Windows or Linux, or you need some enhancements that should be 
minor but your vendor wants an excessive fee for that service?  If they 
see you as the only customer for a certain modification, their fees may 
be reasonable from their perspective. 

  With R, you can get the source code, so adapting it, modifying it, 
etc., should rarely be a problem.  With commercial software, you almost 
never get the source code, and you should consult attorneys before 
attempting to code something required to escape from a vendor whose fee 
structure is becoming prohibitive.  In many situations, just analyzing 
the legal issues could cost you more than paying someone to modify R 
code to support your changing needs. 

  Spencer Graves

Charilaos Skiadas wrote:
 On Feb 8, 2007, at 12:48 PM, Ben Fairbank wrote:
   
  If my company
 came to depend heavily on a fairly obscure R package (as we are
 contemplating doing), what guarantee is there that it will be  
 available
 next month/year/decade?  I know of none, nor would I expect one.
 

 I would imagine that if there was a package that really needed  
 updating, then your company could hire an R programmer for a short  
 time to fix whatever needs fixing, and that would be a much smaller  
 expense than licensing an expensive package like those other ones out  
 there.

 But perhaps I am completely wrong in this, I am relatively far from  
 the industry world.

 Haris

 __
 R-help@stat.math.ethz.ch mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.


__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] R

2007-02-08 Thread magda haggag
Dear Professor,
   
  I am preparing for a Ph.D in semiparametric regression at Cairo university in 
Egypt. Referring to R package KernGPLM, I obtained R version 2.4.1 but I did 
not find package KernGPLM. Please, help me how can I obtain this package. 
Thanks in advance. 
   
   
  Name: Magda Haggag
  E-mail:  [EMAIL PROTECTED]
  Address: 27, Notrdam Desion st., Gleem, Alexandria, Egypt.

 
-
8:00? 8:25? 8:40?  Find a flick in no time

[[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
and provide commented, minimal, self-contained, reproducible code.


[R] loop issues (r.squared)

2007-02-08 Thread andy1983

I would like to compare every column in my matrix with every other column and
get the r-squared. I have been using the following formula and loops:
summary(lm(matrix[,x]~matrix[,y]))$r.squared
where x and y are the looping column numbers

If I have 100 columns (10,000 iterations), the loops give me results in a
reasonable time.
If I try 10,000 columns, the loops take forever even if there is no formula
inside. I am guessing I can vectorize my code so that I could eliminate one
or both loops. Unfortunately, I can't figure out how to.

Any suggestions?

Thanks.
-- 
View this message in context: 
http://www.nabble.com/loop-issues-%28r.squared%29-tf3195843.html#a8873580
Sent from the R help mailing list archive at Nabble.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
and provide commented, minimal, self-contained, reproducible code.


[R] How to protect two jobs running on the same directory at the same time not to corrupt each other results:

2007-02-08 Thread Aldi Kraja
Hi,

I have a large group of jobs, some of them are running on the same 
directory.  All of them in batch mode.
What are the best ways to protect from corrupting the results two or 
more jobs running on the same directory.
One, I would think can be to run each job in a separate directory, 
collect the results and after remove the directories. But I have 
thousands of jobs that will run in parallel and I have placed about 100 
of them in each directory. They all do the same process, but on 
different variables, replications etc.

Is there any other solution better than creating separate directories in 
R? I am thinking if there is any option in R to create a unique id which 
has its own unique .Rdata, although in the same directory?

SAS for example to each batch job it assigns a different ID and a 
separate temp space, and does not mix it with another job running in 
parallel.

Thanks,

Aldi

--

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Scope

2007-02-08 Thread Geoffrey Zhu
Hi all,

When I write a script, I'd like to create a main() function so that I
only need to type main() t re-run it. However, I'd like all the
variables in main() to be global so that when the function terminates, I
still have access to the variables in the environment. Does anyone know
how to do that?

Best regards,
Geoffrey



___=0A=
=0A=
=0A=
The information in this email or in any file attached hereto...{{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
and provide commented, minimal, self-contained, reproducible code.


[R] Help with interfacing C R

2007-02-08 Thread Tim Smith
Hi all,

I was trying to set up an interface for using C functions in R. For this, my R 
file hello2.r is:

-

hello2 - function(n) {
.C(hello, as.integer(n))
}

hello2(3)


and my hello.c file is:

--
#include R.h
void hello(int *n)
{
int i;
for(i=0; i  *n; i++) {
Rprintf(Hello, world!\n);
}
}
---

From my windows command line, I execute:

 R CMD SHLIB hello.c

but I get the error message:
Error: syntax error in R CMD. I am trying to look up information on the web 
page at:  
http://cran.r-project.org/doc/manuals/R-exts.html#dyn_002eload-and-dyn_002eunload

As I understand it, I need to load some files, but I don't understand which 
commands I need to execute to compile  execute my 'hello world' code.

I am running R 2.4.0 on Windows XP machine.

Any help would be highly appreciated.

thanks!

 
-
Food fight? Enjoy some healthy debate

[[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
and provide commented, minimal, self-contained, reproducible code.


Re: [R] NEWBIE: @BOOK help?

2007-02-08 Thread David Scott
On Thu, 8 Feb 2007, Andrew Perrin wrote:

 It's BibTeX source -- used for the BibTeX bibliography management system
 that integrates with LaTeX.

 http://www.ecst.csuchico.edu/~jacobsd/bib/formats/bibtex.html
 http://www.ctan.org


A further point is that mathematically oriented databases including the 
Current Index to Statistics (http://www.statindex.org/CIS/) can output 
bibliographic details in BibTeX format. You can obtain the reference in 
BibTeX form from the database and easily incorporate it into your document 
or private BibTeX database of references.

David Scott


_
David Scott Department of Statistics, Tamaki Campus
The University of Auckland, PB 92019
Auckland 1142,NEW ZEALAND
Phone: +64 9 373 7599 ext 86830 Fax: +64 9 373 7000
Email:  [EMAIL PROTECTED]

Graduate Officer, Department of Statistics

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Running source from Unix line

2007-02-08 Thread Amir Herman

How can I run something like source(filename) from the Unix command line?
Maybe somthing like ./R CMD source(filename) - this does not work.

I need to run an R source code file with a command from the Unix command
line.
assuming that I have R installed on my system.

Thank you all
Amir.

-- 
View this message in context: 
http://www.nabble.com/Running-source-from-Unix-line-tf3196037.html#a8874240
Sent from the R help mailing list archive at Nabble.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
and provide commented, minimal, self-contained, reproducible code.


[R] Running source from Unix line

2007-02-08 Thread Amir Herman

How can I run something like source(filename) from the Unix command line?
Maybe somthing like ./R CMD source(filename) - this does not work.

I need to run an R source code file with a command from the Unix command
line.
assuming that I have R installed on my system.

Thank you all
Amir.

-- 
View this message in context: 
http://www.nabble.com/Running-source-from-Unix-line-tf3196035.html#a8874226
Sent from the R help mailing list archive at Nabble.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
and provide commented, minimal, self-contained, reproducible code.


Re: [R] R [Broadcast]

2007-02-08 Thread Wiener, Matthew
Hi.  The package you are looking for is not a standard package (that is,
one that gets installed automatically with R).

There is documentation available, though.  From cran
(http://cran.r-project.org), go to manuals, look at R Installation and
Administration, particularly Section 6, which talks about installing
packages.

Briefly:
Install.packages(KernGPLM) might work (in unix or windows).  And on
Windows, you can also download a zip file from cran and use Install
package from local zip file in the menu.

Hope this helps.

Regards,

Matt Wiener

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of magda haggag
Sent: Thursday, February 08, 2007 2:55 PM
To: r-help@stat.math.ethz.ch
Subject: [R] R [Broadcast]

Dear Professor,
   
  I am preparing for a Ph.D in semiparametric regression at Cairo
university in Egypt. Referring to R package KernGPLM, I obtained R
version 2.4.1 but I did not find package KernGPLM. Please, help me how
can I obtain this package. Thanks in advance. 
   
   
  Name: Magda Haggag
  E-mail:  [EMAIL PROTECTED]
  Address: 27, Notrdam Desion st., Gleem, Alexandria, Egypt.

 
-
8:00? 8:25? 8:40?  Find a flick in no time

[[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
and provide commented, minimal, self-contained, reproducible code.




--
Notice:  This e-mail message, together with any attachments,...{{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
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Scope

2007-02-08 Thread Gabor Grothendieck
You can assign the environment within main to a variable in
the global environment and that will make it accessible even
after main terminates:

main - function() {
 assign(main.env, environment(), .GlobalEnv)
 x - 1; y - 2
}

main()
main.env$x
main.env$y
# or
attach(main.env)
search()  # note that main.env is on search path
x
y
detach()  # remove from path now that we are finished


Alternately you could assign each variable within main
that you want to save:

main - function() {
 x - 1; y - 2
 assign(x, x, .GlobalEnv)
 assign(y, y, .GlobalEnv)
}

main()
x
y



On 2/8/07, Geoffrey Zhu [EMAIL PROTECTED] wrote:
 Hi all,

 When I write a script, I'd like to create a main() function so that I
 only need to type main() t re-run it. However, I'd like all the
 variables in main() to be global so that when the function terminates, I
 still have access to the variables in the environment. Does anyone know
 how to do that?

 Best regards,
 Geoffrey



 ___=0A=
 =0A=
 =0A=
 The information in this email or in any file attached hereto...{{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
 and provide commented, minimal, self-contained, reproducible code.


__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] loop issues (r.squared)

2007-02-08 Thread Greg Snow
The most straight forward way that I can think of is just:

 cor(my.mat)^2 # assuming my.mat is the matrix with your data in the
columns

That will give you all the R^2 values for regressing 1 column on 1
column (it is called R-squared for a reason).

If you want the R^2 values for regressing one column on all other
columns in the matrix, then a short-cut is:

 1-1/diag(solve(cor(my.mat)))

Both should be much faster than looping, the 2nd may give problems in
trying to invert a very large matrix.

Hope this helps,

-- 
Gregory (Greg) L. Snow Ph.D.
Statistical Data Center
Intermountain Healthcare
[EMAIL PROTECTED]
(801) 408-8111
 
 

 -Original Message-
 From: [EMAIL PROTECTED] 
 [mailto:[EMAIL PROTECTED] On Behalf Of andy1983
 Sent: Thursday, February 08, 2007 1:29 PM
 To: r-help@stat.math.ethz.ch
 Subject: [R] loop issues (r.squared)
 
 
 I would like to compare every column in my matrix with every 
 other column and get the r-squared. I have been using the 
 following formula and loops:
 summary(lm(matrix[,x]~matrix[,y]))$r.squared
 where x and y are the looping column numbers
 
 If I have 100 columns (10,000 iterations), the loops give me 
 results in a reasonable time.
 If I try 10,000 columns, the loops take forever even if there 
 is no formula inside. I am guessing I can vectorize my code 
 so that I could eliminate one or both loops. Unfortunately, I 
 can't figure out how to.
 
 Any suggestions?
 
 Thanks.
 --
 View this message in context: 
 http://www.nabble.com/loop-issues-%28r.squared%29-tf3195843.ht
 ml#a8873580
 Sent from the R help mailing list archive at Nabble.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
 and provide commented, minimal, self-contained, reproducible code.


__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] R in Industry

2007-02-08 Thread AA
I think we began this thread by comparing Matlab to R. In Matlab one has
access to the source code except for some internal functions (There are not
that many). The same thing is valid for Splus. The choice of the programming
language, beside personal preference has a lot to do with the quality and
the number of people using it in the  community. In my own experience Matlab
is very good in signal processing while R is good in statistics and both
benefit from a solid user's community. What I found though is that the
documentation in Matlab is much more user-freindly and practical than R. And
that is important in industry.

Ansel.

On 2/8/07, Duncan Murdoch [EMAIL PROTECTED] wrote:

 On 2/8/2007 12:48 PM, Ben Fairbank wrote:
  To those following this thRead:
 
  There was a thread on this topic a year or so ago on this list, in which
  contributors mentioned reasons that corporate powers-that-be were
  reluctant to commit to R as a corporate statistical platform.  (My
  favorite was There is no one to sue if something goes wrong.)
 
  One reason that I do not think was discussed then, nor have I seen
  discussed since, is the issue of the continuity of support.  If one
  person has contributed disproportionately heavily to the development and
  maintenance of a package, and then retires or follows other interests,
  and the package needs maintenance (perhaps as a consequence of new
  operating systems or a new version of R), is there any assurance that it
  will be available?  With a commercial package such as, say, SPSS, the
  corporate memory and continuance makes such continued maintenance
  likely, but is there such a commitment with R packages?  If my company
  came to depend heavily on a fairly obscure R package (as we are
  contemplating doing), what guarantee is there that it will be available
  next month/year/decade?  I know of none, nor would I expect one.

 There's no guarantee of support, but the majority of R packages are
 licensed under the GPL, so there is a guarantee of availability of the
 source code, which means that contracting with someone expert in the
 field to provide you with support will be a possibility.  If it's an
 obscure package as you say, your company may represent a majority of
 users, and it may well be that the expert you need is already someone in
 your company, who contributed patches to the package while the original
 maintainer was still active.

 If a commercial vendor were to withdraw support for a package there is
 really no hope of putting together your own support service.  You would
 have to live with the bugs and without updates, or start from scratch to
 replace it yourself.  For example, this happened to me about 10 years
 ago when Intel withdrew support for 3DR.  As it happens OpenGL is a
 better replacement, but I wasn't too happy at the time.

 Duncan Murdoch

 
  As R says when it starts up, R is free software and comes with
  ABSOLUTELY NO WARRANTY.
 
  Ben Fairbank
 
 
  -Original Message-
  From: [EMAIL PROTECTED]
  [mailto:[EMAIL PROTECTED] On Behalf Of Patrick Burns
  Sent: Thursday, February 08, 2007 10:24 AM
  To: Albrecht,Dr. Stefan (AZ Private Equity Partner)
  Cc: r-help@stat.math.ethz.ch
  Subject: Re: [R] R in Industry
 
   From what I know Matlab is much more popular in
  fixed income than R, but R is vastly more popular in
  equities.  R seems to be making quite a lot of headway
  in finance, even in fixed income to some degree.
 
  At least to some extent, this is probably logical behavior --
  fixed income is more mathematical, and equities is more
  statistical.
 
  Matlab is easier to learn mainly because it has much simpler
  data structures.  However, once you are doing something
  where a complex data structure is natural, then R is going to
  be easier to use and you are likely to have a more complete
  implementation of what you want.
 
  If speed becomes a limiting factor, then moving the heavy
  computing to C is a natural thing to do, and very easy with R.
 
  Patrick Burns
  [EMAIL PROTECTED]
  +44 (0)20 8525 0696
  http://www.burns-stat.com
  (home of S Poetry and A Guide for the Unwilling S User)
 
  Albrecht, Dr. Stefan (AZ Private Equity Partner) wrote:
 
 Dear all,
 
 I was reading with great interest your comments about the use of R in
 the industry. Personally, I use R as scripting language in the
  financial
 industry, not so much for its statistical capabilities (which are
 great), but more for programming. I once switched from S-Plus to R,
 because I liked R more, it had a better and easier to use documentation
 and it is faster (especially with loops).
 
 Now some colleagues of mine are (finally) eager to join me in my
 quantitative efforts, but they feel that they are more at ease with
 Matlab. I can understand this. Matlab has a real IDE with symbolic
 debugger, integrated editor and profiling, etc. The help files are
 great, very comprehensive and coherent. It also could be easier to
 learn.
 
 And, I was 

Re: [R] R in Industry

2007-02-08 Thread Albrecht, Dr. Stefan (AZ Private Equity Partner)
Dear all,
 
thanks a lot for your comments.
 
You raise several important points. I also think that depending on a certain 
person maintaining a package can be dangerous, since this person might stop 
working on the package. Even if the package is handed over to a second one, the 
other guy may be less skilled and, e.g.. add errors to an excellent package. 
 
I do not think this is a real threat for the often used and mature packages on 
CRAN, but there might be the one or the other exception. Still, you cannot 
blame people doing work for free to the benefit for others, especially, if it 
is of such a high quality. Many thanks to all for their contributions.
 
Having access to the source code is not really a solution, unless you have the 
time to study, maintain and correct it. Normally this is not the case. And do 
not forget that also for commercial packages, like Matlab, you might have 
access to at least a large part of the source code.
 
Another point is that I expect commercial packages to be more coherent and 
concise. The parts should fit better together. In R, e.g.., I use several time 
series packages and classes (and I admire the people having done such 
marvellous jobs): Date, its, zoo. Still one for all would be far better.
 
Hiring a person doing work for us could be a good thing. Only, I do not know 
anyone available and tasks occur on an ongoing basis (and then pop up quite 
quickly, probably a general characteristic of corporate life). In-house 
competence is also and in addition required. Anyway, a sig list on jobs for R 
would be really a good thing.
 
With best regards,
Stefan Albrecht
 

Dr. Stefan Albrecht, CFA
Allianz Private Equity Partners GmbH
Giselastr. 4 | 80802 Munich | Germany

Phone: +49.(0)89.3800.18317
Fax: +49.(0)89.3800.818317
EMail: [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] 
Web: www.apep.com http://www.apep.com/ 


Allianz Private Equity Partners GmbH | Geschäftsführer: Wan Ching Ang 
Sitz der Gesellschaft: München | Registergericht: München HRB 126221 | 
Ust-ID-Nr.: DE 813 264 786

 

[[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
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Running source from Unix line

2007-02-08 Thread Roger Bivand
On Thu, 8 Feb 2007, Amir Herman wrote:

 
 How can I run something like source(filename) from the Unix command line?
 Maybe somthing like ./R CMD source(filename) - this does not work.
 
 I need to run an R source code file with a command from the Unix command
 line.
 assuming that I have R installed on my system.

Appendix B of manual An Introduction to R:

http://cran.r-project.org/doc/manuals/R-intro.html#Invoking-R-from-the-command-line

is helpful, or see ?Startup, or google littler R script. For the time 
being, think echo 'source(filename)' | R [options], or cat filename | R

 
 Thank you all
 Amir.
 
 

-- 
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
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Help with interfacing C R

2007-02-08 Thread Oleg Sklyar
On Windows you need:
  - download and install Cygwin (cygwin.com) with default options,
supposedly you install into c:\cygwin. Add path to
c:\cygwin\bin;c:\cygwin\lib to your system PATH
  - download and unpack Rtools
(http://www.murdoch-sutherland.com/Rtools/tools.zip)
Assuming you have them in C:\Rtools, add c:\RTools\bin
to your PATH _in front of_ cygwin
  - download and install MinGW, you will want to get MinGW-5.1.3.exe,
which will download and install the rest. You will want to select
at least gcc and make. Add the path to c:\MinGW\bin to your system
PATH, right in front of Rtools
(http://sourceforge.net/projects/mingw/)
  - download and install ActivePerl from (activestate.com), ensure path
is added to your PATH

For help files:
  - get MS hhc, comes as part of htmlhelp.exe from here:
http://www.microsoft.com/downloads/details.aspx?FamilyID=00535334-c8a6-452f-9aa0-d597d16580ccDisplayLang=en
this is Microsoft HTML Help Compiler, add path to it to your PATH
  - you might want to consider MikTex, dowload, install, add to path if
you have a package and a help system a should be built

Be sure that when installing R you included sources for compilation! You 
might need to reinstall R. When this done, you can try executing R CMD 
SHLIB or R CMD build --binary if you have a package.

Please refer to Writing R Extensions (CRAN) for complete reference and 
to this guide for step-by-step description:

http://www.ebi.ac.uk/~osklyar/kb/CtoRinterfacingPrimer.pdf

Regards,
Oleg

--
Dr Oleg Sklyar | EBI-EMBL, Cambridge CB10 1SD, UK | +44-1223-494466


Tim Smith wrote:
 Hi all,
 
 I was trying to set up an interface for using C functions in R. For this, my 
 R file hello2.r is:
 
 -
 
 hello2 - function(n) {
 .C(hello, as.integer(n))
 }
 
 hello2(3)
 
 
 and my hello.c file is:
 
 --
 #include R.h
 void hello(int *n)
 {
 int i;
 for(i=0; i  *n; i++) {
 Rprintf(Hello, world!\n);
 }
 }
 ---
 
From my windows command line, I execute:
 
 R CMD SHLIB hello.c
 
 but I get the error message:
 Error: syntax error in R CMD. I am trying to look up information on the web 
 page at:  
 http://cran.r-project.org/doc/manuals/R-exts.html#dyn_002eload-and-dyn_002eunload
 
 As I understand it, I need to load some files, but I don't understand which 
 commands I need to execute to compile  execute my 'hello world' code.
 
 I am running R 2.4.0 on Windows XP machine.
 
 Any help would be highly appreciated.
 
 thanks!
 
  
 -
 Food fight? Enjoy some healthy debate
 
   [[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
 and provide commented, minimal, self-contained, reproducible code.

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] R

2007-02-08 Thread Amr Ahmed
 I think the package you mentioned is still under development (See
http://www.r-project.org/user-2006/Abstracts/Mueller.pdf) Quote: The R
package KernGPLM (currently under development)** **

I suggest that you directly contact Prof. Marlene Müller (
http://www.marlenemueller.de/) at [EMAIL PROTECTED]

Amr.

On 2/8/07, magda haggag [EMAIL PROTECTED] wrote:

 Dear Professor,

   I am preparing for a Ph.D in semiparametric regression at Cairo
 university in Egypt. Referring to R package KernGPLM, I obtained R version
 2.4.1 but I did not find package KernGPLM. Please, help me how can I
 obtain this package. Thanks in advance.


   Name: Magda Haggag
   E-mail:  [EMAIL PROTECTED]
   Address: 27, Notrdam Desion st., Gleem, Alexandria, Egypt.


 -
 8:00? 8:25? 8:40?  Find a flick in no time

 [[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
 and provide commented, minimal, self-contained, reproducible code.


[[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
and provide commented, minimal, self-contained, reproducible code.


Re: [R] NEWBIE: @BOOK help?

2007-02-08 Thread Abhijit Dasgupta
as can Google Scholar, which isn't as mathematically oriented. I've 
seen, though, that it isn't quite as accurate as CIS

Abhijit
David Scott wrote:
 On Thu, 8 Feb 2007, Andrew Perrin wrote:

   
 It's BibTeX source -- used for the BibTeX bibliography management system
 that integrates with LaTeX.

 http://www.ecst.csuchico.edu/~jacobsd/bib/formats/bibtex.html
 http://www.ctan.org

 

 A further point is that mathematically oriented databases including the 
 Current Index to Statistics (http://www.statindex.org/CIS/) can output 
 bibliographic details in BibTeX format. You can obtain the reference in 
 BibTeX form from the database and easily incorporate it into your document 
 or private BibTeX database of references.

 David Scott


 _
 David Scott   Department of Statistics, Tamaki Campus
   The University of Auckland, PB 92019
   Auckland 1142,NEW ZEALAND
 Phone: +64 9 373 7599 ext 86830   Fax: +64 9 373 7000
 Email:[EMAIL PROTECTED]

 Graduate Officer, Department of Statistics

 __
 R-help@stat.math.ethz.ch mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.


__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] How to get p-values, seperate vectors of regression coefficients and their s.e. from the yags output?

2007-02-08 Thread Abdus Sattar
Hello R-users:

I am using yags for fitting GEE which is giving me the same result as Proc 
GENMOD. Now I have couple of questions related to yags output. (By the way, 
someone told me to run the geeglm for the same analysis and I did run but did 
not get the same result as of genmod and don't know how to correct the geeglm 
codes so that all three will be same!) 
 
 
Questions:
 
1. How can I get the p-value from yags output ? 
2. How can I get the regression coefficients as a seperate row or column vector 
from the output for my simulation please? Also, how can I get the standard 
errors of these reg. coefficients as a seperate vector? Notice, as it is 
highlighted below, beta1=coef(wee) giving me NULL and also summary(wee) is 
not giving me nothing!

The following is the output from the yags analysis:
 
 yf=formula(Ddimer~newrace+steroid+treatment+SOFA+PSI)
 wee=yags(yf, id=Subject, data=final, cor.met=as.double(rep(0:6, 872)), 
 family=gaussian, corstruct=exchangeable, control=yags.control(), weights=w, 
 betainit=NULL, alphainit=.1, subset=NULL)
 wee
YAGS (yet another GEE solver) $Date: 2004/10/22 18:49:23 $
Call:
yags(formula = yf, id = Subject, cor.met = as.double(rep(0:6, 
872)), family = gaussian, corstruct = exchangeable, control = 
yags.control(), 
weights = w, betainit = NULL, alphainit = 0.1, data = final, 
subset = NULL)

Regression estimates:
est.  naive s.e.   naive z  sand. s.e.sand. z
p-value --How to generate it?
(Intercept)  6.972275093 0.122301393 57.008959 0.321211401 21.7061881?
newrace -0.238497110 0.089208731 -2.673473 0.119576217 -1.9945196?
steroid -0.464207865 0.063099906 -7.356712 0.194455948 -2.3872135?
treatment0.140764455 0.080611978  1.746198 0.192932560  0.7296045?
SOFA-0.025986017 0.014140353 -1.837721 0.048131236 -0.5398992?
PSI  0.007095163 0.001035622  6.851114 0.003543198  2.0024740?
 
Working correlation model: exchangeable
alpha est: 0.7344 
NULL
Pan QIC(R): 7534.732 
QLS: 56989.3 
Rotnitzky-Jewell: 9.477, 143.987
yags/R: $Id: yags.R,v 1.5 2004/10/22 18:49:23 stvjc Exp $

 beta1=coef(wee)
 beta1
NULL
 summary(wee)
Length  Class   Mode 
 1 yagsResult S4 
 summary(wee)

  
FYI, in the following geeglm analysis, I have gotten beta=coef(wgee) as a row 
vector(highlighted):

mf=formula(Ddimer~newrace+steroid+treatment+SOFA+PSI)
 wgee=geeglm(mf, id=Subject, data=na.omit(final), weights=w, 
 family=gaussian(identity), corstr=exchangeable) 
 beta=coef(wgee)
 beta
 (Intercept)  newrace  steroidtreatment SOFA  PSI 
 6.904767685 -0.228246050 -0.425099489  0.160940654 -0.024995782  0.006562448 
 summary(wgee)
Call:
geeglm(formula = mf, family = gaussian(identity), data = na.omit(final), 
weights = w, id = Subject, corstr = exchangeable)
 Coefficients:
Estimate Std.errWald  p(W)
(Intercept)  6.904767685 0.275425965 628.4755438 0.
newrace -0.228246050 0.110604904   4.2585110 0.03905414
steroid -0.425099489 0.181105281   5.5095856 0.01891253
treatment0.160940654 0.174823465   0.8474851 0.35726476
SOFA-0.024995782 0.044632439   0.3136406 0.57545474
PSI  0.006562448 0.003313452   3.9225669 0.04764208


If you could help me by answering these questions, I would really appreciate 
your help. 
 
Sincere thanks, 
 
Sattar


 

Looking for earth-friendly autos? 
Browse Top Cars by Green Rating at Yahoo! Autos' Green Center.

[[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
and provide commented, minimal, self-contained, reproducible code.


  1   2   >