Re: [R] Pros and Cons of R

2008-05-24 Thread cls59
R is definitely an excellent environment for data analysis and display. It has quickly become the tool that I use to bind together different models and process the resulting data into reports and graphics. The Sweave package can be especially useful for accomplishing this. R has also been integra

Re: [R] Simulating the p-value of a test statistic

2008-05-24 Thread markleeds
Thanks Duncan. The person didn't mention the exponential in their private email to me so I was pretty confused. Now, I'm unconfused. On Sat, May 24, 2008 at 10:02 PM, Duncan Murdoch wrote: [EMAIL PROTECTED] wrote: The context is "goodness-of-fit techniques" Suppose I want to know whether

Re: [R] Simulating the p-value of a test statistic

2008-05-24 Thread markleeds
i think you should resend your question to the list (but this is sounding more and more like a homework problem so i don't know if you will get much response. all i'll say is that P(T > t ) = 1 - P( T < t ). But P( T < t ) is the cumulative distribution of T ( and any random variable ) is u

Re: [R] Simulating the p-value of a test statistic

2008-05-24 Thread Duncan Murdoch
[EMAIL PROTECTED] wrote: The context is "goodness-of-fit techniques" Suppose I want to know whether a sample of data comes from say an exponential distribution or not. I have a test statistic T, but I do not know its cummulative distribution. Suppose an observed value of T is t How do I f

Re: [R] Simulating the p-value of a test statistic

2008-05-24 Thread markleeds
hi: you simulate the distribution of the test statistic by simulating the hypothesis test over and over and calculating the test statistic each time. the details of how you simulate the hypothesis test depends on the particular problem you are dealing with but you didn't describe that. if you d

Re: [R] Simulating the p-value of a test statistic

2008-05-24 Thread Duncan Murdoch
[EMAIL PROTECTED] wrote: Dear Friends, I want to know if any one could give me help on this. Suppose you want to simulate the p-value of a test statistic but you do not know how the distribution of the test statistic, how can one simulate the p-value. It will be helpful to get an example c

Re: [R] Solving 100th order equation

2008-05-24 Thread Bill.Venables
Oops! Actually spectacularly bad. I didn't see the positive exponent! Curiously, there appears to be just one bad apple: > sort(Mod(p(z))) [1] 1.062855e-10 1.062855e-10 1.328999e-10 1.328999e-10 2.579625e-10 [6] 2.579625e-10 3.834721e-10 3.834721e-10 3.875288e-10 3.875288e-10 [11] 5.287459

Re: [R] Solving 100th order equation

2008-05-24 Thread Bill.Venables
> library(PolynomF) > x <- polynom() > p <- x^100 - 2*x^99 + 10*x^50 + 6*x - 4000 > z <- solve(p) > z [1] -1.0741267+0.000i -1.073-0.0680356i -1.073+0.0680356i -1.0655699-0.1354644i [5] -1.0655699+0.1354644i -1.0568677-0.2030274i -1.0568677+0.2030274i -1.0400346-0.2687815i ...

Re: [R] Solving 100th order equation

2008-05-24 Thread Gabor Grothendieck
Actually maybe I was premature. It does not handle the polynomial I tried it on in the example earlier in this thread but it does seem to work with the following very simple polynomials of order 100. At any rate it would not take long to try it on the real problem and see. > Solve(x^100 - 1, x) [

Re: [R] Advise in R- plotting graphs

2008-05-24 Thread S Ellison
Jason Lee-14 wrote: > > I want to plot "V1" against "V2" with the condition that I > want to mark(color) the point(row 5) on the graph. This is so i could see > some triangle shape thing on the graph for row 5. > > You could try something crude like plot(V1,V2, col=ifelse( (1:length(V1)) ==

[R] Simulating the p-value of a test statistic

2008-05-24 Thread ampad1cb
Dear Friends, I want to know if any one could give me help on this. Suppose you want to simulate the p-value of a test statistic but you do not know how the distribution of the test statistic, how can one simulate the p-value. It will be helpful to get an example code in R on this Respectful

Re: [R] Binning groups

2008-05-24 Thread David Winsemius
> On Thu, 22 May 2008, francogrex wrote: > > Hi, this is probably quite simple but I can't seem to do it correctly. I > have > a data frame of counts of infections in different ages; something like: > count=c(1, 1, 1, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 4, 7, 8, 8, 9, 9, > 10, 11, 15, 17, 17, 17, 1

[R] gray grid on quartz()

2008-05-24 Thread Angel Berihuete Macías
Hello everybody. Recently I update from R6.3 to R7.0 on Mac OS X, and an ugly gray grid appear when I use the function image() or pdf() What I am doing wrong? Thank's for your help, Ángel. __ R-help@r-project.org mailing list https://stat.ethz.ch

Re: [R] RSPerl & OS X

2008-05-24 Thread Duncan Temple Lang
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 DavidM.UK wrote: | Hi, | | I'm wanting to call R from Perl via the RSPerl package. However I cannot | seem to install it on my Macbook (OS X Tiger - R 2.6 - Perl 5.8.6). I try to | install the source downloaded from the sigmahat website - but it see

[R] R-Excel Macro Problem

2008-05-24 Thread nmarti
I'm trying to write R functions into VBA code. I've done this many other times in other documents and everything has run great. But today I keep recieving an error message "Run-time error '1004': Application-defined or object-defined error." Has anyone else encountered this same error message?

Re: [R] Pros and Cons of R

2008-05-24 Thread Kingsford Jones
On Sat, May 24, 2008 at 10:26 AM, DavidM.UK <[EMAIL PROTECTED]> wrote: > > I think one significant problem is the lack of 3D graphics support with > interactivity as per MATLAB ( I here Xgobi offers something hear but I > couldn't comment having not used it) Have you tried the rgl package? instal

[R] simulated annealing

2008-05-24 Thread Felipe
1. Most of the neighbors of a low cost state, x, may have much higher costs; and 2. The problem is highly degenerate in the sense that there are states, x, with a large (sub) neighborhood of equal cost states, S(x) = fy inside N(x) and f(y) = f(x). In this case, even rejecting all the proposals tha

Re: [R] solving 10oth-order polynom

2008-05-24 Thread Carl Witthoft
I'm one of the many who is far more interested in the reason for the request than in the numerical method to use. The way I see it, the methodology of, say, polyroot() suffices in a mathematical sense. If your coefficients are mathematically exact (as opposed to measured values), the near-si

[R] how to perform a uniform distribution

2008-05-24 Thread mohamed nur anisah
Dear R-users, I have a data which is in an interval length of start-end. How am i going to perform a uniform distribution? and how to test if it is the uniform distribution?? Suggestion is needed. Many thanks!! start end 132955984 132980744 135891280 135998880 156158176

Re: [R] GARCH-like

2008-05-24 Thread DavidM.UK
Renato, As you may know the two routines for fitting GARCH models are garchFit [fGarch] and garch [tseries]. The RMetrics [who are behind the fGarch library] team have usefully provided a white paper on Garch modeling available from their website, which includes a simple example of how to fit a G

[R] RSPerl & OS X

2008-05-24 Thread DavidM.UK
Hi, I'm wanting to call R from Perl via the RSPerl package. However I cannot seem to install it on my Macbook (OS X Tiger - R 2.6 - Perl 5.8.6). I try to install the source downloaded from the sigmahat website - but it seems to fail - when I search my system for R.pm - I can't find it? Something

Re: [R] Pros and Cons of R

2008-05-24 Thread DavidM.UK
I think one significant problem is the lack of 3D graphics support with interactivity as per MATLAB ( I here Xgobi offers something hear but I couldn't comment having not used it) On the GUI issue, I'm split - once you get used to R then it's great just to use the command line - but as a language

Re: [R] Advise in R- plotting graphs

2008-05-24 Thread Ista Zahn
> > > From: "Jason Lee" <[EMAIL PROTECTED]> > Date: May 23, 2008 10:06:18 AM EDT > To: r-help@r-project.org > Subject: [R] Fwd: Advise in R- plotting graphs > > > Hi > > I tried and it is not what im looking .. > > I basically issue plot(data$"V1",data$"V2") as the matrix have the two > headers..Bu

Re: [R] Evaluation "conflict" in combination of replicate() and rexp()as variable inside a function

2008-05-24 Thread Prof Brian Ripley
Don't use replicate() like this. You have '...' in your *expression*, and it really should only be used in the body of a function. But if you want to understand why debug(rexp) rdistr <- function(distr, ...) replicate(1, distr(n = 1, ...)) rdistr(rexp) debugging in: distr(n = 1, ...) debug:

Re: [R] exrpression(), double subscript

2008-05-24 Thread Afshartous, David
thanks Uwe, I wanted the first thing you mentioned so that solves it. -Original Message- From: Uwe Ligges [mailto:[EMAIL PROTECTED] Sent: Sat 5/24/2008 10:42 AM To: Afshartous, David Cc: r-help@r-project.org Subject: Re: [R] exrpression(), double subscript Afshartous, David wrote:

Re: [R] R outside of universities

2008-05-24 Thread Roland Rau
Hi, Antony Unwin wrote: R has spread far and wide with great success. It is not only used extensively in universities, but also apparently in governmental organisations and in industry. As the recent discussion of R's Pros and Cons shows, there are many reasons for this. It would be in

Re: [R] Solving 100th order equation

2008-05-24 Thread Spencer Graves
Robert A LaBudde wrote: At 07:58 AM 5/24/2008, Duncan Murdoch wrote: Shubha Vishwanath Karanth wrote: To apply uniroot I don't even know the interval values... Does numerical methods help me? Or any other method? I forgot: we also have polyroot(). Duncan Murdoch Thanks and Regards, Shub

Re: [R] Solving 100th order equation

2008-05-24 Thread Spencer Graves
Consider the following: library(polynomial) p100 <- polynomial(1:101) s100 <- solve(p100) p100r <- 101*poly.calc(s100, tol=.Machine$double.eps) max(abs(coef(p100r)-(1:101))) 550767713 For order 2, it worked perfectly: (p2 <- polynomial(1:3)) (s2 <- solve(p2)) (p2r <- 3*poly.calc(s2)) ma

Re: [R] Solving 100th order equation

2008-05-24 Thread Robert A LaBudde
At 07:58 AM 5/24/2008, Duncan Murdoch wrote: Shubha Vishwanath Karanth wrote: To apply uniroot I don't even know the interval values... Does numerical methods help me? Or any other method? I forgot: we also have polyroot(). Duncan Murdoch Thanks and Regards, Shubha -Original Message--

Re: [R] exrpression(), double subscript

2008-05-24 Thread Uwe Ligges
Afshartous, David wrote: All, The first use of expression produces a double subscript while the second does not. I searched in ?plotmath and the archives and didn't find anything. I'm sure I'm missing something obvious but can't seem to find. any suggestions much appreciated. Cheers, D

Re: [R] Spatial Overlay - SQL - Geoprocessing

2008-05-24 Thread Roger Bivand
Paulo Cardoso netcabo.pt> writes: > > Can we by any change perform in R something similar geoprocessing or, more > advanced, Spatial SQL over vectorial data? Please visit the Spatial task view on your nearest CRAN mirror, which gives some details of useful resources. Consider using the R-sig-ge

Re: [R] [slightly off topic] Sweave with markdown

2008-05-24 Thread baptiste Auguié
Thank you all, I think I have a good list of options now. The best suited to my personal taste seems to be the Brew package, which I completely overlooked until I looked at the source examples. If I can persuade my text editor (textmate) to recognize the markup and also execute the R chunks

Re: [R] Solving 100th order equation

2008-05-24 Thread Shubha Vishwanath Karanth
Was also wondering which theoretical method is used to solve this problem? Thanks, Shubha Karanth | Amba Research Ph +91 80 3980 8031 | Mob +91 94 4886 4510 Bangalore * Colombo * London * New York * San José * Singapore * www.ambaresearch.com -Original Message- From: Gabor Grothendieck

Re: [R] maximizing the gamma likelihood

2008-05-24 Thread Mark Leeds
Thanks Xiaohui. I saw your solution a few days ago but only now realize what you're doing. It didn't at the time make sense to me to use the density from R directly. Now, I get it. The solution you get also make sense because the par[2] is ~ 1/par[1] which is what the analytical MLEs imply.

Re: [R] Solving 100th order equation

2008-05-24 Thread Gabor Grothendieck
On Sat, May 24, 2008 at 8:31 AM, Peter Dalgaard <[EMAIL PROTECTED]> wrote: > Shubha Vishwanath Karanth wrote: >> >> To apply uniroot I don't even know the interval values... Does numerical >> methods help me? Or any other method? >> >> Thanks and Regards, >> Shubha >> >> -Original Message-

[R] R outside of universities

2008-05-24 Thread Antony Unwin
R has spread far and wide with great success. It is not only used extensively in universities, but also apparently in governmental organisations and in industry. As the recent discussion of R's Pros and Cons shows, there are many reasons for this. It would be interesting to know just how

Re: [R] problem using embedded R

2008-05-24 Thread Prof Brian Ripley
We don't support Windows 2000, so you will have to produce your own workaround. But the relevant code is PATH <- Sys.getenv("PATH") Sys.setenv(PATH = paste(gsub("/", "", DLLpath), PATH, sep=";")) on.exit(Sys.setenv(PATH = PATH)) so I think the issue is that you did

Re: [R] Solving 100th order equation

2008-05-24 Thread Peter Dalgaard
Shubha Vishwanath Karanth wrote: To apply uniroot I don't even know the interval values... Does numerical methods help me? Or any other method? Thanks and Regards, Shubha -Original Message- From: Duncan Murdoch [mailto:[EMAIL PROTECTED] Sent: Saturday, May 24, 2008 5:08 PM To: Shubha

Re: [R] Solving 100th order equation

2008-05-24 Thread Prof Brian Ripley
See ?polyroot. However, the numerical stability for such a high-order problem is almost certainly a serious issue. On Sat, 24 May 2008, Shubha Vishwanath Karanth wrote: To apply uniroot I don't even know the interval values... Does numerical methods help me? Or any other method? Thanks and

Re: [R] combine elements of list into a vector

2008-05-24 Thread jim holtman
Can you tell me what is wrong with the output. Given the values in the list, the 'unlist' appears to have created the correct values. Now when I do it, it does print out the vector in this format: > unlist(x) [1] 6978022 10249966 10955201 11045352 11814604 13847633 16022770 23625856 29

Re: [R] Solving 100th order equation

2008-05-24 Thread John Sorkin
Shubba, It is hard to imagine why you would want to solve a 100th order equation. You might want to make absolutely certain that you are thinking about the correct problem. What are you trying to do? To do what you want you will need a very large dataset. Perhaps you need to fit some time of smooth

Re: [R] Solving 100th order equation

2008-05-24 Thread Duncan Murdoch
Shubha Vishwanath Karanth wrote: To apply uniroot I don't even know the interval values... Does numerical methods help me? Or any other method? I forgot: we also have polyroot(). Duncan Murdoch Thanks and Regards, Shubha -Original Message- From: Duncan Murdoch [mailto:[EMAIL P

Re: [R] Solving 100th order equation

2008-05-24 Thread Duncan Murdoch
Shubha Vishwanath Karanth wrote: To apply uniroot I don't even know the interval values... Does numerical methods help me? Or any other method? How about plotting the function? If you write it as f(x) = x^100 - ... - 6*x - 4000, then clearly f(0) is negative, and large enough x will be pos

Re: [R] Solving 100th order equation

2008-05-24 Thread Shubha Vishwanath Karanth
To apply uniroot I don't even know the interval values... Does numerical methods help me? Or any other method? Thanks and Regards, Shubha -Original Message- From: Duncan Murdoch [mailto:[EMAIL PROTECTED] Sent: Saturday, May 24, 2008 5:08 PM To: Shubha Vishwanath Karanth Subject: Re: [R]

[R] Solving 100th order equation

2008-05-24 Thread Shubha Vishwanath Karanth
Hi R, I have a 100th order equation for which I need to solve the value for x. Is there a package to do this? For example my equation is: (x^100 )- (2*x^99) +(10*x^50)+.. +(6*x ) = 4000 I have only one unknown value and that is x. How do I solve for this? BR,

Re: [R] Problems with lme

2008-05-24 Thread ONKELINX, Thierry
That's because you have not specified the random effect. I think you want lme(Error ~ Sequence + Temperature + Tumour, random = ~1|ID, data = YourDataset) HTH, Thierry ir. Thierry Onkelinx Instituut voor natuur- en

[R] Problems with lme

2008-05-24 Thread Dani Valverde
Hello, I want to perform an lme on a database with this structure: ID Sequence Temperature TumourError 15 0 1 8.721872e-08 15 0 2 8.695348e-08 15 0

Re: [R] Shared Library Error

2008-05-24 Thread what's in the name?
Nope, it does not :( See below Error in .Fortran("merge_xtabs_patterns_file", ydim[1], ydim[2], x = as.integer(as.matrix(y)), : Fortran symbol name "merge_xtabs_patterns_file" not in load table On Sat, May 24, 2008 at 3:41 AM, Martin Maechler <[EMAIL PROTECTED]> wrote: > > "witn" == what

Re: [R] Shared Library Error

2008-05-24 Thread Martin Maechler
> "witn" == what's in the name? <[EMAIL PROTECTED]> > on Sat, 24 May 2008 02:47:02 -0500 writes: witn> R.version gives the following output >> R.version witn>_ platform x86_64-unknown-linux-gnu witn> arch x86_64 os linux-gnu system x86_64, linux-gnu

[R] combine elements of list into a vector

2008-05-24 Thread mohamed nur anisah
Dear R, Can anybody help me on how to combine all the elements in a list into a single vector?? I've tried using unlist command but it gave me wrong output. Below is the example of the vector output that i want and attach with is my list of data. Any suggestion?? Many Thanks breakp.

Re: [R] Shared Library Error

2008-05-24 Thread what's in the name?
R.version gives the following output > R.version _ platform x86_64-unknown-linux-gnu arch x86_64 os linux-gnu system x86_64, linux-gnu status major 2 minor 6.0 year 2007 month 10 day03 svn rev

Re: [R] IDE

2008-05-24 Thread Tobias Verbeke
Hi Alexandra, I'm a ubunto user and I used to write my scipts in "Java Gui for R", but it is a very slow tool to run my scripts... Do you know some efficient IDE for R? Thank!!! I warmly recommend the StatET plugin for Eclipse, which, as you know, is a very mature, industrial-strength IDE.

Re: [R] Shared Library Error

2008-05-24 Thread Prof Brian Ripley
The problem is that underscore is an illegal symbol in a Fortran 77 name (and R only requires a Fortran 77 compiler). You have not told us your OS nor R version nor compiler+version (because what a compiler does with this is a compiler-specific extension). You should not be using the trailing

Re: [R] IDE

2008-05-24 Thread Liviu Andronic
On 5/23/08, Alexandra Almeida <[EMAIL PROTECTED]> wrote: > I'm a ubunto user and I used to write my scipts in "Java Gui for R", but it > is a very slow tool to run my scripts... > Do you know some efficient IDE for R? > There is the brand-new cross-platform SciViews OpenKore [1], successor of Wi

Re: [R] maximizing the gamma likelihood

2008-05-24 Thread Xiaohui Chen
Hi Mark, As I said in earlier emails, you do NOT need to explicitly code the likelihood function for gamma distn. I just code you example as below: vsamples<- c(14.7, 18.8, 14, 15.9, 9.7, 12.8) gamma.nll <- function(par,data) -sum(dgamma(data,shape=par[1],scale=par[2],log=T)) optim(c(1,1),ga