Re: [R] Re: Bar plot with variable width (down a drill hole) - nowmissing intervals?

2003-03-26 Thread Marc Schwartz
Phillip J. Allen wrote: Hi again, Thanks Ted and Marc its works. But of course after pulling in in some real life data I discoverd one hitch. Often there are missing intervals. For example: from <- c(0, 1.2, 4.0, 4.2, 5.0, 25.0, 30.1, 45) to <- c(1.2, 4.0, 4.2, 5.0, 25, 30.1, 36.2, 50) intens

Re: [R] a statistic question about chisq.test()

2003-03-26 Thread kjetil brinchmann halvorsen
On 26 Mar 2003 at 13:35, aprilsun wrote: First, look at the expected values under the null. If only a few are below 5 and all are above 1 there are probably no problem. Second, you can use chisq.test with the argument simulate.p.value=TRUE Kjetil Halvorsen > Hi, > In the chisq.test(), if the

Re: [R] Categorical data (Monte Carlo exact p-value)

2003-03-26 Thread kjetil brinchmann halvorsen
On 26 Mar 2003 at 22:25, Jorge Magalhães wrote: Does ?mantelhaen.test do what you want? (it is in package ctest). Kjetil Halvorsen > In R program, I can perform categorical data test analysis like Odds ratio > test in stratified 2x2 contingency tables? I do that in statistical package > Sta

RE: [R] a statistic question about chisq.test()

2003-03-26 Thread Wiener, Matthew
One other option. I usually find that when I do the chisq.test with exact p-value calculation, I find the p-values are nearly identical to the results when I use the approximation and get the warnings (I'm usually dealing with just a few bins with less than 5, and many bins with more than 5). So

Re: [R] R TclTk iwidgets::combobox

2003-03-26 Thread James Wettenhall
Thanks Peter, I've started a new R session (in Windows) and managed to get both ways working now : ### THIS WORKS !!! ### library(tcltk) tclRequire("IWidgets") tt<-tktoplevel() combo <- tkwidget(tt,"iwidgets::combobox") tkpack(combo) ### AND THIS WORKS TOO !!! ### tt<-tktoplevel() win <- .Tk.s

Re: [R] Categorical data (Monte Carlo exact p-value)

2003-03-26 Thread Spencer Graves
A search in the standard R documentation for "Fisher's exact test" reveals a command "fisher.test", and a search for "Chi-square" reveals a "chisq.test". Spencer Graves Jorge Magalhães wrote: In R program, I can perform categorical data test analysis like Odds ratio test in stratified 2x2 co

Re: [R] nls

2003-03-26 Thread Spencer Graves
Have you tried using "optim"? An article in the Americal Statistician said that in S-Plus, "nls" often had convergence problems that could be solved by first using "nlminb" and then using the output of "nlminb" as starting values for "nls". R is not S-Plus, but it's possible that "nls" may have

Re: [R] nls

2003-03-26 Thread Komanduru Sai C
Hi, df <- read.table("data.txt", header=T); library(nls); fm <- nls(y ~ a*(x+d)^(-b), df, start=list(a=max(df->y,na.rm=T)/2,b=1,d=0)); I was using the following routine which was giving Singular Gradient, Error in numericDeriv(form[[3]], names

[R] R TclTk iwidgets::comboboc

2003-03-26 Thread James Wettenhall
Hi, I am trying to create a drop-down combobox in R TclTk. The following works fine for a ListBox but fails for a combobox: # THIS WORKS FINE - CREATES AN EMPTY LISTBOX ## tt<-tktoplevel() win <- .Tk.subwin(tt) .Tcl(paste("listbox",.Tk.ID(win),.Tcl.args())) tkpack(win) ###

[R] Categorical data (Monte Carlo exact p-value)

2003-03-26 Thread Jorge Magalhães
In R program, I can perform categorical data test analysis like Odds ratio test in stratified 2x2 contingency tables? I do that in statistical package StatXact, but i would like perform the same test in R environment. Thanks very much Jorge Magalhães _

Re: [R] a statistic question about chisq.test()

2003-03-26 Thread Uwe Ligges
aprilsun wrote: > > Hi, > In the chisq.test(), if the expected frequency for some categories is <5, there will > be a warning message which says > Warning message: > Chi-squared approximation may be incorrect in: chisq.test(x, p = probs) It's a warning message, not an error. It point's you to th

RE: [R] hist overlay...

2003-03-26 Thread Vasudevan, Geetha
Cool, thanks! -Original Message- From: Ross Ihaka [mailto:[EMAIL PROTECTED] Sent: Wed 3/26/2003 12:26 PM To: Vasudevan, Geetha Cc: [EMAIL PROTECTED] Subject:Re: [R] hist overlay... Vasudevan, Geetha wrote: > thanks to all for the 2d scatter plot. > > i have one more.

Re: [R] hist overlay...

2003-03-26 Thread Ross Ihaka
Vasudevan, Geetha wrote: thanks to all for the 2d scatter plot. i have one more. how do i plot 'hist(y1, col="red") and hist(y2,col="blue") in the same window? Here are a couple of ways to do what you have asked for (as oppposed to want you want :-). I'm assuming that you precompute the histogr

Re: [R] hist overlay...

2003-03-26 Thread Jerome Asselin
Do you mean two separate plots in the same window? If so, read the documentation on "multiple figure environment" in the chapter on "Graphical Procedures" in the manual "An Introduction to R". Alternately, reading plot help file will lead you to the par help file, which will enable you to do "

[R] a statistic question about chisq.test()

2003-03-26 Thread aprilsun
Hi, In the chisq.test(), if the expected frequency for some categories is <5, there will be a warning message which says Warning message: Chi-squared approximation may be incorrect in: chisq.test(x, p = probs) I am wondering whether there are some methods to get rid of this mistake... Seems the

[R] hist overlay...

2003-03-26 Thread Vasudevan, Geetha
thanks to all for the 2d scatter plot. i have one more. how do i plot 'hist(y1, col="red") and hist(y2,col="blue") in the same window? thanks again. __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help

Re: [R] 2 scatter plots in the same graphic window....

2003-03-26 Thread Spencer Graves
x1 <- 1:9 y1 <- x1 x2 <- x1 y2 <- 9-x1 plot(c(0, 9), c(0, 9), type="n") points(x1, y1, col=1, pch=1) points(x2, y2, col=2, pch=2) Is this what you want? Spencer Graves Vasudevan, Geetha wrote: Hello, I am trying to do a scatter plot of x1,y1 and x2,y2 in the same graphics window with diff col/pch

Re: [R] 2 scatter plots in the same graphic window....

2003-03-26 Thread Ben Bolker
Either n1 <- length(x1) n2 <- length(x2) plot(c(x1,x2),c(y1,y2),col=rep(c(1,2),c(n1,n2)), pch=rep(c(1,2),c(n1,n2)) OR plot(x1,y1,xlim=range(c(x1,x2)),ylim=range(c(y1,y2)),col=1,pch=1) points(x2,y2,col=2,pch=2) will work. Ben Bolker On Wed, 26 Mar 2003, Vasudevan, Geetha wrote: > Hello,

RE: [R] 2 scatter plots in the same graphic window....

2003-03-26 Thread Henrik Bengtsson
plot() and points(), e.g. x <- matrix(rnorm(300), ncol=3) plot(x[,1],x[,2], pch=1, col="red") points(x[,1],x[,3], pch=2, col="blue") Cheers Henrik Bengtsson Lund University > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of > Vasudevan, Geetha > Se

[R] 2 scatter plots in the same graphic window....

2003-03-26 Thread Vasudevan, Geetha
Hello, I am trying to do a scatter plot of x1,y1 and x2,y2 in the same graphics window with diff col/pch values. i cannot get it to do them in the same window. what is the cmd to do this? thanks. __ [EMAIL PROTECTED] mailing list https://www.stat.mat

[R] Simple NLME problem (I hope)

2003-03-26 Thread Vumani Dlamini
Dear R-Users: I would like to fit a multilevel model using LME such that the parameters after fitting the multilevel in two separate groups and when I use the complete data (with interactions between the grouping variable and the other variables) set are comparable (or the same). The problem I

[R] Interest Calculator for Lawyers

2003-03-26 Thread David James Thorpe JD
Have you ever been in this situation? You are representing a client who is supposed to receive a monthly payment. On some months, that payment has been made on time, but on other months it has been paid late and often not at all. Your client is entitled to interest on amounts owing, but figuring o

[R] Interest Calculator for Lawyers

2003-03-26 Thread David James Thorpe JD
Have you ever been in this situation? You are representing a client who is supposed to receive a monthly payment. On some months, that payment has been made on time, but on other months it has been paid late and often not at all. Your client is entitled to interest on amounts owing, but figuring o

Re: [R] Spatial Clustering

2003-03-26 Thread Spencer Graves
Did you look at library(cluster) in R? Spencer Graves Philippe Hupé wrote: Hello, Does anyone know any package which can perform spatial clustering ? Thanks. __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help

Re: [R] Spatial Clustering

2003-03-26 Thread Roger Bivand
On Wed, 26 Mar 2003, Philippe Hupé wrote: > Hello, > > Does anyone know any package which can perform spatial clustering ? > That depends on what you mean by spatial clustering? Of points on a plane, maybe - if so, spatial, spatstat, and splancs offer functions. In the environmental data domai

Re: [R] Solving equations

2003-03-26 Thread Spencer Graves
What do you mean "solve"? Do you want to solve for "t" in f(t) = A*exp(B*t), where A and B are given square matrices? Is "t" a scalar or also a square matrix or something else, and does "*" refer to element-wise multiplication (as in R) or matrix multiplication (written "%*%" in R)? Su

RE: [R] RODBC and Excel in Widows

2003-03-26 Thread Tom Mulholland
I routinely use Excel to store my data. I am using 1.6.2 and probably have the latestet RODBC. I recall when I first started using it having similar problems. If I recall correctly the solution (which I didn't identify precisely) was to make sure that my spreadsheet didn't have any abnormal cells.

[R] Spatial Clustering

2003-03-26 Thread Philippe Hupé
Hello, Does anyone know any package which can perform spatial clustering ? Thanks. __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help

RE: [R] RODBC and Excel in Widows

2003-03-26 Thread ripley
Why don't you debug the code and send the patch needed to the maintainer? R is supposed to be a collaborative project, and we need more contributors, especially on Windows. Looking forwards to your positive contribution On Wed, 26 Mar 2003, r.ghezzo wrote: > HI, > no sorry, so far nobody

Re: [R] RODBC and Excel in Widows

2003-03-26 Thread David Meyer
You might look at Thomas Baier's DCOM interface as an alternative to the odbc-method for accessing EXCEL-files. -d "r.ghezzo" wrote: > > HI, > no sorry, so far nobody answer. So it probably does not have a solution. > Excell is from you.know.who > > >= Original Message From Meinhard Plone

[R] CMDS

2003-03-26 Thread Heeringa W.J.
Dear statisticians, I have a small question about the Classifical Multidimensional scaling routine in R. Is this procedure always metric? Best regards, Wilbert Heeringa __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/

RE: [R] RODBC and Excel in Widows

2003-03-26 Thread r.ghezzo
HI, no sorry, so far nobody answer. So it probably does not have a solution. Excell is from you.know.who >= Original Message From Meinhard Ploner <[EMAIL PROTECTED]> = >Hello! >Did you resolve the problem? >I'm interested in the solution, too. >Meinhard > >On Thursday, March 13, 2003, a

Re: [R] Plotting K-M Curve when have several strata

2003-03-26 Thread David Barron
You could try something like: plot(foo[1],conf.int=TRUE) par(new=TRUE) plot(foo[2],conf.int=TRUE,col=2) Seems to work! David - Original Message - From: "Ko-Kang Kevin Wang" <[EMAIL PROTECTED]> To: "R Help" <[EMAIL PROTECTED]> Sent: Wednesday, March 26, 2003 12:13 PM Subject: [R] Plottin

[R] Plotting K-M Curve when have several strata

2003-03-26 Thread Ko-Kang Kevin Wang
Hi, If I have: foo <- survfit(y ~ x) where y is a survival object and x is a n-level factor. The documentation says when I plot(foo), the confidence intervals will not be plotted (which I guess is understandable as otherwise the plot will get really messy). I tried to plot with confidence

[R] Solving equations

2003-03-26 Thread schlegel
Hello, Does somebody knows if there exists a function which solves a set of equation, say f(vars), for the variables vars (similar to Solve in mathematica). The functions I am considering are of the form f(t) ~ A*exp(B*t), where A and B are matrices. Thanks Thomas ___

Re: [R] ifelse()

2003-03-26 Thread Martin Maechler
> "Jason" == Jason Turner <[EMAIL PROTECTED]> > on Wed, 26 Mar 2003 22:49:27 +1200 writes: Jason> On Wed, Mar 26, 2003 at 11:20:04PM +1200, Ko-Kang Jason> Kevin Wang wrote: >> Hi, >> >> I'm not sure if this can be done but.. >> >> I know that with ifelse()

RE: [R] Re: Bar plot with variable width (down a drill hole) - n

2003-03-26 Thread Ted Harding
On 26-Mar-03 Ted Harding wrote: > On 25-Mar-03 Phillip J. Allen wrote: > However, this kind of situation needs thought about alternative > ways of representing it. > > One possibility might be to have the vertical axis invisible, > so that gaps in the data are represented by gaps in the axis > (an

[R] Re: ifelse()

2003-03-26 Thread Ko-Kang Kevin Wang
Hi, I've found a much better solution than using ifelse(). I found about cut() from MASS4 Page 383, which actually does a better job . On Wed, 26 Mar 2003, Ko-Kang Kevin Wang wrote: > Date: Wed, 26 Mar 2003 23:20:04 +1200 (NZST) > From: Ko-Kang Kevin Wang <[EMAIL PROTECTED]> > To: R Help <[EMA

Re: [R] ifelse()

2003-03-26 Thread Jason Turner
On Wed, Mar 26, 2003 at 11:20:04PM +1200, Ko-Kang Kevin Wang wrote: > Hi, > > I'm not sure if this can be done but.. > > I know that with ifelse() I can do something like: > ifelse(x <= 3, 1, 2) > to go through each element in my vector x, and if x_i <= 3 substitute the > number with 1 else wi

[R] ifelse()

2003-03-26 Thread Ko-Kang Kevin Wang
Hi, I'm not sure if this can be done but.. I know that with ifelse() I can do something like: ifelse(x <= 3, 1, 2) to go through each element in my vector x, and if x_i <= 3 substitute the number with 1 else with 2. Essentially I'll get a vector with 2 levels. Can I tweak it so I can get 3-l

RE: [R] Re: Bar plot with variable width (down a drill hole) - n

2003-03-26 Thread Ted Harding
On 25-Mar-03 Phillip J. Allen wrote: > Thanks Ted and Marc its works. But of course after pulling in in some > real life data I discoverd one hitch. Often there are missing > intervals. For example: > from <- c(0, 1.2, 4.0, 4.2, 5.0, 25.0, 30.1, 45) > to <- c(1.2, 4.0, 4.2, 5.0, 25, 30.1, 36.2

RE: [R] How to write the output of a function into a file?

2003-03-26 Thread Gavin Simpson
does sink() do what you want? see ?sink for more > #divert printed results to file > sink(file = output.txt) > #commands here > chisq.test(x,p=probs) > #turn off sink > sink(file = NULL) If you are not typing the commands at the prompt but are using an external editor or text file for your comm