Re: [R] Need help putting histograms on the diagonal of a splom plot

2007-09-21 Thread Benjamin Barnes
Hello, I think the histograms may have been unintentionally omitted from the examples below. Borrowing from a couple of sources, here's a function to get the histograms instead of the density plot: panel.hist.splom-function(x, ...) { yrng - current.panel.limits()$ylim

Re: [R] Cutting pasting help examples into script window

2007-09-21 Thread Gustaf Rydevik
On 9/21/07, Muenchen, Robert A (Bob) [EMAIL PROTECTED] wrote: Now I'm working in 2.5.1 on a home machine also running XP. It has the same problem, and I think I finally figured it out. I've noticed that if the cursor is directly over the text, it becomes an I-beam. When hovering over the

[R] Building packages including Java files

2007-09-21 Thread Mark Collins
Hello all, Can someone please point me in the right direction to find the documentation that explains how to build packages that include java code. Thank you. I'm sorry if this is entirely obvious! Best regards, Mark -- Mark Collins [EMAIL PROTECTED]

Re: [R] Building packages including Java files

2007-09-21 Thread Bio7
I think you have to visit the following website to get information about java packages: http://www.rforge.net/rJava/ http://www.rforge.net/rJava/ Then of course the official R documentation which describes how to build packages for R. With kind regards Marcel -- View this message in

Re: [R] Plotmath issue superscript -

2007-09-21 Thread Gavin Simpson
On Thu, 2007-09-20 at 18:19 +0200, Peter Dalgaard wrote: Gavin Simpson wrote: Dear List, I'm trying to typeset some chemical ions in axis labels. These have both super and subscript components, and for some, I need a superscript -. In LaTeX I might use $NO_3^-$ to do the typesetting,

Re: [R] help with making a function of scatter plot with multiple variables

2007-09-21 Thread Tom Cohen
Thanks Jim for the excellent solution. Can I make this function more flexible for the usage of different numbers of parameters? Tom jim holtman [EMAIL PROTECTED] skrev: The simple way is to enclose it in a 'function' and pass parameters. Assuming that you have the same number of

[R] Would you please tell me about Parallel Markov Chains ?

2007-09-21 Thread elaheh vahidi-asl
Hi, I am a master student of statistics and already working on my thesis, which is related to Markov Chains. In one of the papers I have studied there is an expression of Parallel Markov Chains, please tell me about it, Thanks in advance

Re: [R] Cutting pasting help examples into script window

2007-09-21 Thread Duncan Murdoch
On 9/20/2007 9:23 PM, Muenchen, Robert A (Bob) wrote: Now I'm working in 2.5.1 on a home machine also running XP. It has the same problem, and I think I finally figured it out. I've noticed that if the cursor is directly over the text, it becomes an I-beam. When hovering over the blank

[R] Error using nls()

2007-09-21 Thread Dietrich Trenkler
Hallo HelpeRs, I try to reconstruct some results from an econometric text book (Heij et al. (2004), pp. 218-20). For the data x - structure(list(q1 = c(345, 331, 320, 314, 299, 395, 415, 490, 547, 656, 628, 627), d1 = c(1, 1, 1, 1, 1, 1, 1.05, 1.05, 1.05, 1.15, 1.15, 1.15)), .Names =

Re: [R] Ambiguities in vector

2007-09-21 Thread Birgit Lemcke
First of all thanks a lot for your answer. Now I will try to realize your suggestion. Greetings B Am 21.09.2007 um 11:38 schrieb James Reilly: If I understand you right, you have several multiple response variables (with the responses encoded in numeric strings) and you want to see

[R] A reproducibility puzzle with NORM

2007-09-21 Thread Ted Harding
Hi Folks, I'm using the 'norm' package (based on Shafer's NORM) on some data. In outline, (X,Y) are bivariate normal, var(X)=0.29, var(Y)=24.4, cov(X,Y)=-0.277, there are some 900 cases, and some 170 values of Y have been set missing (NA). The puzzle is that, repeating the multiple imputation

Re: [R] Error using nls()

2007-09-21 Thread Gabor Grothendieck
You need better starting values. Try setting b3=1 and solving using lm using that result as your starting values in nls: cc - coef(lm(log(q1)~d1,data=x)) cc - c(cc, 1) names(cc) - c(b1, b2, b3) nls(log(q1)~b1+(b2/b3)*(d1^b3-1),data=x,start=cc,trace=TRUE) 225.0784 : 1.515604 4.329543

Re: [R] A reproducibility puzzle with NORM

2007-09-21 Thread Prof Brian Ripley
Norm uses a Box-Muller normal RNG, and rngseed does not reset its state (it has some Fortran save variables). So if you ask for an odd number of normals and call rngseed, the next normal 'generated' is the second half of the last pair with the previous seed. Ideally packages should be

Re: [R] Importing a dataset

2007-09-21 Thread Gabor Csardi
I don't know a way of loading parts of an .RData file either, but another solution is to use the envir argument of load to load the data into a new environment: x - 1 y - rnorm(3) save.image(tmp.RData) rm(x) rm(y) load(tmp.RData, env - new.env()) get(x, env) [1] 1 get(y, env) [1]

[R] Likelihood ration test on glm

2007-09-21 Thread Chris Elsaesser
I would like to try a likelihood ratio test in place of waldtest. Ideally I'd like to provide two glm models, the second a submodel of the first, in the style of lrt (http://www.pik-potsdam.de/~hrust/tools/farismahelp/lrt.html). [lrt takes farimsa objects] Does anyone know of such a likelihood

Re: [R] Likelihood ration test on glm

2007-09-21 Thread Kevin E. Thorpe
Chris Elsaesser wrote: I would like to try a likelihood ratio test in place of waldtest. Ideally I'd like to provide two glm models, the second a submodel of the first, in the style of lrt (http://www.pik-potsdam.de/~hrust/tools/farismahelp/lrt.html). [lrt takes farimsa objects] Does

[R] truncating a data frame based on a function

2007-09-21 Thread Faheem Mitha
Hi, Consider the following example. a = c(1,2,3); b = c(4,5,6); c = cbind(a,b); c[(2 c[,1]) (c[,1] 4),] a b 3 6 So, the idea is to select rows for which the value in the first column is between 2 and 4. This works, however, I don't like having to reference a explicitly in this fashion,

Re: [R] Estimate correlation with bootstrap

2007-09-21 Thread Greg Snow
Try this: a - c(1,2,3,4,5,6,7,8,9,10) b - c(1,1,56,3,6,6,6,7,2,10) n - length(a) boot.cor.a.b - replicate( 1000, {tmp - sample(n, replace=TRUE); cor(a[tmp],b[tmp]) } ) hist(boot.cor.a.b) abline( v=c( mean(boot.cor.a.b), median(boot.cor.a.b) ), col=c('blue','green')) Hope this helps, --

Re: [R] really dumb question | loop counters in

2007-09-21 Thread Paul Hiemstra
Hi, This works: for(i in seq(1,100,5)) { print(i) } Very similar to the way python does this kind of loop. Paul Evan Cooch schreef: Basically new to [R] - as a programming environment at least (had lots of recent experience compiling it on our Opteron-based servers). Was trying to write

Re: [R] Likelihood ration test on glm

2007-09-21 Thread Wensui Liu
chris, as long as you know the log likelihood functions and the # of parameters in both models, a pencil and a piece of paper should be enough to calculate LR test. On 9/21/07, Chris Elsaesser [EMAIL PROTECTED] wrote: I would like to try a likelihood ratio test in place of waldtest. Ideally I'd

Re: [R] getAnywhere

2007-09-21 Thread Duncan Murdoch
On 9/21/2007 12:16 PM, Giovanni Petris wrote: Hello, How can I see a function called +.dlm? methods(+) [1] +.Date +.dlm* +.POSIXt Non-visible functions are asterisked getAnywhere(+.dlm) Error in grep(pattern, x, ignore.case, extended, value, fixed, useBytes) : invalid

[R] Q: appending to non-existent vector?

2007-09-21 Thread D. R. Evans
This is a real newbie question. What makes it worse is that I know I've seen the answer somewhere, but I can no longer find it. If I have a loop that is supposed to generate a vector piecemeal, adding an element each time through the loop, what do I do to stop it failing the first time around the

Re: [R] Q: appending to non-existent vector?

2007-09-21 Thread Greg Snow
Something like this: myvec - NULL while( condition ) { myvec - c(myvec, additional stuff) } However, if you know ahead of time how long the vector will be (you are adding 1 element at a time), then it is best to initialize the vector to the correct length: myvec - numeric(1000) for (i in

Re: [R] Q: appending to non-existent vector?

2007-09-21 Thread Duncan Murdoch
On 9/21/2007 1:15 PM, D. R. Evans wrote: This is a real newbie question. What makes it worse is that I know I've seen the answer somewhere, but I can no longer find it. If I have a loop that is supposed to generate a vector piecemeal, adding an element each time through the loop, what do I

Re: [R] Q: appending to non-existent vector?

2007-09-21 Thread hadley wickham
On 9/21/07, Duncan Murdoch [EMAIL PROTECTED] wrote: On 9/21/2007 1:15 PM, D. R. Evans wrote: This is a real newbie question. What makes it worse is that I know I've seen the answer somewhere, but I can no longer find it. If I have a loop that is supposed to generate a vector piecemeal,

Re: [R] Likelihood ration test on glm

2007-09-21 Thread Charles C. Berry
On Fri, 21 Sep 2007, Wensui Liu wrote: chris, as long as you know the log likelihood functions and the # of parameters in both models, a pencil and a piece of paper should be enough to calculate LR test. True enough for the LR statistic. Or follow the instructions in the _posting guide_ and

Re: [R] Is it solve.QP or is it me?

2007-09-21 Thread Berwin A Turlach
G'day Talbot, regarding the subject line, perhaps neither, it may be your OS, chip or maths library. :) On my Intel Core2 Duo machine running under linux all your examples work without error message. What kind of machine are you using? On Fri, 21 Sep 2007 12:38:05 -0400 Talbot Katz [EMAIL

Re: [R] truncating a data frame based on a function

2007-09-21 Thread Faheem Mitha
On Fri, 21 Sep 2007, Greg Snow wrote: Look at the subset function (?subset), it may do what you want. This looks useful. Thanks. However, how can I write an expression selecting certain rows (subset argument) in the case of a matrix? when it does not have named columns? The documentation

Re: [R] really dumb question | loop counters in

2007-09-21 Thread Evan Cooch
Thanks. And thanks for the C-style tip. Greg Snow wrote: Try: for(x in seq(0,1,by=0.01)) { print(x) } The for loop in S/R is what some languages call a foreach loop, you need to provide a vector of the values to loop over. If you really want a C style for loop, then just realize that

[R] duplicated names and values

2007-09-21 Thread Glazko, Galina
Dear list, I am sorry about this simple question, but somehow I can not figure out how to solve my problem, may be you could help? I have a vector mir3: length(mir3) [1] 220671 head(mir3) rno-miR-30c rno-miR-30c rno-miR-30d rno-miR-30e

Re: [R] duplicated names and values

2007-09-21 Thread John Kane
Galina, It is not clear to me. Are the names and the values always the same or are there different values for some of the names Example same name same value A B B C B A 3 2 2 1 2 3 or same names but different values A B B C B A 3 2 1 1 2 3 --- Glazko, Galina [EMAIL

[R] Adding a table to a plot area

2007-09-21 Thread Judith Flores
Is there a command to insert a table into the plot area other that using text? Thank you. Luggage? GPS? Comic books? __ R-help@r-project.org mailing list

Re: [R] Stats 101 : lm with/without intercept

2007-09-21 Thread Duncan Murdoch
On 21/09/2007 4:47 PM, Yves Moisan wrote: I am puzzled at the use of regression. I have a categorical variable ClassePop33000 which factors a Population variable into 3 levels. I want to investigate whether that categorical variable has some relation with my dependent variable, so I go :

Re: [R] duplicated names and values

2007-09-21 Thread John Kane
I was afraid of that. I am a newbie at R and while there probably is some easy way to do this I don't see it This example will, at least, show you a way to get the actual duplicate names. However I don't see any easy way without all kinds of subsetting to get what you need. nas - c(A, B , B