Re: [R] Bug in "is" ?

2008-09-25 Thread Barry Rowlingson
2008/9/25 Kingsford Jones <[EMAIL PROTECTED]>: > > Try > > ?type > > which correctly guesses the user is looking for the 'typeof' page. > > Or even > > example(type) > > Also, after a brief introduction, the R Language Definition document > begins with a discussion of types. > > > Kingsford Jones

[R] maximum likelihood

2008-09-25 Thread Jurica Brajković
Hello, I am trying to estimate parameters of mean reverting process with jumps given by: dp=k(mu-p)dt+sigma*dz+Jdq where dp represents change in log of price, k is reversion factor, mu is long run level of price, sigma is standard deviation, and dq equals one with probability lambda if jump oc

Re: [R] R function which finds confidence interval for binomial variance

2008-09-25 Thread Robert A LaBudde
Thanks Ralph, Moshe and [EMAIL PROTECTED] for you helpful comments. Using bootstrap (e.g., 'boot' + boot.ci()) for the confidence interval on the variance is not very accurate in coverage, because the sampling distribution is extremely skewed. In fact, the 'BCa' method returns the same result

[R] Error in Cut command - 'x' must be numeric?

2008-09-25 Thread Mackay Peter
Hi Everyone I have a data set I want to bucket into deciles. Have been trying (without) success to use cut and using online help to understand my error. Here is my code to read in a few sample rows. I want to then create deciles by this variable > a<-read.csv("c:/temp/petrol.csv",header=TRUE,s

[R] question on adding percent column to aggregate

2008-09-25 Thread Sharma, Dhruv
Hi, Is there a way to add a colum containing percentages to output from aggregate? for example I have the following from aggregate: (aggregate(data[,cbind("A","B","C","D","E","F")], by=list(data$producttype), sum)) Group.1 A B C

[R] varimp in party (or randomForest)

2008-09-25 Thread Jason Jones Medical Informatics
Hi, There is an excellent article at http://www.biomedcentral.com/1471-2105/9/307 by Stroble, et al. describing variable importance in random forests. Does anyone have any suggestions (besides imputation or removal of cases) for how to deal with data that *have* missing data for predictor vari

Re: [R] HOW to use the Hosmer–Lemeshow test ‏ in R

2008-09-25 Thread Frank E Harrell Jr
leo_wa wrote: i want to know how to use the Hosmer–Lemeshow test‏ in R. Can anyone show me the program to me and tell me how to use it? Please read the archives as this question has been posed many times in the past few years. My answer is always the same: read the following article and see

[R] Type I and Type III SS in anova

2008-09-25 Thread Menelaos Stavrinides
Hi all, I have been trying to calculate Type III SS in R for an unbalanced two-way anova. However, the Type III SS are lower for the first factor compared to type I but higher for the second factor (see below). I have the impression that Type III are always lower than Type I - is that right? And a

[R] auto.arima help

2008-09-25 Thread rkevinburton
I am calling auto.arima with a time series that is about 186 observations long with a frequency of 52. With some time series I get: 1:last.nonzero: result would be too long a vector Is there something that I can do to the data to avoid this error? Thank you. Kevin

Re: [R] restricting lattice pages to one

2008-09-25 Thread John Fox
Dear Deepayan, Thanks for getting back to me. In the interim, I computed the layout that I wanted in the more complicated context in which the problem arose, but I'll certainly keep this clever idea in mind. Regards, John -- John Fox, Professor Department of Socio

Re: [R] Bug in "is" ?

2008-09-25 Thread Rolf Turner
On 26/09/2008, at 12:34 PM, jim holtman wrote: The nice thing about R is if you don't like something, then get create your own function (is.Integer?) that does what you want without asking to have the base code changed and therefore impact a lot of programs. You can have whatever functions your

Re: [R] foruntes candidate?? WAS:Re: Bug in "is" ?

2008-09-25 Thread Nordlund, Dan (DSHS/RDA)
> -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of Charles C. Berry > Sent: Thursday, September 25, 2008 4:31 PM > To: Douglas Bates > Cc: Wacek Kusnierczyk; Achim Zeileis; R help > Subject: [R] foruntes candidate?? WAS:Re: Bug in "is" ? > > > > Doug

Re: [R] Bug in "is" ?

2008-09-25 Thread jim holtman
The nice thing about R is if you don't like something, then get create your own function (is.Integer?) that does what you want without asking to have the base code changed and therefore impact a lot of programs. You can have whatever functions your heart desires and use them privately and quit bell

Re: [R] Inverting data frame...row wise

2008-09-25 Thread David Scott
On Fri, 26 Sep 2008, David Scott wrote: On Thu, 25 Sep 2008, Julian Burgos wrote: How about something like my.data=my.data[,4:1] Julian This can be tackled in a similar way to the question by Mark Na which I just answered. Using the same data frame construction we have df <- data.fram

Re: [R] Inverting data frame...row wise

2008-09-25 Thread David Scott
On Thu, 25 Sep 2008, Julian Burgos wrote: How about something like my.data=my.data[,4:1] Julian This can be tackled in a similar way to the question by Mark Na which I just answered. Using the same data frame construction we have df <- data.frame(k1=1:2,k2=3:4,z=5:6,a=7:8,y=9:10) df

Re: [R] Inverting data frame...row wise

2008-09-25 Thread Julian Burgos
How about something like my.data=my.data[,4:1] Julian milicic.marko wrote: Hi, I have the data.frame with 4 columns. I simply want to invert dataset so that last row becomes first... I tried with rev(my_data-frame) but I got my columns inverted... not my rows Thanks __

Re: [R] How to order some of my columns (not rows) alphabetically

2008-09-25 Thread David Scott
On Thu, 25 Sep 2008, Mark Na wrote: Hello, I have a dataframe with 9 columns, and I would like to sort (order) the right-most eight of them alphabetiaclly, i.e.: ID1 ID2 F G A B C E D would become ID1 ID2 A B C D E F G Right now, I'm using this code: attach(data) data<-data.frame(ID1,ID2

Re: [R] FORTUNES WAS :foruntes candidate?? WAS:Re: Bug in "is" ?

2008-09-25 Thread Charles C. Berry
Sorry about my clumsy fingers! :-( On Thu, 25 Sep 2008, Charles C. Berry wrote: Douglas Bates [after a tortuous discussion of the behavior of is(7,"integer")]: As for the question of the bug in "is", ... "it depends what your definition of `is' is." [Bill Clinton] --- Good one, Doug

Re: [R] Bug in "is" ?

2008-09-25 Thread Duncan Murdoch
On 25/09/2008 6:33 PM, Rolf Turner wrote: On 26/09/2008, at 9:23 AM, Wacek Kusnierczyk wrote: indeed. one more example that R man pages are often rather uninformative, despite verbosity. My, you ***are*** in a bad mood, aren't you? :-) The quality of R documentation has been

[R] foruntes candidate?? WAS:Re: Bug in "is" ?

2008-09-25 Thread Charles C. Berry
Douglas Bates [after a tortuous discussion of the behavior of is(7,"integer")]: As for the question of the bug in "is", ... "it depends what your definition of `is' is." [Bill Clinton] --- Good one, Douglas! Chuck On Thu, 25 Sep 2008, Douglas Bates wrote: On Thu, Sep 25, 2008 at 4:

[R] Programming chalange

2008-09-25 Thread milicic.marko
Okay... I would like to have some elegant (writting generic R code) solution to do following. I have a dataset X1 X2 X3 X4 1 23 4 1 23 4 1 23 4 1 23 4 1 23 4 1 23 4 1 23 4 1 23 4 I would like to specify sometnig like this: windows <- c(3, 4); fun

Re: [R] How to order some of my columns (not rows) alphabetically

2008-09-25 Thread David Scott
On Thu, 25 Sep 2008, Mark Na wrote: Hello, I have a dataframe with 9 columns, and I would like to sort (order) the right-most eight of them alphabetiaclly, i.e.: ID1 ID2 F G A B C E D would become ID1 ID2 A B C D E F G Right now, I'm using this code: attach(data) data<-data.frame(ID1,ID2

Re: [R] Conversion to Binary (base2)

2008-09-25 Thread Erich Neuwirth
Since I have to teach number base conversion within 2 weeks, I could not resist: numberInBase <- function(number,base){ numberInBaseRecur<-function(number,base){ lastDigit<-function(number,base) number %% base if (number == 0) result <- c(0) else result <- c(numberInBaseRecur(number

[R] How to order some of my columns (not rows) alphabetically

2008-09-25 Thread Mark Na
Hello, I have a dataframe with 9 columns, and I would like to sort (order) the right-most eight of them alphabetiaclly, i.e.: ID1 ID2 F G A B C E D would become ID1 ID2 A B C D E F G Right now, I'm using this code: attach(data) data<-data.frame(ID1,ID2,data[,sort(colnames(data)[3:9])]) det

[R] glm stability

2008-09-25 Thread Erwann.Rogard
hi all, i have an iterative algorithm that relies on glm at each step to compute a set of coefficients (gamma). depending on the input to the algorithm, glm may at certain iterations generate crazy values (associated with glm$converge = FALSE). in some cases, start = last value of gamma resolves

Re: [R] Bug in "is" ?

2008-09-25 Thread Rolf Turner
On 26/09/2008, at 9:23 AM, Wacek Kusnierczyk wrote: indeed. one more example that R man pages are often rather uninformative, despite verbosity. My, you ***are*** in a bad mood, aren't you? :-) The quality of R documentation has been debated, castigated defended and

Re: [R] Bug in "is" ?

2008-09-25 Thread Kingsford Jones
On Thu, Sep 25, 2008 at 3:23 PM, Wacek Kusnierczyk <[EMAIL PROTECTED]> wrote: > Rolf Turner wrote: >> [snip] >> Now what on earth does ``integer type'' mean? The concept ``type'' is >> not defined >> anywhere, and there is no help on ``type''. There is no type() >> function. One >> has to intui

Re: [R] restricting lattice pages to one

2008-09-25 Thread Deepayan Sarkar
On Thu, Sep 25, 2008 at 7:33 AM, John Fox <[EMAIL PROTECTED]> wrote: > Dear list members, > > I'd like to be able to restrict the number of pages in a lattice display to > one without having to specify explicity the number of rows and columns in > the display -- that is, having forced one page, I'd

Re: [R] Conversion to Binary (base2)

2008-09-25 Thread Carl Witthoft
It occurs to me that Christos' method could be made more flexible by using rle(). That is, before collapsing the digits, you have something like >foo [1] 0 0 0 0 0 0 0 0 0 0 0 1 0 1 1 0 0 1 0 Then rle(foo) will show you where the boring lead-zeros end, and you can use that value to set the

Re: [R] Bug in "is" ?

2008-09-25 Thread Douglas Bates
On Thu, Sep 25, 2008 at 5:07 PM, Douglas Bates <[EMAIL PROTECTED]> wrote: > On Thu, Sep 25, 2008 at 4:23 PM, Wacek Kusnierczyk > <[EMAIL PROTECTED]> wrote: >> Rolf Turner wrote: >>> >>> On 26/09/2008, at 1:27 AM, Petr PIKAL wrote: >>> Hi Sorry but I can not agree. If you measure some

Re: [R] Bug in "is" ?

2008-09-25 Thread Douglas Bates
On Thu, Sep 25, 2008 at 4:23 PM, Wacek Kusnierczyk <[EMAIL PROTECTED]> wrote: > Rolf Turner wrote: >> >> On 26/09/2008, at 1:27 AM, Petr PIKAL wrote: >> >>> Hi >>> >>> Sorry but I can not agree. If you measure something and your values in a >>> vector are >>> >>> c(5.1, 5.4, 4.8, 5.0) >>> >>> do yo

Re: [R] Bug in "is" ?

2008-09-25 Thread Peter Dalgaard
Duncan Murdoch wrote: On 25/09/2008 4:43 PM, Rolf Turner wrote: [ lots of deletions ] I do think, however, that there ought to a WARNING section in the help on is.integer() saying something like: NOTE: is.integer() DOES NOT DO what you expect it to do. In large friendly letters. But o

Re: [R] Inverting data frame...row wise

2008-09-25 Thread Josip Dasovic
I think that Marko wanted his rows to be reversed, such that the first row becomes the last, while the second row becomes the second-to-last row, etc. If I am assuming correctly, this will do what you want: x<-data.frame(cbind(1:10, 1:10, 1:10, 1:10)) print(x) X1 X2 X3 X4 1 1 1 1 1 2 2

Re: [R] Bug in "is" ?

2008-09-25 Thread Rolf Turner
On 26/09/2008, at 9:34 AM, Duncan Murdoch wrote: On 25/09/2008 4:43 PM, Rolf Turner wrote: [ lots of deletions ] I do think, however, that there ought to a WARNING section in the help on is.integer() saying something like: NOTE: is.integer() DOES NOT DO what you expect it to do. In

Re: [R] Inverting data frame...row wise

2008-09-25 Thread Daniel Malter
Sorry, I misread. I thought you want to get the columns inverted. It works for rows analogously: x=c(rep(1:10,4)) dim(x)=c(10,4) x=data.frame(x) x2=x[order(-1:-10),] x2 - cuncta stricte discussurus - -Ursprüngliche Nachricht- Von: [EMAIL

Re: [R] Inverting data frame...row wise

2008-09-25 Thread Daniel Malter
So you want to make columns 1,2,3,4 into 4,3,2,1 or into 4,1,2,3? The first option is done by: x=c(rep(1,10),rep(2,10),rep(3,10),rep(4,10)) dim(x)=c(10,4) x=data.frame(x) #create data x2=x[,order(-1:-4)] #invert column order - cuncta stricte discussurus ---

Re: [R] Bug in "is" ?

2008-09-25 Thread Duncan Murdoch
On 25/09/2008 4:43 PM, Rolf Turner wrote: [ lots of deletions ] I do think, however, that there ought to a WARNING section in the help on is.integer() saying something like: NOTE: is.integer() DOES NOT DO what you expect it to do. In large friendly letters. But only the first few t

[R] Please help me interpret these results (fitting distributions to real data)

2008-09-25 Thread Ted Byers
I just thought of a useful metaphore for the problem I face. I am dealing with a problem in business finance, with two kinds of related events. However, imagine you have a known amount of carbon (so many kilograms), but you do not know what fraction is C14 (and thus radioactive). Only the C14 w

Re: [R] Conversion to Binary (base2)

2008-09-25 Thread Duncan Murdoch
On 25/09/2008 4:22 PM, Jason Thibodeau wrote: This is almost doing what I want. here is a snippet of my code, which is writing the x coordinate (converted to binary), and the y coordinate to a file. The major problem at this point: the paces between each digit in the cat. What is causing this?

Re: [R] Bug in "is" ?

2008-09-25 Thread Wacek Kusnierczyk
Rolf Turner wrote: > > On 26/09/2008, at 1:27 AM, Petr PIKAL wrote: > >> Hi >> >> Sorry but I can not agree. If you measure something and your values in a >> vector are >> >> c(5.1, 5.4, 4.8, 5.0) >> >> do you think the first three numbers shall be double and the last one >> integer? Why? It is jus

[R] Inverting data frame...row wise

2008-09-25 Thread milicic.marko
Hi, I have the data.frame with 4 columns. I simply want to invert dataset so that last row becomes first... I tried with rev(my_data-frame) but I got my columns inverted... not my rows Thanks __ R-help@r-project.org mailing list https://stat.ethz.ch/

[R] survey package

2008-09-25 Thread Sylvie Ahoussou
Hello I have a problem using the package survey: I'm trying to calculate the prevalence of a disease in animals sampled using a 2 stages sampling system: first level: farm randomly chosen within 551 farms second level: animals randomly chosen in the farms My data base has this aspect:

[R] cat() formatting

2008-09-25 Thread Jason Thibodeau
I am having a problem with output formatting in my program. The cat() function, when combined with the conversion to binary, produces spaces between each of the digits. I have included the code, and a snippet of the output. The code has NOT been cleaned up yet, I am just hunting for correct functio

[R] R Foundation adopts Certification/Validation document

2008-09-25 Thread Martin Maechler
The Board of the R Foundation would like to announce the unanimous adoption of the document entitled: "R: Regulatory Compliance and Validation Issues. A Guidance Document for the Use of R in Regulated Clinical Trial Environments" The updated version of the document, dated August 17, 2008, is av

Re: [R] Dot plot - equivalent of MINITAB

2008-09-25 Thread Rolf Turner
On 26/09/2008, at 7:51 AM, kerfuffle wrote: hi folks, Bit of a newbie, but I've spent a fair bit of time looking for an answer on this, with no joy. Can anyone help me? Dataset: A single column of values in a csv file (eg. 52, 53, 54, 85, etc) Goal: In Minitab, you have what they cal

[R] sd() of column, but for a subset of rows

2008-09-25 Thread Shaw, Stephanie
I would like to take the standard deviation of a column, but only for a subset of the rows in that column with a given index. The following loop worked fine when I wanted the mean, but is not working for the standard deviation: for (i in 1:length(x[1,])){ a<-tapply(x[,i],x[,2],sd, na.rm=TRUE)

Re: [R] Dot plot - equivalent of MINITAB

2008-09-25 Thread Charilaos Skiadas
I think the problem is that what you describe is not what some people, R folks included, refer to as "dotplot", though I suppose wikipedia as well as some other top google links seem to agree with you and minitab. What you describe I think can be obtained with something like: x<- c(6,6,4,

Re: [R] Bug in "is" ?

2008-09-25 Thread Rolf Turner
On 26/09/2008, at 1:27 AM, Petr PIKAL wrote: Hi Sorry but I can not agree. If you measure something and your values in a vector are c(5.1, 5.4, 4.8, 5.0) do you think the first three numbers shall be double and the last one integer? Why? It is just that the reading is not precise enough f

[R] solving for beta0 in a logsitic regression

2008-09-25 Thread Nina Paynter
Hi all, I am trying to create simulated data for exploring reclassfication measures in a logistic setting with two continuous predictors and I would like to set the average population probability of outcome rather than the logistic beta0. Is there a way to find a beta0 that will generate the

Re: [R] Conversion to Binary (base2)

2008-09-25 Thread Jason Thibodeau
This was what I was looking for to solve the truncate to 17 digits. Thanks a lot. Now my output looks like this: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ,0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 ,0.0998004 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 ,0.1996008 On Thu, Sep 25, 2008 at 4:28 PM, Christos Hatzis < [EMAI

Re: [R] Function for case insensitive match

2008-09-25 Thread Thomas Lumley
On Thu, 25 Sep 2008, Rajasekaramya wrote: I am just wondering if there is any function that could match the vectors irrespective of the upper and lower case alphabets. Use toupper() before matching -thomas Thomas Lumley Assoc. Professor, Biostatistics [EMAIL PROTECTE

Re: [R] Conversion to Binary (base2)

2008-09-25 Thread Jason Thibodeau
This is almost doing what I want. here is a snippet of my code, which is writing the x coordinate (converted to binary), and the y coordinate to a file. The major problem at this point: the paces between each digit in the cat. What is causing this? code: sink("generated.txt", append = TRUE) cat(pa

Re: [R] Conversion to Binary (base2)

2008-09-25 Thread Jason Thibodeau
This seems to work well. After playing with it for a while, however, I can't seem to find a way to fix the number of binary digits to say, 17. Am I just missing something, or am I getting lost in the type conversion? The help page for intToBits said parameter n, and I tried that to no avail. On T

Re: [R] Equivalent of 'first.var' or 'last.var' from SAS in R?

2008-09-25 Thread hadley wickham
On Thu, Sep 25, 2008 at 2:00 PM, Matthew Pettis <[EMAIL PROTECTED]> wrote: > Hi, > > I want to sort a data frame by multiple columns and then take the > first record in each unique level of the "by" group I used to sort the > data frame. Does someone have an example of how to do this? > > Thanks,

Re: [R] Conversion to Binary (base2)

2008-09-25 Thread Prof Brian Ripley
See also sfsmisc:as.intBase . On Thu, 25 Sep 2008, Duncan Murdoch wrote: On 9/25/2008 3:33 PM, Jason Thibodeau wrote: Hello, Is there a simple way to take an input, and convert the decimal integers to binary? In this case, I have a CSV file, and I need to convert the first column of every lin

[R] Dot plot - equivalent of MINITAB

2008-09-25 Thread kerfuffle
hi folks, Bit of a newbie, but I've spent a fair bit of time looking for an answer on this, with no joy. Can anyone help me? Dataset: A single column of values in a csv file (eg. 52, 53, 54, 85, etc) Goal: In Minitab, you have what they call a dot plot. It's a histogram, where a single dot

Re: [R] Equivalent of 'first.var' or 'last.var' from SAS in R?

2008-09-25 Thread Matthew Pettis
Thanks to Peter and Phil, this was indeed my idea. On Thu, Sep 25, 2008 at 2:26 PM, Peter Dalgaard <[EMAIL PROTECTED]> wrote: > Matthew Pettis wrote: >> >> Hi, >> >> I want to sort a data frame by multiple columns and then take the >> first record in each unique level of the "by" group I used to s

Re: [R] Conversion to Binary (base2)

2008-09-25 Thread Duncan Murdoch
On 9/25/2008 3:33 PM, Jason Thibodeau wrote: Hello, Is there a simple way to take an input, and convert the decimal integers to binary? In this case, I have a CSV file, and I need to convert the first column of every line to binary. Yes, the intToBits function does what you want. It works wit

Re: [R] Conversion to Binary (base2)

2008-09-25 Thread Peter Dalgaard
Jason Thibodeau wrote: Hello, Is there a simple way to take an input, and convert the decimal integers to binary? In this case, I have a CSV file, and I need to convert the first column of every line to binary. Thanks. Not really (unless I missed it), sprintf will convert to hex but not bi

Re: [R] Confusion over syntax in a package

2008-09-25 Thread Prof Brian Ripley
See ?getAnywhere , and the description of NAMESPACE in 'Writing R Extensions'. getAnywhere("calc.dist") and ProbForecastGOP:::calc.dist both work for me. On Thu, 25 Sep 2008, Ryan Glover wrote: Hello, I am new to R and I am attempting to use the ProbForecastGOP package for some research I

[R] Conversion to Binary (base2)

2008-09-25 Thread Jason Thibodeau
Hello, Is there a simple way to take an input, and convert the decimal integers to binary? In this case, I have a CSV file, and I need to convert the first column of every line to binary. Thanks. -- Jason Thibodeau [[alternative HTML version deleted]] _

Re: [R] Saving R-objects to a database

2008-09-25 Thread Prof Brian Ripley
Presumably this about RMySQL, and by 'database' you mean a MySQL database, not e.g. a .rdb file? R-sig-db would be a better list, but I think this is one of many aspects of the DBI package that that not been updated to match improvements in R. On Thu, 25 Sep 2008, Christian Ruckert wrote: S

Re: [R] Equivalent of 'first.var' or 'last.var' from SAS in R?

2008-09-25 Thread Peter Dalgaard
Matthew Pettis wrote: Hi, I want to sort a data frame by multiple columns and then take the first record in each unique level of the "by" group I used to sort the data frame. Does someone have an example of how to do this? Thanks, Matt Something like this > aggregate(airquality,airqualit

[R] Confusion over syntax in a package

2008-09-25 Thread Ryan Glover
Hello, I am new to R and I am attempting to use the ProbForecastGOP package for some research I am conducting. The package works fine when I call the functions from the command line as the examples instruct. However, I am attempting to step through some of the functions so that I can obtain a be

[R] HOW to use the Hosmer–Lemeshow test ‏ in R

2008-09-25 Thread leo_wa
i want to know how to use the Hosmer–Lemeshow test‏ in R. Can anyone show me the program to me and tell me how to use it? -- View this message in context: http://www.nabble.com/HOW-to-use-the-Hosmer%E2%80%93Lemeshow-test%E2%80%8F-in-R-tp19675283p19675283.html Sent from the R help mailing list ar

[R] Equivalent of 'first.var' or 'last.var' from SAS in R?

2008-09-25 Thread Matthew Pettis
Hi, I want to sort a data frame by multiple columns and then take the first record in each unique level of the "by" group I used to sort the data frame. Does someone have an example of how to do this? Thanks, Matt -- It is from the wellspring of our despair and the places that we are broken th

Re: [R] R on Mandriva

2008-09-25 Thread Paul Bivand
You'll find that r-base and some packages are in the standard Mandriva repositories. However, Mandriva tends to fix its packages with its release dates. Mandriva 2008.1 has R 2.6.2 in repositories and the upcoming Mandriva 2009 (currently in release candidate) has 2.7.2 (but only base). If you have

Re: [R] Proper power computation for one-sided binomial tests.

2008-09-25 Thread Peter Dalgaard
Johannes Hüsing wrote: Am 23.09.2008 um 23:57 schrieb Peter Dalgaard: For this kind of problem I'd go directly for the binomial distribution. If the actual probability is 0, this is essentially deterministic and you can look at > binom.test(0,99,p=.03, alt="less") This means that you don

Re: [R] Repeated factor levels - inconsistency of factor and levels<- functions?

2008-09-25 Thread Honza Hucin
I have a vector x containing letters ("a", "b" etc.). Now I want to convert it to factor and group some letters into one common level. If I do it by factor function, giving the same label names for all values I want to group, it doesn't work: x<-letters[1:5] x [1] "a" "b"

Re: [R] Proper power computation for one-sided binomial tests.

2008-09-25 Thread Collin Lynch
Am 23.09.2008 um 23:57 schrieb Peter Dalgaard: > For this kind of problem I'd go directly for the binomial > distribution. If the actual probability is 0, this is essentially > deterministic and you can look at > > > binom.test(0,99,p=.03, alt="less") > > This means that you don't sample from the

Re: [R] Is there a way to add external variables to axis labels?

2008-09-25 Thread Eik Vettorazzi
Hi Arthur, I guess you can solve both 1) and 2) by examining ?bquote ?plotmath hth. Arthur Roberts schrieb: Hi, all, Thanks for all your help in the previous emails. Question 1: Is there a way to use external variables in the axis labels? Question 2: Is there a way to make this variable

Re: [R] Error message when calculating BIC

2008-09-25 Thread Donald Catanzaro, PhD
__ R-help@r-project.org 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] Two overlaid density plots - Does order matter?

2008-09-25 Thread stephen sefick
this is not reproducible, but this may be the answer-- R graphic devices are like a pen and paper when you plot something it is there on the piece of paper then when you plot something else on top of that then if there are any points that intersect with the first plot then they will be plotted on

Re: [R] Two overlaid density plots - Does order matter?

2008-09-25 Thread Eik Vettorazzi
Since you did not specify plotting limits (xlim, ylim) the plot-function automatically sets them to the range of your data, extended by some factor (depending on your axis style). If you draw another object afterwards with "line" this limits are not altered. So depending on the data range of the

Re: [R] Function for case insensitive match

2008-09-25 Thread Marc Schwartz
on 09/25/2008 11:11 AM Rajasekaramya wrote: > Hi there, > > I am just wondering if there is any function that could match the vectors > irrespective of the upper and lower case alphabets. > > Ramya See the 'ignore.case' argument in ?grep HTH, Marc Schwartz __

[R] nnet support

2008-09-25 Thread Tristan S B Fletcher
Dear Sir/Madam I have recently started using the nnet package but cannot find any documentation other than the one page titled 'nnet {nnet}' which is replicated several times over the internet and is found in the help file for this package. I would like more information on how to use the package

[R] Function for case insensitive match

2008-09-25 Thread Rajasekaramya
Hi there, I am just wondering if there is any function that could match the vectors irrespective of the upper and lower case alphabets. Ramya -- View this message in context: http://www.nabble.com/Function-for-case-insensitive-match-tp19672969p19672969.html Sent from the R help mailing list

[R] Two overlaid density plots - Does order matter?

2008-09-25 Thread Stephen Collins
In the following code, the only difference between the two plots is the order the variables are plotted. In this case, the plot of "cdata.den" in plot #1 is different from its plot in #2. Specifically, "cdata.den" spans the x-axis from -5 to 30 in plot #1 and from 0 to 20 in plot #2. Does anyo

Re: [R] levelplot/heatmap question

2008-09-25 Thread Deepayan Sarkar
On 9/24/08, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Hello! > I have data containing a large number of probabilities (about 60) of > nonzero coefficients to predict 10 different independent variables (in 10 > different BMA models). i've arranged these probabilities in a matrix like > so: > >

Re: [R] nnet support

2008-09-25 Thread Rory.WINSTON
The book "Modern Applied Statistics in S-Plus" has a section on using the nnet package. I believe it was originally created by the authors of the book. There are some other bits of literature with nnet examples, for instance www.liaad.up.pt/~ltorgo/DataMiningWithR/. HTH Rory -Original Me

Re: [R] grid.newpage()

2008-09-25 Thread Paulo Cardoso
Sorry but this is not printing both graphs in the same window and I can't figure why. grid.newpage() par(cex.axis=0.85,cex.lab=0.80,mai=c(1.3,1,0.5,0),las=3) pushViewport(viewport(layout=grid.layout(1,2))) pushViewport(viewport(layout.pos.row=1,layout.pos.col=1)) print( bplot<-barplot(bar.values,w

Re: [R] R Map using SAS data

2008-09-25 Thread Michael Friendly
Junjie, SAS map datasets are just ordinary data sets containing variables X, Y (lat/long), a region ID variable, perhaps a DENSITY variable (used to select lower-resolution versions), and perhaps a SEGMENT variable if a region has two or more disconnected polygons. For some maps, there is anot

Re: [R] What distribution is related to hypergeometric?

2008-09-25 Thread Ted Byers
> I have weekly samples of two kinds of events: call them A and B. I have a count of A events. These > change dramatically from one week to the next. I also have weekly counts > of B events that I can relate > to A events. Some fraction 'lambda' (between 1 and 1) of A events will > result in

[R] grid.newpage()

2008-09-25 Thread Paulo Cardoso
Hi, I'm trying to customize a window with 2 graphs. I'm able to do the first one with something like this general example par(mfrow=c(1,2),cex.axis=0.85,cex.lab=0.80,mai=c(1.3,1,0.5,0),las=3) bplot<-barplot(bar.values,names.arg=cf.names,width=0.5,ylab="% Area held") abline(h=0.3,lty=3,col="red")

[R] What distribution is related to hypergeometric?

2008-09-25 Thread Ted Byers
I have been reading, in various sources, that a poisson distribution is related to binomial, extending the idea to include numbers of events in a given period of time. In my case, the hypergeometric distribution seems more appropriate, but I need a temporal dimension to the distribution. I have

[R] Matrix _0.999375-14 "Note" under CRAN Check, Hmisc_3.4-3 has "Warning", Dpackage_1.0-5 has an "Error"

2008-09-25 Thread n . manganaro
Sorrry for re-sending this message as 1) a non-subscriber initially, then 2) from an un-subscribed e-mail. As context, I am a newbie, but preparing for a moderately deep dive into new areas af analysis while becoming familiar with R, at the same time. I have looked at the dependencies, amd im

[R] restricting lattice pages to one

2008-09-25 Thread John Fox
Dear list members, I'd like to be able to restrict the number of pages in a lattice display to one without having to specify explicity the number of rows and columns in the display -- that is, having forced one page, I'd like the number of rows and columns to be determined automatically. For exam

Re: [R] Changing a plot

2008-09-25 Thread Ben Bolker
R Help wrote: > Thanks, I looked into the grid package. The grid package does do a > better job of managing the plotting, but it's still re-plotting the > entire canvas whenever a modifcation is made to a plot. > > I guess I should have been a little clearer with my question. Here's > a sample f

Re: [R] Changing a plot

2008-09-25 Thread Peter Dalgaard
R Help wrote: > Thanks, I looked into the grid package. The grid package does do a > better job of managing the plotting, but it's still re-plotting the > entire canvas whenever a modifcation is made to a plot. > > I guess I should have been a little clearer with my question. Here's > a sample fu

Re: [R] Repeated factor levels - inconsistency of factor and levels<- functions?

2008-09-25 Thread Peter Dalgaard
Honza Hucin wrote: > Hello, > > I have a vector x containing letters ("a", "b" etc.). Now I want to > convert it to factor and group some letters into one common level. If I do > it by factor function, giving the same label names for all values I want > to group, it doesn't work: > > >> x<-lette

[R] Saving R-objects to a database

2008-09-25 Thread Christian Ruckert
Someone solved the problem of saving R-objects to a database? These are the two varaints I've tried so far without success: 1) ser = rawToChar(serialize(obj, NULL, ascii=TRUE)) dbSendQuery(link, paste("insert into table values(1, '",ser,"')",sep='')) The field to save the object in the MySQL Da

Re: [R] Changing a plot

2008-09-25 Thread R Help
Thanks, I looked into the grid package. The grid package does do a better job of managing the plotting, but it's still re-plotting the entire canvas whenever a modifcation is made to a plot. I guess I should have been a little clearer with my question. Here's a sample function. library(tcltk) x

Re: [R] OHLC Plot with EMA in it

2008-09-25 Thread Dirk Eddelbuettel
On Thu, Sep 25, 2008 at 03:44:21PM +0200, Michael Zak wrote: > I have some timeseries data which I plot in a OHLC Plot. In the same > plot I'd like to have the EMA of this timeseries. I tried to add the EMA > point to OHLC with lines(), but this doesn't work. Has anyone an idea how > to handle

Re: [R] OHLC Plot with EMA in it

2008-09-25 Thread Adaikalavan Ramasamy
Can you give us a simple example which produces the same behavior? Michael Zak wrote: Hi there I have some timeseries data which I plot in a OHLC Plot. In the same plot I'd like to have the EMA of this timeseries. I tried to add the EMA point to OHLC with lines(), but this doesn't work. Has

Re: [R] Exclusion of elements in a vector

2008-09-25 Thread Gabor Grothendieck
Try this: vector[ setdiff(seq_along(vector), as.numeric(idx)) ] where idx is your vector of indices to exclude, e.g. idx <- 3:4 idx <- numeric(0) idx <- NULL The last one gets converted to numeric(0) by as.numeric so it still works. On Thu, Sep 25, 2008 at 7:43 AM, Stefan Fritsch <[EMAIL PROTEC

[R] nnet support

2008-09-25 Thread Tristan S B Fletcher
Hi I have recently started using the nnet package but cannot find any documentation other than the one page titled 'nnet {nnet}' which is replicated several times over the internet and is found in the help file for this package. I would like more information on how to use the package and have sea

[R] Odp: Graphics winder keeps disappearing!

2008-09-25 Thread Petr PIKAL
Hi what dev.cur() If it is something like pdf 3 your plot is transfered to this device not to standard windows device (if you are on Windows), so dev.off( ) close current device and you probably can do intended plotting again. See Devices help page. Regards Petr [EMAIL PROTECTED] nap

[R] Repeated factor levels - inconsistency of factor and levels<- functions?

2008-09-25 Thread Honza Hucin
Hello, I have a vector x containing letters ("a", "b" etc.). Now I want to convert it to factor and group some letters into one common level. If I do it by factor function, giving the same label names for all values I want to group, it doesn't work: > x<-letters[1:5] > x [1] "a" "b" "c" "d" "e" >

[R] OHLC Plot with EMA in it

2008-09-25 Thread Michael Zak
Hi there I have some timeseries data which I plot in a OHLC Plot. In the same plot I'd like to have the EMA of this timeseries. I tried to add the EMA point to OHLC with lines(), but this doesn't work. Has anyone an idea how to handle it? Regards, Michael Zak

Re: [R] Error message when calculating BIC

2008-09-25 Thread Ben Bolker
Donald Catanzaro, PhD gmail.com> writes: > > Hi All, > > Could someone help me decode what this error means ? > > BIC(nb.80) > Error in log(attr(object, "nobs")) : > Non-numeric argument to mathematical function > > > > BTW, nb.80 is a negative binomial glm model created using the MASS > li

  1   2   >