Re: [R] hypergeometric vs fisher.test

2010-08-13 Thread Peter Dalgaard
Andrea Franceschini wrote: I ask the question also because I found this line in Wikipedia: The test (see above) based on the hypergeometric distribution (hypergeometric test) is identical to the corresponding one-tailed version of Fisher's exact test. Is this wrong ? May I kindly ask a

[R] Unable to retrieve residual sum of squares from nls output

2010-08-13 Thread Dennis Fisher
Colleagues, I am using nls successfully (2.11.1, OS X) but I am having difficulties retrieving part of the output - residual sum of squares. I have assigned the output to FIT: FIT Nonlinear regression model model: NEWY ~ PMESOR + PAMPLITUDE * cos(2 * pi * (NEWX - POFFSET)/PERIOD)

Re: [R] Unable to retrieve residual sum of squares from nls output

2010-08-13 Thread Gabor Grothendieck
On Fri, Aug 13, 2010 at 5:21 PM, Dennis Fisher fis...@plessthan.com wrote: Colleagues, I am using nls successfully (2.11.1, OS X) but I am having difficulties retrieving part of the output - residual sum of squares.  I have assigned the output to FIT: FIT Nonlinear regression model  

Re: [R] Unable to retrieve residual sum of squares from nls output

2010-08-13 Thread Jun Shen
Hi, Dennis, Does this give what you want? sum(resid(FIT)^2) Jun Senior Pharmacokineticist Seventh Wave Labs On Fri, Aug 13, 2010 at 4:21 PM, Dennis Fisher fis...@plessthan.com wrote: Colleagues, I am using nls successfully (2.11.1, OS X) but I am having difficulties retrieving part of the

Re: [R] Unable to retrieve residual sum of squares from nls output

2010-08-13 Thread Gabor Grothendieck
On Fri, Aug 13, 2010 at 5:32 PM, Gabor Grothendieck ggrothendi...@gmail.com wrote: On Fri, Aug 13, 2010 at 5:21 PM, Dennis Fisher fis...@plessthan.com wrote: Colleagues, I am using nls successfully (2.11.1, OS X) but I am having difficulties retrieving part of the output - residual sum of

[R] Bug in t.test?

2010-08-13 Thread Johannes W. Dietrich
Hello all, due to unexplained differences between statistical results from collaborators and our lab that arose in the same large proteomics dataset we reevaluated the t.test() function. Here, we found a weird behaviour that is also reproducible in the following small test dataset:

[R] Lattice xyplots plots with multiple lines per cell

2010-08-13 Thread Robin Jeffries
Hello, I need to plot the means of some outcome for two groups (control vs intervention) over time (discrete) on the same plot, for various subsets such as gender and grade level. What I have been doing is creating all possible subsets first, using the aggregate function to create the means over

[R] Installing rJava fails on Gentoo (amd64) with Sun JDK - checking JNI data types... error

2010-08-13 Thread Anthony Staines
Installing rJava fails consistently, whether installed via the command line as below, or through install.packages( 'rJava' ), and whether 0.84 or 0.85 is used, with the message :- checking JNI data types... configure: error: One or more JNI types differ from the corresponding native type. You may

Re: [R] Bug in t.test?

2010-08-13 Thread Thomas Lumley
Thanks for the clear example. However, if there is a bug it is only that t.test.formula doesn't throw an error when given the paired=TRUE option. The documentation says The formula interface is only applicable for the 2-sample tests., but there probably should be an explicit check -- I

Re: [R] Bug in t.test?

2010-08-13 Thread Johannes W. Dietrich
Thank you for the fast reply! Although I have read the help page for t.test over and over again I have obviously overlooked the relevant sentence. The workaround that I have planned seems to be the correct use. Thanks again, J. W. D. At 15:31 Uhr -0700 13.08.2010, Thomas Lumley wrote:

Re: [R] merge function in R?

2010-08-13 Thread JesperHybel
I think it would be helpful if you could clarify youre question - do you want distinct sets - maybe use unique() but why (5,20) when its (5,10) in the row in youre example? What criteria do you want the function to select the sets by and what kind of output do you need? Maybe it's just me

Re: [R] merge function in R?

2010-08-13 Thread fishkbob
I too think I worded it incorrectly... so the second two columns of the matrix are the start and end of an interval however, because some of the intervals overlap, I want to limit the number of intervals I have to deal with. So therefore, (5 10)should merge with(7 18) making

Re: [R] decision tree finetune

2010-08-13 Thread Olga Shaganova
I figured it out myself, here it is: control=rpart.control(cp=.001)) Thank you! On Fri, Aug 13, 2010 at 12:58 PM, Olga Shaganova olga.sha...@gmail.comwrote: My decision tree grows only with one split and based on what I see in E-Miner it should split on more variables. How can I adjust

Re: [R] merge function in R?

2010-08-13 Thread David Winsemius
Neither you nor your responder have continued the eamil chain very well so let me put things back together: on Aug 13, 2010; 03:54pm fishkbob wrote subj = merge function in R? So I have a bunch of c(start,end) points and want to consolidate them into as few c(start,end) as possible. For

Re: [R] Kalman filter

2010-08-13 Thread Spencer Graves
Other terms for Kalman filtering, prediction and smoothing are state space modeling and dynamic linear models. Consider the following extension of Ben Bolker's suggestion to use the 'sos' package: library(sos) k - ???Kalman ss - findFn('state space') dlm - findFn('dynamic

Re: [R] Bug in t.test?

2010-08-13 Thread Ted Harding
Hi Thomas, I'm not too sure about your interpretation. Consider: set.seed(54321) X - rnorm(10) ; Y - rnorm(10) XY - c(X,Y); group-c(rep(0,10),rep(1,10)) t.test(X,Y,paired=TRUE) # Paired t-test # data: X and Y # t = -1.5265, df = 9, p-value = 0.1612 # 95 percent

Re: [R] Bug in t.test?

2010-08-13 Thread Peter Dalgaard
(Ted Harding) wrote: Johannes' original query was about differences when there are NAs, corresponding to different settings of na.action. It is perhaps possible that 'na.action=na.pass' and 'na.action=na.exclude' result in different pairings in the case paired=TRUE. However, it seems to me

[R] How to add lines to lattice plot produced by rms::bplot

2010-08-13 Thread David Winsemius
I have a plot produced by function bplot (package = rms) that is really a lattice plot (class=trellis). It is similar to this plot produced by a very minor modification of the first example on the bplot help page: requiere(rms) n - 1000# define sample size set.seed(17) # so can

Re: [R] Odp: help

2010-08-13 Thread milly
Please,when i export the output from R to excel.I am not getting all the 15,000 observations but only 2000.Thank you -- View this message in context: http://r.789695.n4.nabble.com/help-tp2323542p2324459.html Sent from the Export many data to Excel 2007 mailing list archive at Nabble.com.

[R] R execution

2010-08-13 Thread chantalm
So I have a for loop for (i in 1 : 5) { print(i) } and I want it to print 1, 2, 3, 4, 5 sequentially for each loop iteration. Instead, it waits for the whole loop to finish and then prints. It's strange because my R console seems to have two modes of execution. One where it will iterate for

Re: [R] how to eliminate an element of a list

2010-08-13 Thread fishkbob
list-seq(2,10,2) list [1] 2 4 6 8 10 list[-which(2==list)] [1] 4 6 8 10 using the which() will let you remove things from a list that have a specified value... I usually use the blah- blah[-which(TRUE==is.na(blah)) ] which will remove all NA values in your list -- View this message

Re: [R] hypergeometric vs fisher.test

2010-08-13 Thread TGS
or an incompetent Such harsh words Peter. You're not making this a friendly environment for people to ask questions. Is there a less competent attribute mailing list so that some of us don't offend you with our questions? On Aug 13, 2010, at 2:11 PM, Peter Dalgaard wrote: Andrea Franceschini

[R] merge function in R?

2010-08-13 Thread fishkbob
So I have a bunch of c(start,end) points and want to consolidate them into as few c(start,end) as possible. For example: sample startend A 5 10 B 7 18 C 14 D 16 20 I'd want the function to return the two distinct

Re: [R] how to eliminate an element of a list

2010-08-13 Thread fishkbob
Try to do this list - seq(1,5,1) list-list[-3] list [1] 1 2 4 5 list[-x] will remove the xth value in your list. Also you can do something like list[-c(1:4)] [1] 5 To remove values at indexes 1-4 list[-c(1,4)] [1] 2 3 5 To remove values at indexes 1 and 4 -- View this message in

Re: [R] Learning ANOVA

2010-08-13 Thread Stephen Liu
- Original Message From: Liaw, Andy andy_l...@merck.com To: Stephen Liu sati...@yahoo.com; r-help@r-project.org Sent: Sat, August 14, 2010 12:48:33 AM Subject: RE: [R] Learning ANOVA Note the names of the variables here. They don't match what you tried to use in your boxplot() call

Re: [R] Polygon Graph in lattice/ lattice extra

2010-08-13 Thread Felix Andrews
OK, I've added a 'horizontal' argument to panel.xyarea(), which is consistent with the meaning in panel.xyplot(). It is available from R-forge via SVN now, or as a built package within a day or 2 probably. Questions like this are best sent to package maintainers directly, I think. Regards #

[R] detecting a key press

2010-08-13 Thread Martin Teicher
Hi Folks, I'm relatively new to r. I'd like to have a user respond by pressing a 1 or a 2 and determining their choice and the time of response. Previous postings have indicated that keyboard responses can be processed using scan and readline but both seem to wait for the user to also press

Re: [R] different outcomes of P values in SPSS and R

2010-08-13 Thread Ben Bolker
Leo Vorthoren L.Vorthoren at nioo.knaw.nl writes: I have been using generalized linear models in SPSS 18, in order to build models and to calculate the P values. When I was building models in Excel (using the intercept and Bs from SPSS), I noticed that the graphs differed from my

[R] what is scaling in plot

2010-08-13 Thread elaine kuo
Dear List, Pls kindly advise what scaling is in plot. Sometime it could be negative but sometimes it might be positive .(I guess it is the proportion between the plot and the margin) Thanks Elaine [[alternative HTML version deleted]] __

[R] discerning species by color in cca biplot

2010-08-13 Thread elaine kuo
Dear List, I am running constrained correspondence analysis for abundance data of 7 birds. However, I would like to check which bird prefers which environment gradient by showing the species with different colors of the dots in cca plot (package vegan). Please kindly help and thank you Elaine

Re: [R] detecting a key press

2010-08-13 Thread Ben Bolker
Martin Teicher martin_teicher at hms.harvard.edu writes: I'm relatively new to r. I'd like to have a user respond by pressing a 1 or a 2 and determining their choice and the time of response. Previous postings have indicated that keyboard responses can be processed using scan and readline

Re: [R] what is scaling in plot

2010-08-13 Thread Ben Bolker
elaine kuo elaine.kuo.tw at gmail.com writes: Pls kindly advise what scaling is in plot. Sometime it could be negative but sometimes it might be positive .(I guess it is the proportion between the plot and the margin) Your question is unclear. Please give more context and/or details.

Re: [R] different outcomes of P values in SPSS and R

2010-08-13 Thread Martin Teicher
R usesType I sequential SS, not the default Type III marginal SS reported by SPSS. There is a good blog post explaining this difference along with some interesting comments -- http://myowelt.blogspot.com/2008/05/obtaining-same-anova-results-in-r-as-in.html Best Wishes, Martin H. Teicher Dept

Re: [R] different outcomes of P values in SPSS and R

2010-08-13 Thread Ben Bolker
Yes, but ... the original poster said the coefficients differed too. (The blog post you refer to deals with ANOVA (i.e. linear models) rather than GLMs (generalized linear models): it is true that the sequential/marginal distinction still applies, but I don't think that can be the *only* thing

Re: [R] Learning ANOVA

2010-08-13 Thread Stephen Liu
Hi JesperHybel, Thanks for your advice. If you're trying to follow the youtube video you have a typing mistake here: InsectSprays.aov -(test01$count ~ test01$spray) I think this should be: InsectSprays.aov -aov(test01$count ~ test01$spray) Your advice works for me. Sorry I missed aov

Re: [R] How to add lines to lattice plot produced by rms::bplot

2010-08-13 Thread Duncan Mackay
Hi David I do not know if you have done something like this. I tried str(bp.plot) which gave the section about the regions (for colours) as: $ panel.args.common:List of 8 ..$ x : num [1:2500] 27 28 29 29.9 30.9 ... ..$ y : num [1:2500] 141 141 141 141 141 ... ..$ z : num

Re: [R] different outcomes of P values in SPSS and R

2010-08-13 Thread Martin Teicher
What your saying is true. The sequential/marginal difference can account for the discrepancy in p values but not necessarily the coefficients. One thing I've found that can lead to differences in coefficients and p values between R and SPSS is whether or not you specify that a variable is a

Re: [R] how to eliminate an element of a list

2010-08-13 Thread David Winsemius
On Aug 13, 2010, at 4:06 PM, fishkbob wrote: list-seq(2,10,2) list [1] 2 4 6 8 10 list[-which(2==list)] [1] 4 6 8 10 using the which() will let you remove things from a list that have a specified value... I usually use the blah- blah[-which(TRUE==is.na(blah)) ] which will remove

Re: [R] How to add lines to lattice plot produced by rms::bplot

2010-08-13 Thread David Winsemius
On Aug 13, 2010, at 11:25 PM, Duncan Mackay wrote: Hi David I do not know if you have done something like this. I had tried a few efforts like that, starting with an examination of str(bp.plot) as you demonstrate. I tried str(bp.plot) which gave the section about the regions (for

Re: [R] R execution

2010-08-13 Thread David Winsemius
On Aug 13, 2010, at 6:57 PM, chantalm wrote: So I have a for loop for (i in 1 : 5) { print(i) } and I want it to print 1, 2, 3, 4, 5 sequentially for each loop iteration. Instead, it waits for the whole loop to finish and then prints. It's strange because my R console seems to have two

Re: [R] Learning ANOVA

2010-08-13 Thread Stephen Liu
Hi Chris, Thanks for your advice which works for me here. I'm reading; An Introduction to R http://h1.mg4.mail.yahoo.com/dc/launch?sysreq=ignore NOT finish yet. Also I found many tutorials on Internet. I'll take me time going through all of them. I'm interesting reading tutorial with demo.

Re: [R] merge function in R?

2010-08-13 Thread Charles C. Berry
On Fri, 13 Aug 2010, fishkbob wrote: So I have a bunch of c(start,end) points and want to consolidate them into as few c(start,end) as possible. For example: sample startend A 5 10 B 7 18 C 14 D 16 20 I'd want

<    1   2