[R] error message in fitdistr

2003-08-14 Thread vincent . stoliaroff
Hi R lovers

Here is a numerical vector test
 test
  [1] 206  53 124 112  92  77 118  75  48 176  90  74 107 126  99  84 114
147  99 114  99  84  99  99  99  99  99 104   1 159 100  53
 [33] 132  82  85 106 136  99 110  82  99  99  89 107  99  68 130  99  99
110  99  95 153  93 136  51 103  95  99  72  99  50 110  37
 [65] 102 104  92  90  94  99  76  81 109  91  98  96 104 104  93  99 125
89  99  99 108  90 105  92 106 103  99  99  99  94 102 103
 [97]  97  99 118  91 110  99  99  99  98 105  99  97  99 101  95  98  99
102  99  99  99  99  95  93  86  96 113  87 112 120  71  99
[129]  99  81  96 113  85 116 112  84 120  88  97 104  99 105 153 103  92
99  99  99  90 108 104  99 105  97  94  93  99  85  91  99
[161] 118  99  91  99 103 101 102  96  99 123  85 101  88  99  93  73  97
89  94  69  74  99  97  91  92

Assuming it follows a lognormal distribution I'd like to determine the mean
and the sd thanks to maximum likelihood estimation

 fitdistr(test,lognormal,start=list(200,10))
Error in print.fitdistr(structure(list(estimate = c(4.54666263736726,  :
more elements supplied than there are to replace

I chose the parameter start randomly

I don't understand the error message. Has anybody ever encountered such
one?
thanks for the help

have a wonderful day




**
The sender's email address has changed to 
firstname.lastname@ sgcib.com. You may want to update your 
personal address book. Please see http://www.sgcib.com for more 
information.
   **
This message and any attachments (the message) are confide...{{dropped}}

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


[R] defining and plotting functions thanks to equation

2003-07-28 Thread vincent . stoliaroff
Hi R lovers!

Are there any means to define and plot a function given the equation that
specifies the function?

For example I'd like to plot and work with the Gumbel Distribution density
defined by
Lambda(x)=exp(-exp(-x))

My question may appear very simple but I haven't got an idea yet about how
to do that. I could plot something with x a vector/set of value but I don't
know how to proceed with x belonging to a continuous interval

Thanks for any help.




**
The sender's email address has changed to 
firstname.lastname@ sgcib.com. You may want to update your 
personal address book. Please see http://www.sgcib.com for more 
information.
   **
This message and any attachments (the message) are confide...{{dropped}}

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


[R] named list 'start' in fitdistr

2003-07-25 Thread vincent . stoliaroff
Hi R lovers!

I'd like to know how to use the parameter 'start' in the function
fitdistr()
obviously I have to provide the initial value of the parameter to optimize
except in the case of a certain set of given distribution


Indeed according to the help file for fitdistr
 For the following named distributions, reasonable starting values
 will be computed if `start' is omitted or only partially
 specified: `cauchy', `gamma', `logistic', `negative binomial' (R
 only, parametrized by `mu' and `size'), `t', `uniform', `weibull'.   


However I cannot fit an univariate distribution named 'test'

I get this:

fitdistr(test,lognormal)
Error in fitdistr(test, lognormal) : `start' must be a named list

 fitdistr(test,lognormal,start$meanlog=0,start$sdlog=1)
Error: syntax error

How I am supposed to type a value for start depending on the distribution
on which I am fitting my set

thanks




**
The sender's email address has changed to 
firstname.lastname@ sgcib.com. You may want to update your 
personal address book. Please see http://www.sgcib.com for more 
information.
   **
This message and any attachments (the message) are confide...{{dropped}}

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


Re: [R] named list 'start' in fitdistr

2003-07-25 Thread vincent . stoliaroff

Oups! I should have read further the help file...

Thank you very much



|-+
| |   [EMAIL PROTECTED]|
| |   F.COM|
| ||
| |   07/25/03 05:02 PM|
| ||
|-+
  
--|
  |
  |
  |   To:   Vincent STOLIAROFF/fr/[EMAIL PROTECTED]
  |
  |   cc:   [EMAIL PROTECTED]  
   |
  |   Subject:  Re: [R] named list 'start' in fitdistr 
  |
  
--|




An example in help(fitdistr) (R 1.7.1 for Windows) is fitdistr(x,
dgamma, list(shape = 1, rate = 0.1), lower = 0.01).  Based on this,
have you tried the following:

 fitdistr(test,lognormal, start=list(meanlog=0, sdlog=1))

hope this helps.  spencer graves

[EMAIL PROTECTED] wrote:
 Hi R lovers!

 I'd like to know how to use the parameter 'start' in the function
 fitdistr()
 obviously I have to provide the initial value of the parameter to
optimize
 except in the case of a certain set of given distribution


 Indeed according to the help file for fitdistr
  For the following named distributions, reasonable starting values
  will be computed if `start' is omitted or only partially
  specified: `cauchy', `gamma', `logistic', `negative binomial' (R
  only, parametrized by `mu' and `size'), `t', `uniform', `weibull'.



 However I cannot fit an univariate distribution named 'test'

 I get this:


fitdistr(test,lognormal)

 Error in fitdistr(test, lognormal) : `start' must be a named list


fitdistr(test,lognormal,start$meanlog=0,start$sdlog=1)

 Error: syntax error

 How I am supposed to type a value for start depending on the distribution
 on which I am fitting my set

 thanks




 **
 The sender's email address has changed to
 firstname.lastname@ sgcib.com. You may want to update your
 personal address book. Please see http://www.sgcib.com for more
 information.
**
 This message and any attachments (the message) are confide...
{{dropped}}

 __
 [EMAIL PROTECTED] mailing list
 https://www.stat.math.ethz.ch/mailman/listinfo/r-help









**
The sender's email address has changed to 
firstname.lastname@ sgcib.com. You may want to update your 
personal address book. Please see http://www.sgcib.com for more 
information.
   **
This message and any attachments (the message) are confide...{{dropped}}

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


[R] clearing some part of a graph

2003-07-15 Thread vincent . stoliaroff
Hi R lovers

2 questions:

1) I'd like to know how to clean the title, the sub title or the labels of
a graph. I know how to redefine it with the function title() but it
overwrites the previous title and do not replace it

2) How could I clear a whole plot (for example in a multiple figure
environment)

thanks for your help
vincent






**
The sender's email address has changed to 
firstname.lastname@ sgcib.com. You may want to update your 
personal address book. Please see http://www.sgcib.com for more 
information.
   **
This message and any attachments (the message) are confide...{{dropped}}

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


[R] function acf in package ts

2003-07-15 Thread vincent . stoliaroff
Hi R lovers!



I'd like to know if the 2 blue lines in the graph produced by the function
acf in the package ts represents the level for the test of significance of
the autocorrelation

thanks for help
vincent




**
The sender's email address has changed to 
firstname.lastname@ sgcib.com. You may want to update your 
personal address book. Please see http://www.sgcib.com for more 
information.
   **
This message and any attachments (the message) are confide...{{dropped}}

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


RE: [R] clearing some part of a graph

2003-07-15 Thread vincent . stoliaroff

Many thanks

I don't see any other solution than what you've proposed.
I have tried the par(mfg=c(i,j,k,l))
But it overwrites rather than replaces the previous graph

take care
vincnet



|-+
| |   [EMAIL PROTECTED]|
| |   .uk  |
| ||
| |   07/15/03 03:53 PM|
| ||
|-+
  
--|
  |
  |
  |   To:   Vincent STOLIAROFF/fr/[EMAIL PROTECTED], [EMAIL PROTECTED] 
   |
  |   cc:  
  |
  |   Subject:  RE: [R] clearing some part of a graph  
  |
  
--|




Dear Vincent,

You can't clear a title only. The idea is to plot without one, like

plot(...,main=,sub=,xlab=,ylab=)

and add the title by hand (as you mentioned).

Moreover, AFAIK you can't clear one plot in a multiple figure environment,
since you can only clear the graphics device (not the plot),
but you can put a new plot onto a specific part of your m.f.e. using

par(mfg=c(i,j))

see ?par and An Introduction to R for more details.
(I have to admit that I am unsure whether that will remove a plot there,
or create the new one on top of it - hiding the old one. That matters
with respect to dev.copy() I assume.)

HTH

Thomas

---

Thomas Hotz
Research Associate in Medical Statistics
University of Leicester
United Kingdom

Department of Epidemiology and Public Health
22-28 Princess Road West
Leicester
LE1 6TP
Tel +44 116 252-5410
Fax +44 116 252-5423

Division of Medicine for the Elderly
Department of Medicine
The Glenfield Hospital
Leicester
LE3 9QP
Tel +44 116 256-3643
Fax +44 116 232-2976


 -Original Message-
 From: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED]
 Sent: 15 July 2003 14:31
 To: [EMAIL PROTECTED]
 Subject: [R] clearing some part of a graph


 Hi R lovers

 2 questions:

 1) I'd like to know how to clean the title, the sub title or
 the labels of
 a graph. I know how to redefine it with the function title() but it
 overwrites the previous title and do not replace it

 2) How could I clear a whole plot (for example in a multiple figure
 environment)

 thanks for your help
 vincent






 **
 The sender's email address has changed to
 firstname.lastname@ sgcib.com. You may want to update your
 personal address book. Please see http://www.sgcib.com for more
 information.
**
 This message and any attachments (the message) are
 confide...{{dropped}}

 __
 [EMAIL PROTECTED] mailing list
 https://www.stat.math.ethz.ch/mailman/listinfo/r-help








**
The sender's email address has changed to 
firstname.lastname@ sgcib.com. You may want to update your 
personal address book. Please see http://www.sgcib.com for more 
information.
   **
This message and any attachments (the message) are confide...{{dropped}}

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


[R] counting missing values

2003-06-06 Thread vincent . stoliaroff
Hello R lovers
I have written a little cute function to count the number of missing value
per row in a matrix and return the percentage of missing value

it takes a lot of time to run with a 1000 rows matrix

I'd like to know if there is a function already implemented to count the
number of occurence of a given values in a vector


For information,
here is the function
count-0
for (i in 1:nrow(Matrix))
  {
  for (j in 1:ncol(Matrix)) {if (is.na(Matrix[i,j])) count-count+1}
  Result[i,1]-((count/(ncol(Matrix)))*100);
  count-0
  }
Result

thanks for any help
Vincent




*
Ce message et toutes les pieces jointes (ci-apres le message) sont
confidentiels et etablis a l'intention exclusive de ses destinataires.
Toute utilisation ou diffusion non autorisee est interdite. 
Tout message electronique est susceptible d'alteration. 
La SOCIETE GENERALE et ses filiales declinent toute responsabilite au 
titre de ce message s'il a ete altere, deforme ou falsifie.

This message and any attachments (the message) are confidentia... {{dropped}}

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


[R] writing comments within a function

2003-06-06 Thread vincent . stoliaroff
Hi R lovers!

I would like to know how you can write comments inside the code of a
function

is it latex style
% ?
or any other language style?

thanks a lot





*
Ce message et toutes les pieces jointes (ci-apres le message) sont
confidentiels et etablis a l'intention exclusive de ses destinataires.
Toute utilisation ou diffusion non autorisee est interdite. 
Tout message electronique est susceptible d'alteration. 
La SOCIETE GENERALE et ses filiales declinent toute responsabilite au 
titre de ce message s'il a ete altere, deforme ou falsifie.

This message and any attachments (the message) are confidentia... {{dropped}}

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


RE: [R] writing comments within a function

2003-06-06 Thread vincent . stoliaroff

Thanks you everybody for all your answers



|-+
| |   [EMAIL PROTECTED]|
| |   .uk  |
| ||
| |   06/06/03 01:32 PM|
| ||
|-+
  
--|
  |
  |
  |   To:   Vincent STOLIAROFF/fr/[EMAIL PROTECTED], [EMAIL PROTECTED] 
|
  |   cc:   [EMAIL PROTECTED]  
   |
  |   Subject:  RE: [R] writing comments within a function 
  |
  
--|



 -Original Message-
 From: Ott Toomet [mailto:[EMAIL PROTECTED]
 Sent: 06 June 2003 12:05
 To: [EMAIL PROTECTED]
 Cc: [EMAIL PROTECTED]
 Subject: Re: [R] writing comments within a function


  | From: [EMAIL PROTECTED]
  | Date: Fri, 6 Jun 2003 11:57:32 +0200

 Hallo,

  | Hi R lovers!
  |
  | I would like to know how you can write comments inside the
 code of a
  | function
  |
  | is it latex style
  | % ?
  | or any other language style?

 It's #, otherwise like tex.  The same character is used by gnuplot and
 many configuration scripts and probably by many programming languages
 too.

 You may also consider

 if(FALSE) {
 ...
 }

 But this comment must be syntactically correct.  You may also
 consider emacs+ESS which includes possibilities to commenting and
 uncommenting large program blocks.

 I don't know where it is mentioned explicitly (I did not see it in S
 Programming (a book)), but most examples include comments, I guess.

It is stated in the R Language Definition manual, section 10.2, which
usually comes with the distribution.

Best wishes

Thomas






*
Ce message et toutes les pieces jointes (ci-apres le message) sont
confidentiels et etablis a l'intention exclusive de ses destinataires.
Toute utilisation ou diffusion non autorisee est interdite. 
Tout message electronique est susceptible d'alteration. 
La SOCIETE GENERALE et ses filiales declinent toute responsabilite au 
titre de ce message s'il a ete altere, deforme ou falsifie.

This message and any attachments (the message) are confidentia... {{dropped}}

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


[R] authorized characters and symbols

2003-06-02 Thread vincent . stoliaroff
Hi R lovers

Obviously I cannot use the underscore _  character to name an object in R
Is there a special reason for that ?

I want to use it to rename a function
maybe the problem is due to the nature of the object I work on

thanks for any comments on that very little and not very bothering trouble





*
Ce message et toutes les pieces jointes (ci-apres le message) sont
confidentiels et etablis a l'intention exclusive de ses destinataires.
Toute utilisation ou diffusion non autorisee est interdite. 
Tout message electronique est susceptible d'alteration. 
La SOCIETE GENERALE et ses filiales declinent toute responsabilite au 
titre de ce message s'il a ete altere, deforme ou falsifie.

This message and any attachments (the message) are confidentia... {{dropped}}

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


[R] writing several command line in R console

2003-03-03 Thread Vincent Stoliaroff
Hi R lovers

I would like to know how to step to the next line in the R console editor 
without breaking the continuity of my code
more clearly : if for example I write a function, so far i have to write the 
all code inside on the same line wich may become obscure as the function is 
more and more complex.
I would like to do like in the example of the manuels:

twosam - function(y1, y2) {
   n1  - length(y1); n2  - length(y2)
   yb1 - mean(y1);   yb2 - mean(y2)s1  - var(y1);s2  - var(y2)
   s - ((n1-1)*s1 + (n2-1)*s2)/(n1+n2-2)
   tst - (yb1 - yb2)/sqrt(s2*(1/n1 + 1/n2))tst  }
all I can do is something like that:

twosam - function(y1, y2) {n1  - length(y1); n2  - length(y2)
+yb1 - mean(y1);   yb2 - mean(y2)s1  - var(y1);s2  - var(y2)
+s - ((n1-1)*s1 + (n2-1)*s2)/(n1+n2-2)
+   tst - (yb1 - yb2)/sqrt(s2*(1/n1 + 1/n2))tst  }
with the sign + in front of each line
What does this sign mean? and how could I solve my problems
Thanks
__
[EMAIL PROTECTED] mailing list
http://www.stat.math.ethz.ch/mailman/listinfo/r-help


RE: [R] writing several command line in R console

2003-03-03 Thread Vincent Stoliaroff


Thanks to all

1) OK for the + sign and the problem of syntactelly unbreaking when you 
open a { or a (
2) Thanks for the advise to use another editor for the functions. And then 
the source() function. I tried it succesfully

Long life to R!


From: Henrik Bengtsson [EMAIL PROTECTED]
To: 'Vincent Stoliaroff' [EMAIL PROTECTED], 
[EMAIL PROTECTED]
Subject: RE: [R] writing several command line in R console
Date: Tue, 4 Mar 2003 14:04:13 +1100

The R prompt should be though of as a one line editor or rather one
expression editor. You can not step between lines etc while editing an
expression. The + in front of each row placed there by R indicating
that even if you have typed ENTER the expression is not finished and
that R expect you to close it (normally by closing brackets, parentesis
etc). The + is just an indicator and will not be included in your
expression.
What you really want to do when you create functions etc is to write the
up in an external text editor, save them with the extension *.R, e.g.
twosam.R, and the use source to read the function in to R, i.e.
   source(twosam.R)

Make sure to save your twosam.R file as *text*. If you're using Windows
you can use Notepad to do this. Also, you have to save the file in the
working directory of R. You can find the current working directory of R
by
   getwd()

Alternatively, you'll have to specify the full path to the file when
using source
   source(C:/My Documents/hb/twosam.R)

Hope this helps!

Henrik Bengtsson

 -Original Message-
 From: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED] On Behalf Of Vincent
 Stoliaroff
 Sent: den 4 mars 2003 13:36
 To: [EMAIL PROTECTED]
 Subject: [R] writing several command line in R console



 Hi R lovers

 I would like to know how to step to the next line in the R
 console editor
 without breaking the continuity of my code
 more clearly : if for example I write a function, so far i
 have to write the
 all code inside on the same line wich may become obscure as
 the function is
 more and more complex.
 I would like to do like in the example of the manuels:

 twosam - function(y1, y2) {
 n1  - length(y1); n2  - length(y2)
 yb1 - mean(y1);   yb2 - mean(y2)s1  - var(y1);
 s2  - var(y2)
 s - ((n1-1)*s1 + (n2-1)*s2)/(n1+n2-2)
 tst - (yb1 - yb2)/sqrt(s2*(1/n1 + 1/n2))tst  }


 all I can do is something like that:

 twosam - function(y1, y2) {n1  - length(y1); n2  - length(y2)

 +yb1 - mean(y1);   yb2 - mean(y2)s1  - var(y1);
 s2  - var(y2)
 +s - ((n1-1)*s1 + (n2-1)*s2)/(n1+n2-2)
 +   tst - (yb1 - yb2)/sqrt(s2*(1/n1 + 1/n2))tst  }

 with the sign + in front of each line
 What does this sign mean? and how could I solve my problems Thanks

 __
 [EMAIL PROTECTED] mailing list
 http://www.stat.math.ethz.ch/mailman/listinfo/ r-help


__
[EMAIL PROTECTED] mailing list
http://www.stat.math.ethz.ch/mailman/listinfo/r-help


[R] Clustering partition and memory

2003-02-09 Thread Vincent Stoliaroff


Dear R-help list members

i would like to use R to produce clustering or partitioning of a dataset.
I am trying to use the functions:
- hierclust() of the package multiv
-pam(), agnes() and fanny() of the package cluster

But I cannot get any result because of lack of memory. Would you know any 
clustering function not to greedy in memory?
I have tried to expand my memory limit with memory.limit() but no 
significant results.

Thank you for any answer that could help.
Vincent

__
[EMAIL PROTECTED] mailing list
http://www.stat.math.ethz.ch/mailman/listinfo/r-help


[R] correspondance analysis clustering

2003-02-03 Thread Vincent Stoliaroff


Hi

1) I am using the function ca() of the package multiv to make a 
correspondance analysis of a matrix of categorical datas which are 
numericaly coded. I would like to be sure that it is considered as a matrix 
of categorical datas and not numerical. I cannot find any explicit mention 
of that in the help file for this function

2) I would like to take the resulting matrix rproj to do a clustering.
I use hierclust() and partition() of the package multiv

regarding hierclust()
when I use the method number 1 i get this error:
Error in hclust(a, method) : invalid clustering method

when I change the number of the method I get
Error in pmatch(x, table, duplicates.ok) :
   argument is not of mode character


As for the partition() function, I also have some troubles. It seems I 
should mention a vector of clustered centers for initiating the iterative 
optimization process. But I do not know where to enter it.
I get the following message
Error in matrix(0, ng, m) : non-numeric matrix extent

Has anybody ever encountered those problems?
Thanks a lot


_
MSN Search, le moteur de recherche qui pense comme vous !

__
[EMAIL PROTECTED] mailing list
http://www.stat.math.ethz.ch/mailman/listinfo/r-help