Re: [R] Numbers that look equal, should be equal, but if() doesn'tsee as equal (repost with code included)

2003-05-29 Thread Thomas Lumley
On Wed, 28 May 2003, Paul Lemmens wrote: Hi! Apologies for sending the mail without any code. Apparently somewhere along the way the .R attachments got filtered out. I have included the code below as clean as possible. My original mail is below the code. I still think you need not to be

Re: [R] Numbers that look equal, should be equal, but if() doesn'tsee as equal (repost with code included)

2003-05-29 Thread Paul Lemmens
Hoi Thomas, --On woensdag 28 mei 2003 7:16 -0700 Thomas Lumley [EMAIL PROTECTED] wrote: On Wed, 28 May 2003, Paul Lemmens wrote: Hi! Apologies for sending the mail without any code. Apparently somewhere along the way the .R attachments got filtered out. I have included the code below as clean

[R] Zero is not zero

2003-05-29 Thread szhan
Hello, There: I read data from tab-delimted text file(1888.txt) in C:/temp, which has thousands rows and 80 colulms, using read.delim(C:/temp/1888.txt). when I retrieved the numeric coulum which has real zero values and applies R buid-in function such as mean( ), sum() and got a result of NA.

Re: [R] Numbers that look equal, should be equal, but if() doesn'tsee as equal (repost with code included)

2003-05-29 Thread Prof Brian Ripley
On Wed, 28 May 2003, Paul Lemmens wrote: Hoi Thomas, --On woensdag 28 mei 2003 7:16 -0700 Thomas Lumley [EMAIL PROTECTED] wrote: On Wed, 28 May 2003, Paul Lemmens wrote: Hi! Apologies for sending the mail without any code. Apparently somewhere along the way the .R attachments

[R] missing values

2003-05-29 Thread Adrian Dusa
Dear list members, I'm relatively new to this list; can anyone tell me how to declare missing values once a dataset has been attached? For example here: VAR1 1 1 2 2 3 1 4 3 5 2 6 1 7 3 8 3 9 1 102 11 98 122 13 97 14 99

Re: [R] modules in RedHat

2003-05-29 Thread Martyn Plummer
On Wed, 2003-05-28 at 17:18, Roy, Supratik wrote: I am having problems when calling supsmu in R 1.6.2 installed on RedHat 8.0. I used the rpm provided on the R site. supsmu seems to have not been installed by default - (i.e., as part of the modreg package). It also does not occur as part of

RE: [R] Numbers that look equal, should be equal,but if() doesn'tsee as equal (repost with code included)

2003-05-29 Thread Simon Fear
Try the following function (the name is supposed to be a joke, by the way), which will also do the right thing with NAs and characters. Use it as if(equal.enough(x,y)) rather than if(x==y), e.g. equal.enough(0.1+0.2, 0.3) [1] TRUE My default of 15 significant figures may be overkill in many

Re: [R] Numbers that look equal, should be equal, but if() doesn'tseeas equal (repost with code included)

2003-05-29 Thread Barry Rowlingson
Simon Fear wrote: Try the following function (the name is supposed to be a joke, by the way), which will also do the right thing with NAs and characters. Use it as if(equal.enough(x,y)) rather than if(x==y), e.g. equal.enough(0.1+0.2, 0.3) Oh, why not just go one step further, and redefine the

Re: [R] missing values

2003-05-29 Thread Thomas Lumley
On Wed, 28 May 2003, Adrian Dusa wrote: I would like values 97, 98 and 99 to be treated as missing values. VAR1[VAR1 %in% c(97,98,99)]-NA -thomas __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help

RE: [R] Numbers that look equal, should be equal,but if() doesn'tsee as equal (repost with code included)

2003-05-29 Thread Simon Fear
No problem, equal.enough(1+1,3,d.p.zero=10) ! But seriously, this is WHY NOT do that substitution: it helps me remember that I am not in fact truly testing for numeric identity. S -Original Message- From: Barry Rowlingson [mailto:[EMAIL PROTECTED] Sent: 28 May 2003 17:03 To: Simon

[R] supplying the Hessian to nlm

2003-05-29 Thread Edmond Ng
Dear all, I am trying to minimize a function with 3 parameters using nlm. I have worked out the 2nd derivatives (incl the cross-product terms) and would like to supply them to nlm for evaluation. What I am not sure about is how to set up the Hessian matrix for nlm. That is, attr(lhat,

[R] how to get a line plot before/after treatment

2003-05-29 Thread Frank Mattes
Dear R help-list reader, I would like to generate a plot which compares to states in a patient treatment, before and after. for this reason I have generated a vector before-c(1,30,23,40) and after-c(20,10,20,60) the first element in before corresponds to the first element in after. I would like

[R] thx

2003-05-29 Thread Adrian Dusa
Many thanks to Spencer Graves, Simon Fear, Rolf Turner, Thomas Lumley, Patrick Burns and Renaud Lancelot; you're quick and great. Cheers, Adrian Adrian Dusa ([EMAIL PROTECTED]) Romanian Social Data Archive (www.roda.ro) 1, Schitu Magureanu Bd. 76625 Bucharest

Re: [R] how to get a line plot before/after treatment

2003-05-29 Thread Marc Schwartz
On Wed, 2003-05-28 at 11:48, Frank Mattes wrote: Dear R help-list reader, I would like to generate a plot which compares to states in a patient treatment, before and after. for this reason I have generated a vector before-c(1,30,23,40) and after-c(20,10,20,60) the first element in before

Re: [R] how to get a line plot before/after treatment

2003-05-29 Thread Thomas W Blackwell
Frank - Roughly speaking: matplot(c(0,10), rbind(before, after), type=l, axes=F, xlab=time, ylab=measurement) axis(2) axis(1, c(0,10), c(before,after)) Should do the job, if I interpret correctly the plot you have in mind. See help(matplot) : Details, and many pages of help(par) for

Re: [R] Numbers that look equal, should be equal,but if() doesn't see as equal (repost with code included)

2003-05-29 Thread Duncan Murdoch
On Wed, 28 May 2003 15:59:45 +0100 (BST), Prof Brian Ripley [EMAIL PROTECTED] wrote: print(c(0.1 + 0.2, 0.3), digits=20) [1] 0.30004 0.2 yet print(c(0.1, 0.2, 0.3), digits=20) [1] 0.1 0.2 0.3 Is this the way things should work? Why isn't 0.3 printed as

Re: [R] Zero is not zero

2003-05-29 Thread Duncan Murdoch
On Wed, 28 May 2003 10:48:08 -0400, you wrote: Hello, There: I read data from tab-delimted text file(1888.txt) in C:/temp, which has thousands rows and 80 colulms, using read.delim(C:/temp/1888.txt). when I retrieved the numeric coulum which has real zero values and applies R buid-in function

[R] ? building a database with a the great examples

2003-05-29 Thread Frank Mattes
Dear R help reader, I'm not an expert in R and are lerning a lot by reading the help digest, which is sometimes difficult because the huge amount of data posted. I have posted some questions before, and are impressed how quick I got a solution for my problem. Sometimes with quite different

Re: [R] ? building a database with a the great examples

2003-05-29 Thread Jonathan Baron
On 05/28/03 20:09, Frank Mattes wrote: On the other site, it wasn't easy to search the help archive, purely I didn't know how to formulate my problem. I'm wondering if we could not collect all the answers / examples in a database - sorted in topics, like the help document Rtips. I have no clue

RE: [R] Slow computation in for loop

2003-05-29 Thread Liaw, Andy
I don't know if this will help you or not, but might worth a try. You can replace the two inner for loops with nested calls to sapply(). For example: sapply(1:5, function(x) sapply(6:10, function(y) x+y)) [,1] [,2] [,3] [,4] [,5] [1,]789 10 11 [2,]89 10 11 12

Re: [R] Slow computation in for loop

2003-05-29 Thread Ross Ihaka
Philippe Grosjean wrote: I suspect that your problem comes from the rbind(). I have also noticed an exponentially slower execution with the increase of the size of the data frame that you rbind()s. It is much faster to rbind() several separated temporary data frames (let's say, ten by ten loops),

[R] Ordinal data - Regression Trees Proportional Odds

2003-05-29 Thread John Fieberg
I have a data set w/ an ordinal response taking on one of 10 categories. I am considering using polr to fit a cumulative logits model. I previously fit the model in SAS (using proc logistic) which provides a test for the proportional odds assumption (p 0.001 for the test). Are there simple

Re: [R] Durbin-Watson Test

2003-05-29 Thread John Fox
Dear rwatkins, The car and lmtest packages both have functions for Durbin-Watson tests. More generally, doing a search at http://www.r-project.org/ will get you this kind of information. I hope that this helps, John At 04:45 PM 5/28/2003 -0500, [EMAIL PROTECTED] wrote: Is there a command to

[R] (no subject)

2003-05-29 Thread Dirk Eddelbuettel
Subject: [ANN] Quantian: A Knoppix remastering for Scientific Computing X-Mailer: VM 7.03 under 21.4 (patch 6) Common Lisp XEmacs Lucid FCC: /home/edd/mail/out/mail From: Dirk Eddelbuettel [EMAIL PROTECTED] --text follows this line-- [ Apologies for cross-postings; however, this message is being

Re: [R] Numbers that look equal, should be equal, but if() doesn

2003-05-29 Thread Ted Harding
On 28-May-03 Barry Rowlingson wrote: Oh, why not just go one step further, and redefine the == operator! == - function(x,y){equal.enough(x,y)} before: (.1+.2)==.3 [1] FALSE after: (.1+.2)==.3 [1] TRUE This requires a slight modification to equal.enough, which I will not

RE: [R] Ordinal data - Regression Trees Proportional Odds

2003-05-29 Thread Liaw, Andy
From: John Fieberg [mailto:[EMAIL PROTECTED] I have a data set w/ an ordinal response taking on one of 10 categories. I am considering using polr to fit a cumulative logits model. I previously fit the model in SAS (using proc logistic) which provides a test for the proportional odds

Re: [R] Can Package SEM do mean structural analysis?

2003-05-29 Thread Mitsuo Igarashi
Dear John: I can make it on your suggestion in mean structural analysis. I appreciate so much and love your package sem. I hope your package sem will be extended in near future. John Fox [EMAIL PROTECTED] wrote: Dear Mitsuo, My intention in writing the sem package was to provide a basic